How to use Different MOVE BLOCK in Siemens TIA Portal – Part 2

In this article, we will see different Move Blocks used in the Siemens TIA Portal. The Siemens TIA Portal Move blocks are:

S. NoTypes Of FunctionsFunction
1MOVE_BLK_VARIANTAn entire array or specific elements within an array to another array with the same type of data. The input COUNT specifies how many elements need to be moved to the target range.
2SCATTERParsing a tag of the BYTE, WORD, DWORD, or LWORD data type into individual bits and saving them in an ARRAY of BOOL is what the “Parse the bit sequence into individual bits” instruction does.
3SCATTER_BLKParsing a tag of the BYTE, WORD, DWORD, or LWORD data type into individual bits and saving them in an ARRAY of BOOL is what the “Parse the bit sequence into individual bits” instruction does.Indicate how many components of the source array will be parsed at the COUNT_IN parameter.
4GATHERBits from an ARRAY of BOOL are combined using the “Merge individual bits into a bit sequence” instruction.
5GATHER_BLKBits from an ARRAY of BOOL are combined using the “Merge individual bits into a bit sequence” instruction.Indicate the number of elements of the destination array that will be written at the COUNT_OUT parameter.
Different Move Blocks Used In Siemens  ia Portal 1
Different Move Blocks Used In Siemens Tia Portal 2
Different Move Blocks Used In Siemens Tia Portal 3
Different Move Blocks Used In Siemens Tia Portal 4
Different Move Blocks Used In Siemens Tia Portal 5
S. NoOperationInput/Output AddressInput AddressData type
1MOVE_BLK_VARIANTInput%M0.2Please refer to the below explanation for the data type of each block
2SCATTERInput%M0.7
3SCATTER_BLKInput%M1.0
4GATHERInput%M1.1
5GATHER_BLKInput%M1.2

Siemens TIA Portal V16 software is used to develop the PLC program. As stated above, the following Sections explain the various PLC Move blocks.

  1. The MOVE_BLK_VARIANT Instruction is used to move the data from one block(array) to another block(array).
  2. The data type for input and output data type can be declared based on the user’s requirement.
  3. The MOVE_BLK instruction has EN, SRC, COUNT, SRC_INDEX, DEST_INDEX, DEST, and Ret_Val signals.
S. NoInstructionMeaning
1ENThis signal enables the MOVE instruction.
2SRCThis signal is the input of the MOVE_BLK_VARIANT. An array of data can be declared at the input
3SRC_INDEXThe Index position of the Array element where the input has to be declared
4DEST_INDEXThe Index position of the Array element where the output can be received.
5COUNTThe number of elements or an arraycan be moved,
6DESTThis signal is the output of the MOVE_BLK_VARIANT. An array of data can be received at the output.
7ENOIt enables the other instruction connected to MOVE_BLK_VARIANT instruction.
8Ret_ValReturn the error value to the particular address mentioned at the Ret_Val
  1. Once the %M0.2 input switch is ON the array of data from SRC is transferred to the DEST array.
  2. The COUNT signal declares the number of elements that can be moved from SRC to DEST.
  3. The data type for SRC and DEST is an array.
  1. The SCATTER Instruction is used to separate the given data into a specific format at the output.
  2. The instruction “resolve the bit sequence into individual bits” divides a tag of the BYTE, WORD, DWORD, or LWORD data types into discrete bits, which are then saved in an anonymous STRUCT, an ARRAY of BOOL, or a PLC data type that contains only Boolean elements.
  3. The SCATTER instruction has EN, IN, ENO, and OUT signals.
S. NoInstructionMeaning
1ENThis signal enables the MOVE instruction.
2IN IN stands for Input signal for assigning the input data. The data type for IN is shown in the below table.
3ENOIt enables the other instruction connected to MOVE instruction
4OUTOUT stands for transferred data from IN. The data type for IN is shown in the below table.
5COUNTThe number of elements or an arraycan be moved
  1. Once the %M0.7 input switch is ON the input word is resolved into individual bits.
S. NoSectionData type
1INBOOL
WORD
2OUTBOOL
ARRAY[0..15] of BOOL
  1. The SCATTER_BLK Instruction is similar to the SCATTER instruction.
  2. The only difference between SCATTER and SCATTER_BLK instruction is COUNT_IN present in SCATTER_BLK.
  3. ARRAY of BYTE, WORD, DWORD, or LWORD elements are parsed into individual bits by the “resolve elements of an ARRAY of bit sequence into individual bits” instruction, and the individual bits are then saved in an ARRAY of BOOL, an anonymous array.3
  4. The number of elements in the source array that will be parsed is indicated by the COUNT_IN parameter.
  5. There could be more elements in the source array at the IN parameter indicated at the COUNT_IN parameter.
