~~NOCACHE~~
====== LamaPLC: Simatic S7 SCL commands with examples ======
{{ :simatic:lama19.png?100|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//
\\
* [[simatic:scl_commands_bit_logic|Simatic S7 SCL commands: Bit logic operations]]
* [[simatic:scl_commands_math|Simatic S7 SCL commands: Trigonometric / math functions]]
* [[simatic:scl_commands_timer_counter|Simatic S7 SCL commands: Timer / counter functions]]
* [[simatic:scl_commands_conversion|Simatic S7 SCL commands: Conversions]]
* [[simatic:scl_commands_move|Simatic S7 SCL commands: Move / memory operations]]
* [[simatic:scl_commands_variant|Simatic S7 SCL commands: Variant]]
\\
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|
^[[:simatic:scl_commands_bit_logic#edge_monitor|positive / negative edge monitoring]]|[[simatic:scl_commands_bit_logic|bit-logic]]|summary of edge monitoring|-|-|
^**[[:simatic:scl_commands_bit_logic#r_trig|R_TRIG]]**|[[simatic:scl_commands_bit_logic|bit-logic]]|detect positive signal edge|Detect positive signal edge|-|
^**[[:simatic:scl_commands_bit_logic#r_trig|F_TRIG]]**|[[simatic:scl_commands_bit_logic|bit-logic]]|detect negative signal edge|Detect negative signal edge|-|
^**[[:simatic:scl_commands_math#abs|ABS]]**|[[simatic:scl_commands_math|math]]|absolute value|Value of the “ABS” (absolute value) math function|-|
^**[[:simatic:scl_commands_math#cos|COS/ACOS]]**|[[simatic:scl_commands_math|math]]|cosine|value of the “COS” (cosie) trigonometric function|-|
^**[[:simatic:scl_commands_math#cos|ACOS]]**|[[simatic:scl_commands_math|math]]|arccosine|value of the “ACOS” (arccosine) trigonometric function|-|
^**[[:simatic:scl_commands_math#exp|EXP]]**|[[simatic:scl_commands_math|math]]|exponential|Value of the “EXP” (exponent from the base e (e = 2.718282)) math function|-|
^**[[:simatic:scl_commands_math#frac|FRAC]]**|[[simatic:scl_commands_math|math]]|fractal|Value of the “FRAC” (fraction) math function|-|
^**[[:simatic:scl_commands_math#limit|LIMIT]]**|[[simatic:scl_commands_math|math]]|set limit|Limits the value of the parameter|-|
^**[[:simatic:scl_commands_math#ln|LN]]**|[[simatic:scl_commands_math|math]]|natural logarithm|Value of the “LN” (natural logarithm to the base e (e = 2.718282)) math function|-|
^**[[:simatic:scl_commands_math#max|MAX]]**|[[simatic:scl_commands_math|math]]|get maximum|Get maximum of maximum 32 inputs|-|
^**[[:simatic:scl_commands_math#min|MIN]]**|[[simatic:scl_commands_math|math]]|get minimum|Get minimum of maximum 32 inputs|-|
^**[[:simatic:scl_commands_math#sin|SIN]]**|[[simatic:scl_commands_math|math]]|sinus|Value of the “SIN” (sinus) trigonometric function|-|
^**[[:simatic:scl_commands_math#sin|ASIN]]**|[[simatic:scl_commands_math|math]]|arcsine|Value of the “ASIN” (arcsine) trigonometric function|-|
^**[[:simatic:scl_commands_math#sqr|SQR]]**|[[simatic:scl_commands_math|math]]|square|Value of the “SQR” (square) math function|-|
^**[[:simatic:scl_commands_math#sqrt|SQRT]]**|[[simatic:scl_commands_math|math]]|square root|Value of the “SQRT” (square root) math function|-|
^**[[:simatic:scl_commands_math#tan|TAN]]**|[[simatic:scl_commands_math|math]]|tangent|value of the “TAN” (tangent) trigonometric function|-|
^**[[:simatic:scl_commands_math#tan|ATAN]]**|[[simatic:scl_commands_math|math]]|arctangent|value of the “ATAN” (arctangent) trigonometric function|-|
^**[[:simatic:scl_commands_timer_counter#iec_timers|IEC timers]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|Summary IEC timer FBs|-|
^**[[:simatic:scl_commands_timer_counter#ton|TON]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|Generate on-delay)|The TON “switch-on delay” function|-|
^**[[:simatic:scl_commands_timer_counter#tof|TOF]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|Generate off-delay)|The TOF “switch-off delay” function|-|
^**[[:simatic:scl_commands_timer_counter#tp|TP]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|Generate pulse)|The TP “pulse generator” function|-|
^**[[:simatic:scl_commands_timer_counter#tonr|TONR]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|Time accumulator)|The TONR “time accumulator” function|-|
^**[[:simatic:scl_commands_timer_counter#ctu|CTU]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|count up|The function that only counts upwards|-|
^**[[:simatic:scl_commands_timer_counter#ctd|CTD]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|count down|The function that only counts downwards|-|
^**[[:simatic:scl_commands_timer_counter#ctud|CTUD]]**|[[simatic:scl_commands_timer_counter|timer/counter]]|count up and down|The function that counts up- and downwards|-|
^**[[:simatic:scl_commands_conversion#round|ROUND]]**|[[simatic:scl_commands_conversion|conversion]]|Rounding|Round numerical value|-|
^**[[:simatic:scl_commands_conversion#ceil|CEIL]]**|[[simatic:scl_commands_conversion|conversion]]|round up|Generate next higher integer from floating-point number|-|
^**[[:simatic:scl_commands_conversion#floor|FLOOR]]**|[[simatic:scl_commands_conversion|conversion]]|round down|Generate next lower integer from floating-point number|-|
^**[[:simatic:scl_commands_conversion#trunc|TRUNC]]**|[[simatic:scl_commands_conversion|conversion]]|Truncate|Truncate numerical value|-|
^**[[:simatic:scl_commands_conversion#scale_x|SCALE_X]]**|[[simatic:scl_commands_conversion|conversion]]|Scale|-|-|
^**[[:simatic:scl_commands_conversion#norm_x|NORM_X]]**|[[simatic:scl_commands_conversion|conversion]]|Normalize|-|-|
^**[[:simatic:scl_commands_conversion#scale|SCALE]]**|[[simatic:scl_commands_conversion|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**|[[simatic:scl_commands_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.|-|
^**[[:simatic:scl_commands_move#blkmov|BLKMOV]]**|[[simatic:scl_commands_move|move]]|move pointer block|- Move the content of a memory area (source area) to another memory area (destination area)|-|
^**[[:simatic:scl_commands_move#move_blk|MOVE_BLK]]**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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|
^**[[simatic:scl_commands_move#fill_blk|FILL_BLK]]**|[[simatic:scl_commands_move|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|
^**[[simatic:scl_commands_move#ufill_blk|UFILL_BLK]]**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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 |S7-1500 or \\ S7-1200 > FW4.1|
^**SWAP**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_move|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**|[[simatic:scl_commands_variant|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**|[[simatic:scl_commands_variant|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**|[[simatic:scl_commands_variant|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()**|[[simatic:scl_commands_variant|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()**|[[simatic:scl_commands_variant|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**|[[simatic:scl_commands_variant|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**|[[simatic:scl_commands_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|
\\
\\
{{tag>Simatic S7 SCL TIA commands reference main_menu}}
\\
This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}