11Bit Operation Functions Bit Position - GE VersaMax PLC User Manual

Table of Contents

Advertisement

FST_SCN
| |
%M0001
%M0017
%M0033
%R0001
(I1 ) – %M0001
(I2) – %M0017
(M/Q) – %M0033
(BIT/BN) – %R0001
(MC) – %Q0001
134
GFK-1503E
For public disclosure
3.
Updates the output bit string Q to match the new content of mask string M
Sets the bit number output (BN) to the number of the miscompared bit.
4.
5.
Stops the comparison.
Example
In the example, after first scan the Masked Compare Word function executes. It compares
%M0001–16 with %M0017–32. %M0033–48 contain the mask. The value in %R0001
determines the bit position in the two input strings where the comparison starts.
MASK_
COMP_
WORD
I1 MC
%M0033
I2
Q
M
%R0001
BN
BIT
Before the function block is executed, the contents of the above references are:
00,1'00,sfx)=}graphics:graphic4c25db79}
The contents of these references after the function block is executed are:
= (same) =
0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0
= (same) =
0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 1
0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 1
=
= 8
= ON
In this example, contact %T1 and coil %M100 force one and only one execution;
otherwise the function would repeat with possibly unexpected results.
10.1.11 Bit Operation Functions Bit Position
The Bit Position function locates a bit set to 1 in a bit string.
Each sweep 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 can be selected. The function passes power flow to the
right whenever enable is ON.
BIT_
Enable
OK
POS_
WORD
First word
IN
Position of non-zero bit or 0
POS
%Q0001
(S)
VersaMax PLC User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents