Declaration Rules for Variables/FB Instances

 

This topic contains information on the following:

The declaration rules listed below apply when declaring variables

Declaration Rules

Variables are declared in accordance with the rules defined by the stan­dard IEC 61131-3.

Since declarations are entered in a variables worksheet in EcoStruxure Machine Expert - Safety instead of entering plain text declaration blocks, the rules and restrictions given by the standard are verified by the grid based editor. Syntactical errors and violations of rules such as nesting errors of declaration blocks or incorrect data types are prevented. The variables compiler verifies each entered attribute immediately after leaving the grid input field. Fields that contain an error are displayed red.

Further Information

Refer to the topic "Variables Worksheets" for details.

The different variables have to be declared as follows:

Further Information

Further information can be found in the topics "Columns (Proper­ties) in Variables Worksheets" and "IEC 61131 Implemen­tation - Variables".

Safety-related and standard variables in FBD/LD code

Safety-related and standard code is strictly distinguished in EcoStruxure Machine Expert - Safety. Therefore, also safety-related and standard variables, or more precise, safety-related and standard data types, are distinguished. It is, for example, not possible to connect a variable with a standard data type to a formal parameter which expects a safety-related variable.

NOTE:

Safety-related and standard variables can be mixed in FBD/LD networks. In such mixed networks, leading safety-related signal paths are visually distinguished. Some rules and restrictions must be observed.

Safety-related and standard variables in ST

Safety-related and standard variables can be mixed within one ST state­ment if particular rules are observed. Generally, safety-related variables can be assigned to standard variables but not vice versa.

Further Information

Refer to the topic "Mixing safety-related and standard variables in ST" for details.

For easier distinction of standard and safety-related variables, they are visually distinguished in the ST code editor. Safety-related variables are underlined in red, standard variables are not underlined.