Download OpenCIM™ OpenFMS User Manual

Transcript
Examples
SetBit(PORT0, BV0, |, “10000000”)
This example turns on control line # 7. This control line is connected to the PC’s output port 0.
The OR truth table indicates that when the mask contains a 1 in a given position, that bit will be
set to 1 regardless of the bit’s initial value in the output port.
SetBit(PORT1, BV1, &, V16)
The bits in output port 1 are ANDed with the bit mask in variable V16. The result is written back
to output port 1 and the corresponding control lines are set on and off accordingly.
SetBit(PORT1, BV1, ^, P8)
The bits in output port 1 are XORed with the bit mask in parameter variable P8. The result is
written back to output port 1 and the corresponding control lines are set on and off accordingly.
User Manual
0201
9-42
OpenCIM
OpenCIM Programming