ParameterData typeDescription
INByte, Word, DWord, Real, LReal, USInt, UInt, UDInt, and SInt, Int, DIntTData source address
COUNTUSInt, UIntNumber of data elements to copy
OUTByte, Word, DWord, Real, LReal, USInt, UInt, UDInt, and SInt, Int, DIntTData destination address
  1. Once the %M1.0 input switch is ON the input word is resolved into individual bits.
  2. At the OUT individual bits are available from the index point mentioned at the OUT signal. The number of bits varies based on the COUNT_IN declaration.
  1. The GATHER block is used to gather the individual bit and display it as the output in Word.
  2. The instruction “Merge individual bits into a bit sequence” combines the bits from an anonymous STRUCT and an ARRAY of BOOL.
  3. An array of data declared at the input INis gathered and the output is received in the Word format.
  4. Once the %M1.1 input switch is ON the input array is gathered into word format.
  5. At the OUTall single bits are collected and displayed in Word format at specified location.
S. NoParameterData type
1INThe data type ARRAY[0..15] of BOOL. It consists of 16 elements and is therefore just as large as the WORD in which the bits are to be merged
2OUTWORD (16 bits)
  1. The GATHER_BLK is similar to the GATHER block, but the only difference is the GATHER_BLK is it gather and move only to the particular number of array mentioned at COUNT_IN.
  2. The instruction “Merge individual bits into a bit sequence” combines the bits from an anonymous STRUCT and an ARRAY of BOOL.
  3. An array of data declared at the input IN is gathered and the output is received in the Word format.
  4. Once the %M1.2 input switch is ON the input array is gathered into word format.
  5. At the OUT all single bits are collected and displayed in Word format at specified location.

The following is a list of the procedures you can follow to program ladder logic on the SIEMENS TIA portal. (Simulation).

How to use Siemens TIA Portal to create PLC Ladder Logic for three phase motor Forward and Reverse

Note: Please refer to the previously mentioned article for a comprehensive explanation of how to program ladder logic using the Siemens TIA Portal.

The simulation result of the MOVE_BLK_VARIANT block is shown below

Different Move Blocks Used In Siemens Tia Portal 6

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_VARIANT Instruction can be declared here. The data declared to each instruction is an array of data. Since the MOVE_BLK_VARIANT Instruction is an array data instruction. The data is declared as shown below.

The MOVE_BLK_VARIANT consists of EN, SRC, SRC_INDEX, DEST_INDEX, COUNT, DEST, ENO, Ret_Val. In this EN and ENO are input and Output Switch.

Different Move Blocks Used In Siemens Tia Portal 7

The SRC is the Source data or input data (array) to be transferred and DEST is the Output or Output array to be received.

COUNT is the signal used to transfer the number of elements from SRC to DEST. The SRC_INDEX signal is used to identify the index position where the data has to be input. Similarly, the DEST_INDEX signal is used to identify the index where the output has to be transferred.

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

Different Move Blocks Used In Siemens Tia Portal 8

The data entered in the data block should be in “run” mode.

In the above Figure Data_Count, Data_input and Data_output are variable declared to the input of MOVE_BLK_VARIANT. Here Data_Count number is 3, and 3 number of elements has to be moved.

The Data_input is the SRC Index, at which Index point the data has to be entered. Here the SRC Index is mentioned as 2, therefore the data entered before 2 is invalid. The data from Index 2 is transferred to the output.

The Data_output is DEST Index, at which Index point the data has to be received. As per the above example DEST Index is mentioned as 1, therefore the data received only from the Index 1. The number of elements received from input is 3. Since its mentioned in the COUNT.

Different Move Blocks Used In Siemens Tia Portal 9

In the above figure it is clear the data from the SRC Index [2] is moved to the DEST Index[1] with the total element to be transferred is 3.

The simulation result of MOVE_BLK_VARIANT is shown below after the MOVE_BLK_VARIANT is executed.

SCATTER

The simulation result of the SCATTER block is shown below

When the input switch is ON the data stored in the input is resolved into individual bits. 

Different Move Blocks Used In Siemens Tia Portal 9

The input data is stored in the Data block. The input and output address of the SCATTER Instruction can be declared here. The data declared at the input side is word and the output is an array of data [0..15].

