Hilscher Fieldbus CIF Card Status API

Cogent API and Utilities: Version 4.1
Prev | Chapter 7. Cascade Driver Specifications | Next

# 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 Element | Description | Length
--- | --- | ---
`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_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

Prev | Home | Next
Hilscher Fieldbus CIF Card Control API | Up | Reference

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