Rockwell Automation Publication 1756-RM100F-EN-P - October 2018 137
Instruction Execution Chapter 6
JSR passing Atomic Data type into an Array or Structure
If a JSR passed an atomic data element as an input to a subroutine, and that 
subroutine stores it in an array or structure, then only parts of the target array 
were populated with 5570 and 5370 controllers:
4 bytes are always copied regardless of the atomic data type with these 
controllers. The exception is if the destination is less than 4 bytes. Then the 
entire destination is copied over for 5580 and 5380 controllers.
This implementation affects the JSR and SBR instructions.
Language Affected
Ladder Logic (RLL) Yes
Struc tured Text (ST) Yes
Function Blocks (FBD) Yes
Sequential Function Chart (SFC) Yes
(1)
(1) Only affects embedded Structured Text.
5580/5380 Controllers 5570/5370 Controllers
4 bytes are always copied unless the destination 
structure is smaller than 4 bytes. 
MyAtomic (SINT) = -1
MyArray Before the copy
  MyArray[0] = 100
  MyArray[1] = 100
  MyArray[2] = 100
  MyArray[3] = 100
  MyArray[4] = 100
  MyArray[5] = 100
  MyArray[6] = 100
If MyArray = SINT structure 
After the copy
  MyArray[0] = -1
  MyArray[1] = 100
  MyArray[2] = 100
  MyArray[3] = 100
  MyArray[4] = 100
  MyArray[5] = 100
  MyArray[6] = 100
Only the first number of the array is stored. 
• If the destination array is bool array, bool_array[0] is 
updated, this is only 1 bit.
• If the destination array is sint array, sint_array[0] is 
updated, this is 1 byte.
• If the destination array is int array, int_array[0] is 
updated, this is 2 bytes.
• If the destination array is dint array, dint_array[0] is 
updated, this is 4 bytes.
• If the destination array is real array, real_array[0] is 
updated, this is 4 bytes.
MyAtomic (SINT) = -1
MyArray Before the copy
  MyArray[0] = 100
  MyArray[1] = 100
  MyArray[2] = 100
  MyArray[3] = 100
  MyArray[4] = 100
  MyArray[5] = 100
  MyArray[6] = 100
If MyArray = SINT structure 
After the copy
  MyArray[0] = -1
  MyArray[1] = 100
  MyArray[2] = 100
  MyArray[3] = 100
  MyArray[4] = 100
  MyArray[5] = 100
  MyArray[6] = 100