EasyManuals Logo

Allen-Bradley CompactLogix 5380 User Manual

Allen-Bradley CompactLogix 5380
172 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #137 background imageLoading...
Page #137 background image
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

Table of Contents

Other manuals for Allen-Bradley CompactLogix 5380

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley CompactLogix 5380 and is the answer not in the manual?

Allen-Bradley CompactLogix 5380 Specifications

General IconGeneral
BrandAllen-Bradley
ModelCompactLogix 5380
CategoryController
LanguageEnglish

Related product manuals