Creating ST Programming Language Projects in Siemens and Mitsubishi PLCs

In Siemens PLCs, the structured language is referred to as SCL, which is the ST language. In the current TIA Portal programming software, programs and data are presented in the form of “blocks”. The data block (DB) is equivalent to data registers in other PLCs.

First, open the TIA Portal software (using version V16 here), create a project file, and double-click “Add New Block” in the project tree to open the dialog box for adding a new block as shown below:


The DB block mentioned above is similar to a data register;
OB is the organization block, FC is a function, and FB is a function block similar to the POU in other PLCs. After creating a project, it will default to include an OB1 organization block, and the programming language defaults to ladder diagram. If you want to use ST language in OB1, you can only do so in the editing area by right-clicking and selecting “Insert SCL Program Segment” from the pop-up dialog, as shown below:


If we want to program entirely in ST language in OB1, we can select the default OB1 block and delete it, then double-click “Add New Block” in the pop-up dialog to add a new organization block OB, selecting “SCL” as the programming language, as shown below:


After the changes are completed, you will see that the programming method in the program editing area has changed to ST language, as shown below:


If you want to program the newly added FC or FB in ST language, similarly double-click “Add New Block” in the pop-up dialog, select FC function or FB function block, and choose SCL as the programming language to edit the program in ST language, as shown below:


Next, using the added FB function block as an example, let’s explain the purpose of each part of the editing window:


As shown in the figure above, the upper part is the parameter area, used to define the local variables of the function block;
The lower part is the program editing area, with the left side for expanding and collapsing the program. For example, in this case, the IF statement can be collapsed into one line or expanded.
The right side displays the line numbers of the program, indicating the line number of the program code;
Similar to curly braces, the outline symbols indicate the scope of the statements, and the double slashes are comment symbols, similar to the usage in development languages;
ST Language in Mitsubishi PLCs
In Mitsubishi PLCs, there are currently multiple programming software available for different models of PLCs. Here, we will take GX Works2 as an example to demonstrate the application of ST language programming in Mitsubishi PLCs.
First, open the Work2 software, create a new project, selecting the PLC series as FXCPU and the model as FX3U;
Project Type: Here, select “Structured Project”;
Language: Select “ST”, as shown below:


Note: The ST language can only be used for programming when the project type is selected as “Structured Project”. Simple projects can only use ladder diagrams or SFC programming methods, as shown below:


For the ST programming language, it lies between PLC ladder diagrams and development languages. It does not have the “professionalism” of development languages but conforms to the logical programming thought of development languages. Different PLCs can communicate with each other, and it has stronger computational capabilities than ladder diagrams, so learning and using it is necessary.
