2-325
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Data Movement Instructions
2
TransBits
TransBits
The TransBits instruction moves one or more bits in a bit string.
*1 If you omit an input parameter, the default value is not applied. A building error will occur.
*2 0 to No. of bits in In − 1
*3 0 to No. of bits in InOut − 1
*4 0 to No. of bits in In
Instruction Name FB/FUN Graphic expression ST expression
TransBits Move Bits FUN TransBits(In, InPos, InOut,
InOutPos, Size);
Variables
Name Meaning I/O Description Valid range Unit Default
In Move
source
Input
Move source Depends on data type.
---
*1
InPos Move
source bit
Position of bit in In to move *2
0
InOutPos Move
destination
bit
Position of bit in Out to
receive the bit
*3
Size Number of
bits
Number of bits to move *4 1
InOut Move
destination
In-out Move destination 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
In OK OK OK OK
InPos OK
InOutPos OK
Size OK
InOut OKOKOKOK
Out OK
(@)TransBits
EN ENO
In Out
InPos
InOut
InOutPos
Size