2-357
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Shift Instructions
2
ArySHL and ArySHR
ArySHL and ArySHR
These instructions shift array elements by one or more elements.
ArySHL: Shifts the array to the left (toward the higher elements).
ArySHR: Shifts the array to the right (toward the lower elements).
Instruction Name FB/FUN Graphic expression ST expression
ArySHL Array N-element
Left Shift
FUN ArySHL(InOut, Size, Num);
ArySHR Array N-element
Right Shift
FUN ArySHR(InOut, Size, Num);
Variables
Name Meaning I/O Description Valid range Unit Default
Size Number of
elements in
shift
register
Input
Number of elements in shift
register
Depends on data type.
--- 1
Num Number of
elements to
shift
Number of elements to shift
InOut[]
(array)
Shift
register
array
In-out Shift register array Depends on data type.
--- ---
Out Return
value
Output Always TRUE TRUE only --- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
Size OK
Num OK
InOut[]
(array)
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
Arrays of structures can also be specified.
Out OK
(@)ArySHL
EN ENO
InOut
Size Out
Num
(@)ArySHR
EN ENO
InOut
Size Out
Num