134 • Process Image
WAGO-I/O-SYSTEM
750
Linux Fieldbus Coupler
Example: how to reset a bit
The following example shows how to reset a bit:
Using the
pstPabOut->uc.Pab[0] &= ~0x08;
sample code allows you to perform a boolian AND operation with the inverted
value of 0x08 ('1111.0111') with the output process image to set the bit 0.3 to
FALSE.
Example: byte query
The following example shows how to query a byte:
Using the
if (pstPabIn->uc.Pab[0] == 38)
{
...
}
code allows you to check whether byte 0 has the value 38 by using the equal
conditional operatior.
Example: word query
The following example shows how to query a word:
Using the
if (pstPabIn->us.Pab[0] == 0x0008)
{
...
}
sample code allows you to check whether the 0-bit process array (us) has the
value 0x0008