×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 17682910, Entry date: 01/13/2010
(0)
Rate

Example showing the syntax of functions, function blocks and programs as well as type definitions in Structured Text (ST) sources (units) in SIMOTION

  • Entry
  • Associated product(s)

QUESTION:
When inserting an ST program from the project browser, the ST editor only generates a basic program comprising an interface and an implementation section. The individual source segments and program organizational units (POE) such as function block (FB), function (FC) and program and the related syntax are not provided.

ANSWER:
Two ST sources, major POEs and the related syntax as well as the definition of structures and arrays and their declaration are explained in the following. The available sources can be imported, compiled and used immediately.

The first source comprises all major source segments (FB, FC, program and expression), the definition of types (arrays and structures) and the declaration of variables. All source segments are provided with comments regarding their function and use.

sttemp_l_en.st ( 17 KB )

The second source basically corresponds to the first one. Only the comments have been removed. Both sources can be compiled directly following the import.

sttemp_s_en.st ( 4 KB )

To import the source in SCOUT, proceed as follows:

  1. Click with the right mouse button on the file name
  2. Select "Save target as ..." to store the ST source in an arbitrary directory.
  3. Click with the right mouse button on the directory Programs in the project browser to import an external ST source.
  4. Browse to the directory selected under 2.) and select the file.
  5. Assign a unit name to the ST source file

You can integrate your own program sections in the FB, FC and program folders directly following the import. The source template, however, can also be compiled immediately without using a separate code.

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
http://www.siemens.com/industrialsecurity.