MBSHIFT
Function - Multibyte shift / rotate.
Inputs
Input |
Data type |
Description |
Buffer |
SINT/USINT |
Array of bytes. |
Pos |
DINT |
Base position in the array. |
NbByte |
DINT |
Number of bytes to be shifted/rotated. |
NbShift |
DINT |
Number of shifts or rotations. |
ToRight |
BOOL |
TRUE for right / FALSE for left. |
Rotate |
BOOL |
TRUE for rotate / FALSE for shift. |
InBit |
BOOL |
Bit to be introduced in a shift. |
Outputs
Output |
Data type |
Description |
Q |
BOOL |
TRUE if successful. |
Remarks
Use the ToRight argument to specify a shift to the left (FALSE) or to the right (TRUE). Use the Rotate argument to specify either a shift (FALSE) or a rotation (TRUE). In case of a shift, the InBit argument specifies the value of the bit that replaces the last shifted bit.
In LD language, the rung input (EN) validates the operation. The rung output is the result (Q).
ST Language
Q := MBShift (Buffer, Pos, NbByte, NbShift, ToRight, Rotate, InBit);
FBD Language
LD Language
The function is called only if EN is TRUE:
MBSHIFT |
IEC 61131-3 Automation platform > Programming - Reference guide > Registers > MBSHIFT |
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's WinHelp HLP to CHM conversion feature