Bit Position - GE PACSystems RX7i Cpu Programmer's Reference Manual

Hide thumbs Also See for PACSystems RX7i:
Table of Contents

Advertisement

4.2.2

Bit Position

The Bit Position function locates a bit set to 1 in a bit string.
Each scan that power is received, the function scans the bit string starting at IN. When the function
stops scanning, either a bit equal to 1 has been found or the entire length of the string has been
scanned.
POS is set to the position within the bit string of the first non-zero bit; POS is set to zero if no non-
zero bit is found.
A string length of 1 to 256 WORDs or DWORDs can be selected. The function passes power flow to
the right whenever it receives power.
Operands of Bit Position
Parameter
Description
Length
The number of WORDs or DWORDs in the bit
string. 1  Length  256.
(displayed as ??)
IN
The data to operate on
Q
Energized if a bit set to 1 is found
POS
An unsigned integer giving the position of the first
nonzero bit found, or zero if no non-zero bit is
found
Examples
When V_I00001 is set, the bit string starting at V_M00001 is searched until a bit equal to 1 is found,
or 6 words have been searched. Coil V_Q00001 is turned on. If a bit equal to 1 is found, its location
within the bit string is written to V_AQ0001 and V_Q00002 is turned on. For example, if V_00001 is
set, bit V_M00001 is 0, and bit V_M0002 is 1, the value written to V_AQ0001 is 2.
GFK-2950C
Chapter 4. Ladder Diagram (LD) Programming
February 2018
Allowed Operands
Constants
All. Constants may only be
used when Length is 1.
Flow
All except constants and
variables located in %S - %SC
Optional
No
No
Yes
No
69

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pacsystems rx3iPacsystems rsti-ep

Table of Contents