meta data for this page
LamaPLC: Simatic S7 SCL commands with examples
- The chapter is not finished yet. I am still working on the (black) Instructions without links. - Vamos 06.06.2023
SCL is the most effective programming language for Simatic systems. It is high-level, suitable for cycle organization, the use of CASE structures, its code can be edited with an external editing program or created with external generators.
Instruction / Command | Type of op | Usage | Properties | Note |
---|---|---|---|---|
positive / negative edge monitoring | bit-logic | summary of edge monitoring | - | - |
R_TRIG | bit-logic | detect positive signal edge | Detect positive signal edge | - |
F_TRIG | bit-logic | detect negative signal edge | Detect negative signal edge | - |
ABS | math | absolute value | Value of the “ABS” (absolute value) math function | - |
COS/ACOS | math | cosine | value of the “COS” (cosie) trigonometric function | - |
ACOS | math | arccosine | value of the “ACOS” (arccosine) trigonometric function | - |
EXP | math | exponential | Value of the “EXP” (exponent from the base e (e = 2.718282)) math function | - |
FRAC | math | fractal | Value of the “FRAC” (fraction) math function | - |
LIMIT | math | set limit | Limits the value of the parameter | - |
LN | math | natural logarithm | Value of the “LN” (natural logarithm to the base e (e = 2.718282)) math function | - |
MAX | math | get maximum | Get maximum of maximum 32 inputs | - |
MIN | math | get minimum | Get minimum of maximum 32 inputs | - |
SIN | math | sinus | Value of the “SIN” (sinus) trigonometric function | - |
ASIN | math | arcsine | Value of the “ASIN” (arcsine) trigonometric function | - |
SQR | math | square | Value of the “SQR” (square) math function | - |
SQRT | math | square root | Value of the “SQRT” (square root) math function | - |
TAN | math | tangent | value of the “TAN” (tangent) trigonometric function | - |
ATAN | math | arctangent | value of the “ATAN” (arctangent) trigonometric function | - |
IEC timers | timer/counter | Summary IEC timer FBs | - | |
TON | timer/counter | Generate on-delay) | The TON “switch-on delay” function | - |
TOF | timer/counter | Generate off-delay) | The TOF “switch-off delay” function | - |
TP | timer/counter | Generate pulse) | The TP “pulse generator” function | - |
TONR | timer/counter | Time accumulator) | The TONR “time accumulator” function | - |
CTU | timer/counter | count up | The function that only counts upwards | - |
CTD | timer/counter | count down | The function that only counts downwards | - |
CTUD | timer/counter | count up and down | The function that counts up- and downwards | - |
ROUND | conversion | Rounding | Round numerical value | - |
CEIL | conversion | round up | Generate next higher integer from floating-point number | - |
FLOOR | conversion | round down | Generate next lower integer from floating-point number | - |
TRUNC | conversion | Truncate | Truncate numerical value | - |
SCALE_X | conversion | Scale | - | - |
NORM_X | conversion | Normalize | - | - |
SCALE | conversion | Scale | - | - |
RUNTIME | runtime | measures the runtime | The “RUNTIME” instruction measures the runtime of the entire program, individual blocks or command sequences | only S7-1500 |
MOVE | move | Copy value | - Copies the content of the parameter on the input IN to the parameter of the output OUT. - The parameters on the input and output must be of the same data type. - Parameters can also be structured tags (PLC data types). - Copies complete arrays and structures. | - |
BLKMOV | move | move pointer block | - Move the content of a memory area (source area) to another memory area (destination area) | - |
MOVE_BLK | move | move array block | - Copies the content of an array to another array. - Source and target array must be of the same data type. - Copies complete arrays and structures. - Copies several array elements with structures as well. In addition, start and number of elements can be specified. | - |
UMOVE_BLK | move | Copies array without interruption | - Copies the content of an array consistently without the risk of the OB interrupting the copying process. - Source and target array must be of the same data type. | - |
MOVE_BLK_VARIANT | move | Copy array | Copies one or several structured tag(s) (PLC data types) - Recognizes data types at runtime - Supplies detailed error information - Apart from the elementary and structured data types, PLC data types, arrays, and array DBs are also supported. | - |
Serialize | move | converts structured data into a byte array | - Several data records can be combined into a single byte array and, for example, be sent to other devices as a message frame. - Input and output parameters can be transferred as data type Variant. | S7-1500 or S7-1200 > FW4.1 |
Deserialize | move | converts one byte array into one or several structure/s | - Application case I-Device: The I device receives several data records in the input area which are copied to different structures. - Several data records can be combined into a single byte array. Deserialize enables copying these to different structures. | S7-1500 or S7-1200 > FW4.1 |
FILL_BLK | move | Fill a memory area | - The instruction can only be executed if the source range and the target range have the same data type - The maximum number of elements changed is the number of elements in the ARRAY or structure | S7-1500 or S7-1200 > FW4.1 |
UFILL_BLK | move | Fill block uninterruptible | - The instruction can only be executed if the source range and the target range have the same data type - The maximum number of elements changed is the number of elements in the ARRAY or structure - The instruction cannot be interrupted | S7-1500 or S7-1200 > FW4.1 |
SCATTER | move | Parse the bit sequence into individual bits | - BYTE, WORD, DWORD or LWORD data type into individual bits and saves them in an ARRAY of BOOL, an anonymous STRUCT or a PLC data type exclusively with Boolean elements | S7-1500 or S7-1200 > FW4.1 |
SCATTER | move | Parse the bit sequence into individual bits | - BYTE, WORD, DWORD or LWORD data type into individual bits and saves them in an ARRAY of BOOL, an anonymous STRUCT or a PLC data type exclusively with Boolean elements | S7-1500 or S7-1200 > FW4.1 |
SCATTER_BLK | move | Parse elements of an ARRAY of bit sequence into individual bits | - parses one or more elements of an ARRAY of BYTE, WORD, DWORD or LWORD into individual bits and saves them in an ARRAY of BOOL, an anonymous STRUCT or a PLC data type exclusively with Boolean elements | S7-1500 or S7-1200 > FW4.1 |
GATHER | move | Merge individual bits into a bit sequence | Merges the bits from an ARRAY of BOOL, an anonymous STRUCT or a PLC data type exclusively with Boolean elements into a bit sequence. The bit sequence is saved in a tag of the data type BYTE, WORD, DWORD or LWORD | S7-1500 or S7-1200 > FW4.1 |
GATHER_BLK | move | Merge individual bits into multiple elements of an ARRAY of bit sequence | Merges the bits from an ARRAY of BOOL, an anonymous STRUCT or a PLC data type exclusively with Boolean elements into one or multiple elements of an ARRAY of <bit sequence> | S7-1500 or S7-1200 > FW4.1 |
SWAP | move | Swap; change the arrangement | Change the arrangement of the bytes of an input value and save the result in the specified operand | S7-1500 or S7-1200 > FW4.1 |
ReadFromArrayDB | move | Read from array data block | Read the element from a data block of the ARRAY DB block type to which the index references, and write the value of the element to the target range | S7-1500 or S7-1200 > FW4.1 |
WriteToArrayDB | move | Write to array data block | Write the element to which the index references to a data block of the ARRAY DB block type | S7-1500 or S7-1200 > FW4.1 |
ReadFromArrayDBL | move | Read from array data block in load memory | Read the element ti which the index references from a data block of the ARRAY DB block type in the load memory and write it to the target range | S7-1500 or S7-1200 > FW4.1 |
WriteToArrayDBL | move | Write to array data block in load memory | Write the element to which the index references to a data block of the ARRAY DB block type in load memory | S7-1500 or S7-1200 > FW4.1 |
PEEK | move | Read memory address | Read a memory address from a standard memory area without specifying a data type | S7-1500 or S7-1200 > FW4.1 |
PEEK_BOOL | move | Read memory bit | Read a memory bit from a standard memory area without specifying a data type | S7-1500 or S7-1200 > FW4.1 |
POKE | move | Write memory address | Write a memory address to a standard memory area without specifying a data type | S7-1500 or S7-1200 > FW4.1 |
POKE_BOOL | move | Write memory bit | Write a memory bit to a standard memory area without specifying a data type | S7-1500 or S7-1200 > FW4.1 |
POKE_BLK | move | Write memory area | Write a memory area to a different standard memory area without specifying a data type | S7-1500 or S7-1200 > FW4.1 |
READ_LITTLE | move | Read data in little endian format | Read data from a memory area and to write this to a single tag in the little endian byte sequence | S7-1500 or S7-1200 > FW4.1 |
WRITE_LITTLE | move | Write data in little endian format | Write the data of a single tag in the little endian byte sequence to a memory area | S7-1500 or S7-1200 > FW4.1 |
READ_BIG | move | Read data in big endian format | Read data from a memory area and to write this to a single tag in the big endian byte sequence | S7-1500 or S7-1200 > FW4.1 |
WRITE_BIG | move | Write data in big endian format | Write the data of a single tag in the big endian byte sequence to a memory area | S7-1500 or S7-1200 > FW4.1 |
VariantGet | variant | Read value | This instruction enables you to read the value of a tag pointing to a VARIANT. | S7-1500 or S7-1200 > FW4.1 |
VariantPut | variant | Write value | This instruction enables you to write the value of a tag pointing to a VARIANT. | S7-1500 or S7-1200 > FW4.1 |
CountOfElements | variant | Counting elements | With this instruction you poll the number of ARRAY elements of a tag pointing to a VARIANT | S7-1500 or S7-1200 > FW4.1 |
TypeOf() | variant | Determining the data type | Use this instruction to poll the data type of a tag pointing to a VARIANT | only SCL S7-1500 or S7-1200 > FW4.1 |
TypeOfElements() | variant | Determining the array data type | Use this instruction to poll the data type of the ARRAY elements of a tag pointing to a VARIANT. | only SCL S7-1500 or S7-1200 > FW4.1 |
VARIANT_TO_DB_ANY | variant | Determining the data block number | This instruction queries the data block number of an instance data block of a PLC data type, system data type or array DB. | only SCL S7-1500 or S7-1200 > FW4.1 |
DB_ANY_TO_VARIANT | variant | Created from a data block of a variant tag. | This instruction creates the variant tag of an instance data block of a PLC data type, system data type or array DB | only SCL S7-1500 or S7-1200 > FW4.1 |
This page has been accessed for: Today: 1, Until now: 398