cardTaskParms

cardTaskParms — sets or queries the protocol task parameters for CIF cards.

Synopsis

For queries:

(cardTaskParms fmt_str)
(cardTaskParms card_id fmt_str)
  

For setting:

(cardTaskParms card_id fmt_str parms ...)
  

Parameters

fmt_str

A string describing the mapping between the bytes of card's task parameter block and the individual parameters. See the cifTelegramFmt command for more information on this synopsis.

card_id

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

parms

The list of parameter values to set. A value must be specified for each of the elements in the fmt_str (similar to a C printf format string).

Returns

From a query:

(cardTaskParms card_id reply)

where reply depends on the fmt_str that was passed.

From setting:

(cardTaskParms card_id)

or one of the following errors:

(error "cardTaskParms DR_ERR_CARD_INVALID (time) invalid card: card_id")
(error "cardTaskParms  -1 (time) parseBinBuffer parser_error_msg")
(error "cardTaskParms  -1 (time) createBinFormat format_error_msg")
(error "cardTaskParms  -1 (time) devGetTaskParameter device_error_msg")
(error "cardTaskParms  -1 (time) devPutTaskParameter device_error_msg")
(error "cardTaskParms  -1 (time) WARNING: CIF card card_id not configured.")
(error "cardTaskParms  -1 (time) WARNING: CIF card card_id not communicating.")
(error "cardTaskParms  -1 (time) WARNING: CIF card card_id failed to reset
       (status = device_status).")

Description

This command sets or queries the protocol task parameters for the specified CIF card. A warm reset is performed on the card after the parameters are modified. The parameter block is protocol dependent, so that the appropriate format string must be supplied to encode or decode the data. Format strings are described in more detail in the cifTelegramFmt command. The cardTaskParms command can be used in a configuration file or interactively to modify certain protocol parameters from the configuration stored in the card's flash memory. Parameter settings changed by this command are in effect only until the next cold reset, at which time the configuration stored in the card's flash memory will be loaded.

Since the parameter block is protocol dependent, the cardTaskParms command has been designed to provide a generic mechanism that uses the appropriate format string to encode or decode the data. Descriptions and layout of the parameters available can be found in the Hilscher Protocol Interface Manual for the corresponding protocol. For more information on format strings, please refer to the cifTelegramFmt command reference page.

To facilitate use, a set of protocol-specific commands have been defined using the type command. These provide the appropriate format string as part of their definition. The synopsis for these commands is described by the associated description string (typeDesc), and these commands are made available to the driver by using the (include filename) command in the configuration file. The following table lists the commands and corresponding configuration files for each protocol:

ProtocolCfg FileQuery ParmsSet Parms
Profibusprf.cfg(prfGetParms card)(prfSetParms card mode cycle fmt wd)
DeviceNetdnm.cfg(dnmGetParms card)(dnmSetParms card mode fmt wd)
Interbusibm.cfg(ibmGetParms card)(ibmSetParms card mode fmt wd)

The protocol parameters typically available include the following:

mode: Exchange (Handshake) Mode

Value in the range of 0 to 4, although not all modes are available for all protocols. See the handshake modes table in the Hilscher Fieldbus Card Control API section of the Cogent API manual for definitions of the modes.

cycle: Cycle Time (Profibus protocol only)

The minimum slave interval time, in ms, that the master has to wait before it starts the next data exchange to all slaves. A value of 0 will provide the fastest possible data exchange cycle.

fmt: Data Format (byte organization)

0 = Intel (little-endian; low-byte, high-byte)
1 = Motorola (big-endian; high-byte, low-byte)

wd: Watchdog Time

In multiples of 1 msec, or 0 to disable the timer.

Examples

To make a query without using protocol parameters, the basic cardTaskParms command is used like this:

(cardTaskParms 1 "Mode %c Format %2c Watchdog %3w")

returns:

(cardTaskParms 1  Mode 4 Format 0 Watchdog 0)

This command for DeviceNet protocol:

(dnmSetParms 0 1 0 0)

sets the protocol parameters for card 0 (a DeviceNet card) to 1 (device-controlled, buffered), Intel format (low-byte-high-byte) and disables the watchdog timer. On success, this command returns:

(cardTaskParms 0)

indicating that the cardTaskParms command has been used successfully.