How to use Different MOV BLOCK in Siemens TIA Portal – Part 1
MOVE Block’s Part 1
In this article, we will see different Move Blocks used in the Siemens TIA Portal. The Siemens TIA Portal Move blocks are:
S. NO | TYPES OF FUNCTIONS | FUNCTION |
1 | MOVE | Move the data from the input address direct or indirect to the output address direct or indirect |
2 | MOVE_BLK | The “Move block” instruction transfers data from one memory area (source range) to another (target range). The input COUNT specifies how many elements need to be moved to the target range. |
3 | UMOVE_BLK | The “Move block” instruction transfers data from one memory area (source range) to another (target range) without any interruption. The input COUNT specifies how many elements need to be moved to the target range. |
4 | FILL_BLK | Starting with the address given at the OUT output, the target range is filled. The COUNT parameter specifies the number of repeated copy operations. |
5 | UFILL_BLK | Starting with the address given at the OUT output, the target range is filled without any interruption. The COUNT parameter specifies the number of repeated copy operations. |
6 | SWAP | The “Swap” command modifies the byte order at input IN and queries the output OUT result. |
Different MOVE Blocks of PLC Ladder Logic used in Siemens TIA Portal
MOVE
MOVE_BLK
UMOVE_BLK
FILL_BLK
UFILL_BLK
SWAP
Declaration of Address for Different MOVE Block
S. No | Operation | Input/Output Address | Input Address | Data type |
1 | MOVE | Input | %M0.6 | Please refer to the below explanation for the data type of each block |
2 | MOVE_BLK | Input | %M0.1 | |
3 | UMOVE_BLK | Input | %M0.2 | |
4 | FILL_BLK | Input | %M0.3 | |
5 | UFILL_BLK | Input | %M0.4 | |
6 | SWAP | Input | %M0.5 |
Working with different MOVE Functions used in the Siemens TIA Portal
Siemens TIA Portal V16 software is used to develop the PLC program. As stated above, the following Sections explain the various PLC Move blocks.
MOVE Instruction
- The MOVEInstruction is used to move the data from one address to another address directly or indirectly.
- The data type for input and output address can be declared based on the user requirement.
- The MOVE instruction has EN, IN, ENO, and OUT signals.
S. No | Instruction | Meaning |
1 | EN | This signal enables the MOVE instruction. |
2 | IN | IN stands for Input signal for assigning the input data. The data type for IN is shown in the below table. |
3 | ENO | It enables the other instruction connected to MOVE instruction |
4 | OUT | OUT stands for transferred data from IN. The data type for IN is shown in the below table. |
ENO | Condition | Result |
1 | No error | All COUNT elements were successfully copied. |
0 | The memory area that is available is either exceeded by the source (IN) range or the destination (OUT) range. | Elements that fit are copied. No partial elements are copied. |
- Once the %M0.2 input switch is ON the data from IN is transferred to the OUT.
- The OUT can increase up to n elements.
- The data type for declaring the IN and OUT is shown below
Parameter | Data type | Description |
IN | DWord, Char, Array, Struct, DTL, Time, Real, LReal, SInt, Int, DInt, USInt, UInt, UDInt, and Byte | Source address |
OUT | DWord, Char, Array, Struct, DTL, Time, Real, LReal, SInt, Int, DInt, USInt, UInt, UDInt, and Byte | Destination address |
MOVE_BLK Instruction
- The MOVE_BLK Instruction is used to move the data from one block(array) to another block(array).
- The data type for input and output data type can be declared based on the user’s requirement.
- The MOVE_BLK instruction has EN, IN, ENO, and OUT signals.
S. No | Instruction | Meaning |
1 | EN | This signal enables the MOVE instruction. |
2 | IN | IN stands for Input signal for assigning the input data. The data type for IN is shown in the below table. |
3 | ENO | It enables the other instruction connected to MOVE instruction |
4 | OUT | OUT stands for transferred data from IN. The data type for IN is shown in the below table. |
5 | COUNT | The number of elements or an arraycan be moved |
- Once the %M0.0 input switch is ON the array of data from IN is transferred to the OUT array.
- The COUNT signal declares the number of elementsthat can be moved from IN to OUT.
- The data type for declaring the IN and OUT is shown below
Parameter | Data type | Description |
IN | Real, LReal Byte, USInt, UInt, UDInt, SInt, Int, DInt, | Source start address |
Word, DWord | ||
COUNT | UInt | Number of data elements to copy |
OUT | Real, LReal, Byte, USInt, UInt, UDInt, SInt, Int, DInt, | Destination start address |
Word, DWord |
UMOVE_BLK (Move Block Uninterruptible) INSTRUCTION
(The umove_blk is similar to move_blk Instruction)
The difference between mov_blk and umov_blk is, the umove is uninterruptible instruction. Interrupt handling is different for the MOVE_BLK and UMOVE_BLK instructions.
MOVE_BLK | UMOVE_BLK |
During MOVE_BLK execution, interrupt events are queued and handled. If the destination data is not required to be consistent or if it is utilized within an interrupt OB subprogram, utilize the MOVE_BLK instruction. A completed and consistent data element has been moved to the destination address if a MOVE_BLK operation is interrupted. After the interrupt OB execution, the MOVE_BLK operation is started again. | Until UMOVE_BLK execution is finished, interrupt events are queued but not processed. Before the execution of an interrupt OB subprogram, use the UMOVE_BLK instruction when the move operation needs to be finished and the destination data consistent. |
FILL_BLK
- The FILL_BLK Instruction is used to move the data from one block(array) to another block(array).
- The data type for input and output data type can be declared based on the user’s requirement.
- The FILL_BLK instruction Fill the single data to multiple elements or array
- The FILL_BLK instruction has similar signals like MOVE_BLKEN, IN, ENO, and OUT signals. (Here IN is single data and OUT is array data)
- Once the %M0.3 input switch is ON the data from IN is transferred to the OUT array.
- The COUNT signal declares the number of elements that can be moved from IN to OUT.
- The data type for declaring the IN and OUT is shown below
Parameter | Data type | Description |
IN | DWord, Word, Byte, Real, LReal, USInt, UInt, UDInt, and SInt, Int, DIntT | Data source address |
COUNT | USInt, UInt | Number of data elements to copy |
OUT | Byte, Word, DWord, Real, LReal, USInt, UInt, UDInt, and SInt, Int, DIntT | Data destination address |
UFILL_BLK (Fill Block Uninterruptible) INSTRUCTION
The difference between fill_blk and ufill_blk is, the ufill is uninterruptible instruction. Interrupt handling is different for the FILL_BLK and UFILL_BLK instructions.
SWAP
- The SWAPInstruction is used to swap the input bits from left to right to right to left at the output.
- the “Swap” command to query the result at output OUT and alter the order of the bytes at input IN.
- The SWAP instruction has similar signals like MOVE_BLKEN, IN, ENO, and OUT signals. (Here IN is either single data (Word or DWord) and OUT(Word or DWord) is similarly single or array data)
- Once the %M0.5 input switch is ON the data from IN is SWAPED to the OUT.
- The data type for declaring the IN and OUT is shown below
Parameter | Data type | Description |
IN | Word, DWord | Ordered data bytes IN |
OUT | Word, DWord | Reverse-ordered data bytes OUT |
The following is a list of the procedures you can follow to program ladder logic on the SIEMENS TIA portal. (Simulation).
Note: Please refer to the previously mentioned article for a comprehensive explanation of how to program ladder logic using the Siemens TIA Portal.
Simulation screenshots of Different MOVE Blocks
MOVE
The simulation result of the MOVE block is shown below
When the input switch is ON the data stored in the input is transferred to the output
The input data is stored in the Data block. The input and output address of the MOVE Instruction can be declared here. The data declared to each instruction is either single data or an array of data. Since the MOVE Instruction is single data instruction. The data is declared as shown below (The values can be declared during run time using SIM TABLE)
Clicking over the Data_block1 the data can be entered to the corresponding input.The figure given below shows how to enter the value and configure other data.
The data entered in the data block should be in “run” mode.
The results are obtained in Data_Output as mentioned earlier.
In the MOVE block same data will be reflected. This way the MOVE instruction can be executed and the result can be viewed. The MOVE block after the final execution is shown below.
MOVE_BLK
The simulation result of the MOVE_BLK block is shown below
When the input switch is ON the data stored in the input is transferred to the output
The input data is stored in the Data block. The input and output address of the MOVE_BLK Instruction can be declared here. The data declared to each instruction is an array of data. Since the MOVE_BLK Instruction is an array data instruction. The data is declared as shown below (The values can be declared during run time using SIM TABLE.
Clicking over the Data_block1 the data can be entered to the corresponding input.The figure given below shows how to enter the value and configure other data
The data entered in the data block should be in “run” mode.
The results are obtained in Input(variable name) as mentioned earlier.
In the MOVE_BLK block same data will be reflected. This way the MOVE_BLK instruction can be executed and the result can be viewed. The MOVE_BLK block after the final execution is shown below
(In MOVE_BLK the array of data can be moved to a specified output address, but in MOVE only single data is transferred)
UMOVE_BLK
The simulation result of the UMOVE_BLK block is shown below
When the input switch is ON the data stored in the input is transferred to the output
The input data is stored in the Data block. The input and output address of the UMOVE_BLK Instruction can be declared here. The data declared to each instruction is an array of data. Since the MOVE_BLK Instruction is an array data instruction. The data is declared as shown below (The values can be declared during run time using SIM TABLE
Clicking over the Data_block1 the data can be entered to the corresponding input. The figure given below shows how to enter the value and configure other data.
The data entered in the data block should be in “run” mode.
The results are obtained in Output (variable name) as mentioned earlier.
In the UMOVE_BLK block same data will be reflected. This way the MOVE_BLK instruction can be executed and the result can be viewed. The MOVE_BLK block after the final execution is shown below.
(In MOVE_BLK the array of data can be moved to a specified output address, but in MOVE only single data is transferred)
FILL_BLK
The simulation result of the FILL_BLK block is shown below.
When the input switch is ON the data stored in the input is transferred to the output
The input data is stored in the Data block. The input and output address of the FILL_BLK Instruction can be declared here. The data declared on the input side is single data and the output is array data. The data is declared as shown below (The values can be declared during run time using SIM TABLE)
Clicking over the Data_block1 the data can be entered to the corresponding input.The figure given below shows how to enter the value and configure other data.
The data entered in the data block should be in “run” mode.
The results are obtained in Input (variable name) as mentioned earlier.
In the FILL_BLK block same data will be reflected. This way the FILL_BLK instruction can be executed and the result can be viewed. The MOVE_BLK block after the final execution is shown below.
(In FILL_BLK the single data can be moved to a specified array)
UFILL_BLK
The simulation result of the UFILL_BLK block is shown below.
When the input switch is ON the data stored in the input is transferred to the output
The input data is stored in the Data block. The input and output address of the UFILL_BLK Instruction can be declared here. The data declared on the input side is single data and the output is array data. The data is declared as shown below (The values can be declared during run time using SIM TABLE)
Clicking over the Data_block1 the data can be entered to the corresponding input. The figure given below shows how to enter the value and configure other data.
The data entered in the data block should be in “run” mode.
The results are obtained in Input (variable name) as mentioned earlier.
In the FILL_BLK block same data will be reflected. This way the FILL_BLK instruction can be executed and the result can be viewed. The MOVE_BLK block after the final execution is shown below.
(In FILL_BLK the single data can be moved to a specified array)
SWAP
The simulation result of the SWAP block is shown below.
When the input switch is ON the data stored in the input is SWAPED to the output
The input data is stored in the Data block. The input and output address of the SWAP Instruction can be declared here. The data declared on the input side is single data and the output is single data. The data is declared as shown below (The values can be declared during run time using SIM TABLE)
Clicking over the Data_block1 the data can be entered to the corresponding input. The figure given below shows how to enter the value and configure other data.
The data entered in the data block should be in “run” mode.
The results are obtained in Input (variable name) as mentioned earlier.
In the SWAP block Mirrored data will be reflected. This way the SWAP instruction can be executed and the result can be viewed. The SWAP block after the final execution is shown below.
By doing the above exercise one can understand how different MOVE blocks are working.