How do you define the constants in an S7-SCL program in STEP 7 (TIA Portal)?
Instructions In this video we will show you how you can define the constants in an S7-SCL program in STEP 7 (TIA Portal).
The definition of the constants in S7-SCL is different in the TIA Portal and in STEP 7 V5.x Classic. In STEP 7 V5.x Classic you can only define the local constants in the declaration part of the SCL block code and use them in the program.
In STEP 7 (TIA Portal) it is not possible to define constants in the declaration part of the SCL program code. STEP 7 (TIA Portal) differentiates between local and global user constants that you can define in the block interface or in the PLC tags.
Open the block in the S7-SCL programming language, in this example FC1.
Define your local user constants in the block interface under "Constant".
Here you must define a data type for the use constants.
You can then use the constants in the block program and create your program. Only use local constants within a block. In this way the block remains universal and can be used in a library.
You define the global user constants, which are to be available CPU-wide, in the PLC tags.
Open the PLC tags and switch to the "User constants" tab.
Define your global constants. You must also specify the data type when defining the global user constants.
This allows you to define constants that have a fixed value that cannot change during program runtime.
扫码分享