Process Image • 133
Internal Bus Driver (kbus.ko)
WAGO-I/O-SYSTEM 750
Linux Fieldbus Coupler
Note
The
ioctl(iFD, IOCTL_KBUSUPDATE,...)
function writes data to the I/O
modules via the internal bus and simultaneously reads in the I/O module data.
The function waits and blocks the system until the new data has been read out
from the I/O modules. The time for that depends on the length (number of
bytes) of the I/O modules connected to the internal bus and may take up to
50ms if the maximum number of modules is involved.
Note
In order not to reduce the performance of the program, call
i
octl(iFD,
IOCTL_KBUSUPDATE,...)
o
nly once during a cyclic program run.
Note
The internal bus driver does not control if several programs change data in
the process image and then call
ioctl(iFD, IOCTL_KBUSUPDATE,...)
.
Therefore, if two application programs access the process image, make sure
that the output data to be written is not overwritten by the other program. The
programs should block each other.
Example: bit query
The following example shows how to query a bit:
Using the
if (pstPabIn->uc.Pab[0] & 0x08)
{
...
}
code, allows you to check the third bit of the first element (‘0000.1000’) in the
process array to determine if the bit at address 0.3 is set to TRUE.
Example: how to set a bit
The following example shows how to set a bit:
Using the
pstPabOut->uc.Pab[0]|= 0x08;
sample code allows you to perform a boolian OR operation of the value 0x08
with the output process image which sets the bit 0.3 ('0000.10') to TRUE.