7.3. Hilscher Fieldbus CIF Card Status API

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 ElementDescriptionLength
global_bits
Error bits, as follows:
bit 0: Ctrl, parameterization error
bit 1: Aclr, slave error causing AutoClear mode
bit 2: Ndata: at least one slave not in data exchange mode or reporting an error
bit 3-7: reserved
byte
bus_status
Main state of the master system:
0x00 OFFLINE
0x40 STOP
0x80 CLEAR
0xC0 OPERATE
byte
err_rem_addrRemote address of error sourcebyte
err_rem_eventError numberbyte
stateA bitfield classifying every slave as active (1) or inactive (0)16 x byte
diagA bitfield showing diagnostic bit of every slave16 x byte

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.