
TPMC118-SW-95 – QNX6 Neutrino Device Driver
Page 27 of 30
3.3.9 DCMD_TP118_SYNCREAD
NAME
DCMD_TP118_SYNCREAD – Read all synchronized encoder channels
DESCRIPTION
This devctl function reads all synchronized encoder channels. A pointer to the callers message buffer
(
TP118_SYNCREAD
) and the size of this structure is passed by the parameters
data_ptr
and
n_bytes
to the device.
The
TP118_SYNCREAD
structure has the following layout:
typedef struct
{
long
value[TP118_MAX_CHANS];
unsigned
char
valid[TP118_MAX_CHANS];
} TP118_SYNCREAD, *PTP118_SYNCREAD;
value[]
This array returns the encoder values of the synchronized channels, all channels that are not
set to synchronized mode will be returned as 0. The array index specifies the assigned channel.
Index 0 specifies channel 1, index 1 specifies channel 2 and so on.
valid[]
This array returns flags for each channel if it is set to synchronous mode or not. If value is set to
TRUE
, the channel is synchronized and the value is valid. If
FALSE
is returned, the channel is
not synchronized and 0 will be returned for this channel. The array index specifies the assigned
channel. Index 0 specifies channel 1, index 1 specifies channel 2 and so on.