FLL (Fill File) Ladder Logic Instruction

Definition

The Fill File instruction is a ladder logic rung output instruction that copies data from the Source to the Destination x amount of elements long The Source data remains unchanged.

Insure the Length does not travel outside of the array boundaries. Use the SIZE instruction to determine how many elements are in an array.

The instruction is enabled when the preceding logic is true and disabled otherwise. The values can be constants, tags or any combination.

List of possible arguments

SOURCE and DESTINATION can be any combination of the following data types.

  • CONSTANT             Can’t be the DESTINATION obviously
  • SINT              
  • INT
  • DINT
  • REAL
  • STRUCTURE

LENGTH is type CONSTANT and determines the number of elements to fill.

Note: It is possible to write data into other members of a tag if the length is set too large. This can happen when executing the instruction on User Defined Tags. No major fault is flagged. Also check out the COP instruction as it is very similar.

 

BSR (Bit Shift Right) Ladder Logic Instruction

Definition

The BSR instruction is a ladder logic rung output instruction that shifts data in an array one bit to the right every execution.

The instruction loads the value of the source bit into the bit pointed to by the Length. The instruction is enabled when the preceding logic is true and disabled otherwise.

When the instruction is enabled the least significant bit in the array is placed into the unload bit. For instance if the length is set to 12 the 1st bit in the array will be placed in the unload bit.  After the 1st bit is placed in the unload bit the remaining upper bits are shifted one position to the right. The last step places the Source_Bit value into the array at the position pointed to by the Length. All bits above 12 are not affected or invalid. Keep in mind all three steps are one rung scan. [click to continue…]

BSL (Bit Shift Left) Ladder Logic Instruction

Definition

The BSL instruction is a ladder logic rung output instruction that shifts data in an array one bit to the left every execution.

The instruction loads the value of the source bit into the lowest bit of the array. The length defines the unload bit. The instruction is enabled when the preceding logic is true and disabled otherwise.

When the instruction is enabled the bit pointed to by the length member is placed in the unload bit. For instance if the length is set to 12 the 12th bit in the array will be placed in the unload bit. All bits above 13 are not affected or invalid. After the 12th bit is placed in the unload bit the remaining lower bits are shifted one position to the left. The last step places the Source_Bit value into the least significant bit of the array. Keep in mind all three steps are one rung scan. [click to continue…]