The status of the Hilscher Fieldbus Card is read from buffer 2 with a length of 64, using the function DR_ApReadStatus, as follows:
DR_ApReadStatus (dev, 2, 0, 64, &status, &error)
The offset and length are ignored. Status is a structure of type cif_ApState_t (see the file cif_api.h) and is defined as follows:
typedef struct {
unsigned char global_bits;
unsigned char bus_status;
unsigned char err_rem_addr;
unsigned char err_rem_event;
unsigned char reserved[28];
unsigned char state [16];
unsigned char diag [16];
} cif_ApState_t;where:
| State Element | Description | Length | |||||
|---|---|---|---|---|---|---|---|
| global_bits |
| byte | |||||
| bus_status |
| byte | |||||
| err_rem_addr | Remote address of error source | byte | |||||
| err_rem_event | Error number | byte | |||||
| state | A bitfield classifying every slave as active (1) or inactive (0) | 16 x byte | |||||
| diag | A bitfield showing diagnostic bit of every slave | 16 x byte |