EasyManua.ls Logo

Omron NJ501-1500

Omron NJ501-1500
990 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
Loading...
2 Instruction Descriptions
2-44
NJ-series Instructions Reference Manual (W502)
z TestABit
The TestABit instruction assigns the value of the bit at bit position Pos in the bit string In to the bit value
Out when EN is TRUE.
When EN is FALSE, the value of Out is FALSE.
z TestABitN
The TestABitN instruction assigns the inverse of the value of the bit at bit position Pos in the bit string In
to the bit value Out when EN is TRUE.
When EN is FALSE, the value of Out is FALSE.
The following example shows the TestABit instruction when Pos is USINT#3.
If this instruction is used in a ladder diagram, the value of Out changes to FALSE if an error occurs in
the previous instruction on the rung.
An error occurs in the following case. Out will be FALSE.
The value of Pos is greater than No. of bits in In 1.
Function
Precautions for Correct Use
def:=TestABit(abc, USINT#3);
LD ST
USINT#3
abc
def
TestABit
EN
In
Pos
In=abc
Out=def
TRUE
1 0
Pos=USINT#3
Bit 0
Most-significant bit
0 0 1 0 1 1

Table of Contents

Related product manuals