The SCATTER consists of EN, IN, ENO, and OUT. In this EN and ENO are input and Output Switch.

The IN is the Source data (WORD) to be resolved into bits and OUT is the Output of single bits.

Different Move Blocks Used In Siemens Tia Portal

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.

Different Move Blocks Used In Siemens Tia Portal 11

The data entered in the data block should be in “run” mode.

In the above figure the data is entered at IN declared at the variable Scat_in. The data format is Word.

  1. After the Instruction is executed, the word is Scattered or resolved into 15 single bits at Scat_out.
  2. Once the Instruction is executed the SCATTER block shown display in the following manner.
Different Move Blocks Used In Siemens Tia Portal 10

SCATTER_BLK

The simulation result of the SCATTER block is shown below

When the input switch is ON the data stored in the input is resolved into individual bits.

Different Move Blocks Used In Siemens Tia Portal 11

The input data is stored in the Data block. The input and output address of the SCATTER Instruction can be declared here. The data declared at the input side is word and the output is an array of data.

The SCATTER_BLK consists of EN, IN, ENO, COUNT_IN, and OUT. In this EN and ENO are input and Output Switch.

The IN is the Source data (WORD) to be resolved into bits and OUT is the Output of single bits.

Clicking over the Data_block1 the data can be entered at IN from the location mentioned at Scat_blk_inindex, based on the number of COUNT_IN the data available at Scat_blk_out index signal from the point mentioned at OUT.  The figure given below shows how to enter the value and configure other data.

Different Move Blocks Used In Siemens Tia Portal 12
Different Move Blocks Used In Siemens Tia Portal 15

The data entered in the data block should be in “run” mode.

In the above figure the data is entered at INdeclared at the variable Scat_blk_in. The data format is Word.

After the Instruction is executed, the word is Scattered or resolved into number single bits at Scat_blk_out.

Once the Instruction is executed the SCATTER_BLK block is display in the following manner.

Different Move Blocks Used In Siemens Tia Portal 14

GATHER

The simulation result of the GATHER block is shown below

When the input switch is ON the data stored in the input is resolved into individual bits.

Different Move Blocks Used In Siemens Tia Portal 15

The input data is stored in the Data block. The input and output address of the GATHER Instruction can be declared here. The data declared at the input side is array of data and the output is word.

The GATHER consists of EN, IN, ENO, and OUT. In this EN and ENO are input and Output Switch.

The IN is the Source data (ARRAY) is gathered into single word and OUT is the Output of word.

Different Move Blocks Used In Siemens Tia Portal 17

Clicking over the Data_block1 the data can be entered at IN to the location mentioned at Scat_out, and data available at gath_outx signal to the point mentioned at OUT.  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.

In the above figure the data is entered at IN, and declared at the variable Scat_out. The data format is array data.

After the Instruction is executed, the array is gathered into word bit at gath_out.

Once the Instruction is executed the GATHER block shown display in the following manner.

Different Move Blocks Used In Siemens Tia Portal 18

GATHER_BLK

The simulation result of the GATHER block is shown below

When the input switch is ON the data stored in the input is resolved into individual bits. 

Different Move Blocks Used In Siemens Tia  19Portal

The input data is stored in the Data block. The input and output address of the GATHER_BLK Instruction can be declared here. The data declared at the input side is array of data and the output is word.

The GATHER consists of EN, IN, ENO, COUNT_IN, and OUT. In this EN and ENO are input and Output Switch.

Different Move Blocks Used In Siemens Tia Portal 20

The IN is the Source data (ARRAY) gathered into a single word and OUT is the Output of word.

Clicking over the Data_block1 the data can be entered at IN to the location mentioned at Scat_blk_out, and data available at gath_blk  signal to the point mentioned at OUT.  The figure given below shows how to enter the value and configure other data.

Different Move Blocks Used In Siemens Tia Portal21
Different Move Blocks Used In Siemens Tia Portal22

The data entered in the data block should be in “run” mode.

In the above figure the data is entered at IN, declared at the variable Scat_blk_out. The data format is array data.

After the Instruction is executed, the array is gathered into word bit at gath_blk_out. Here, we can see only index 1 and index 2 element only have the word output this is because the COUNT_IN is 2.

Once the Instruction is executed the GATHER block shown display in the following manner.

Different Move Blocks Used In Siemens Tia Portal23

Doing the above exercise one can understand the different blocks of MOVE Instruction used in SIEMENS TIA PORTAL.

About The Author

Scroll to Top