cardTaskState

cardTaskState — provides fieldbus device status for cards.

Synopsis

(cardTaskState [card_id])
  

Parameters

card_id

The target card ID (0..3). If no card ID is specified, the query is repeated for all initialized cards.

Returns

(cardTaskState card_id global_bits master_state 
        (error_addr error_event bus_error_count bus_timeout_count)
        (SlaveCfg slave0_cfg...slave15_cfg) 
        (SlaveState slave0_state...slave15_state)  
        (SlaveDiag slave0_diag...slave15_diag) )

defined as follows:

global_bits

A collective display of global event indications. Errors can occur either at the card itself or on a fieldbus device.

D7D6D5D4D3D2D1D0
00NRDYEVEFATNEXCACLRCTRL

NRDY (Host-Not-Ready-Notification): Indicates whether or not the HOST program has set its state to operational. If this bit is not set, the HOST is not ready to communicate.

EVE (Event-Error): The card has detected fieldbus short circuits. The number of detected events is reported in bus_error_count. This bit is set when the event was detected and is never cleared (until the card is reset).

FAT (Fatal-Error): Major bus error detected; no further bus communication is possible.

NEXC (Non-Exchange-Error): At least one fieldbus device has not reached the data exchange state and no process data exchange can take place.

ACLR (Auto-Clear-Error): The card has stopped communication with all fieldbus evices and reached the auto-clear end state.

CTRL (Control-Error): Parameterization error.

master_state

The overall card firmware state, one of the following:

0x00OFFLINE
0x40STOP
0x80CLEAR
0xC0OPERATE
error_addr

If any of the global_bits: CTRL, ACLR, or NEXC are set, this variable specifies the source of the error. If the source is within the card itself, then a value of 255 is used. Otherwise, the MAC-ID of the faulty fieldbus device is returned.

error_event

Provides more detailed error codes. For more detail, see the appropriate protocol-specific CIF manual.

bus_error_count

Provides a count of the number of times the warning limit on bus communication errors has been reached.

bus_timeout_count

Provides a count of the number of times the bus frame error counter reaches its limit.

slaven_cfg

Reports the parameterization state of each field device, one bit per device, as 16 bytes (16 x 8 = 128 devices), starting with device 0 as bit 0 of the first byte. The status bit is interpreted as follows:

    0: device is not configured in the card.

    1: device is configured in the card, and serviced.

slaven_state

Reports the state of each field device, one bit per device, as 16 bytes (16 x 8 = 128 devices), starting with device 0 as bit 0 of the first byte. The status bit is interpreted as follows:

    0: device is not operating, due to error or not configured.

    1: device is operating.

slave_diag

Reports the diagnostic bit for each field device, one bit per device, as 16 bytes (16 x 8 = 128 devices), starting with device 0 as bit 0 of the first byte. These values are only valid if the master state of the card is OPERATE. The status bit is interpreted as follows:

    0: no values were changed in the internal diagnostic buffer since the last diagnostic buffer read by the card.

    1: new diagnostic values are available in the internal diagnostic buffer of one of the diagnostic bits of the device has changed. A diagnostic value can only be read via the message interface (see cifTelegram command).

Otherwise, one of the following error messages:

(error "cardReset DR_ERR_CARD_INVALID (time) invalid card: card_id")

Description

This command provides fieldbus device status for one or more cards. This information can be queried interactively to obtain detailed CIF card and fieldbus device status and diagnostic information.

Example

In the following example:

(cardTaskState 1)

returns

(cardTaskState 1 00 OFFLINE (0 0 0 0)
(SlaveCfg 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
(SlaveState 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
(SlaveDiag 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00))