2-43
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Sequence Input Instructions
2
TestABit and TestABitN
TestABit and TestABitN
* If you omit the input parameter, the default value is not applied. A building error will occur.
TestABit: Outputs the value of the specified bit in a bit string.
TestABitN: Outputs the inverse of the value of the specified bit in a bit string.
Instruction Name FB/FUN Graphic expression ST expression
TestABit Test A Bit FUN Out:=TestABit (In, Pos);
TestABitN Test A Bit NOT FUN Out:=TestABitN (In, Pos);
Variables
Name Meaning I/O Description Valid range Unit Default
In Bit string
Input
Bit string Depends on data type.
---
*
Pos Bit position Specified bit position 0 to No. of bits in In − 10
Out Bit value Output TestABit
Value of specified bit
TestABitN
Inverse of value of specified
bit
Depends on data type.
--- ---
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
Pos OK
Out OK
(@)TestABit
EN
In
Pos
Out
(@)TestABitN
EN
In
Pos
Out