pfbBusParms

pfbBusParms — queries or sets the Profibus network timing parameters.

Synopsis

pfbBusParms (card_id [tokRotationTime [slotTime [idleTime1 [idleTime2
             [readyTime [gapUpdateFactor [quietTime]]]]]]])
  

Parameters

card_id
The target card ID (0..3).
tokRotationTime
The target maximum rotation time for the network, in bit-times. Valid range is 256 to 16,777,215. If not specified, the card calculates a default value based on the baud rate and the options set by pfbNetParms.
slotTime
The length of time, in bit-times, the card waits for a reply to a message or to a poll for new nodes. Valid range is 37 to 16,383. If not specified, the card calculates a default value based on the baud rate.
idleTime1
The length of time, in bit-times, the card waits after it receives a reply, an acknowledgement, or a token message before sending another message. Valid range is 35 to 1023. If not specified, the card calculates a default value based on the baud rate.
idleTime2
The length of time, in bit-times, the card waits after it sends an SDN message (send data with no acknowledge) before sending another message. Valid range is 35 to 1023. If not specified, the card calculates a default value based on the baud rate.
readyTime
The length of time, in bit-times, the card waits after sending or receiving a command before sending the ACK or reply. Valid range is 11 to 1023. If not specified, a default value is calculated based on the baud rate.
gapUpdateFactor
The number of token rotations between solicits for a new node. This parameter is a tradeoff between the network overhead spent soliciting for new nodes, and the delay in detecting the presence of new nodes. Valid range is 0 to 255. The card default value is 128. Since the parameters sets the number of token rotations, the time between solicits will depend on the baud rate.
quietTime
The length of time, in bit-times, that the card waits between turning on the transmitter and beginning transmission, or ending transmission and turning off the transmitter. Valid range is 0 to 127. If not specified, the card calculates a default value based on the baud rate.

Returns

If succesful:

(pfbBusParms card_id tokRotationTime slotTime idleTime1 idleTime2
             readyTime gapUpdateFactor quietTime)

Otherwise, one of the following error messages:

(error "pfbBusParms DR_ERR_CARD_INVALID (time) invalid card: card_id")
(error "pfbBusParms PFB_ERR_NO_CARD (time) Card not available")
(error "pfbBusParms PFB_ERR_CMD_TIMEOUT (time) Cmd failed (timeout)")
(error "pfbBusParms PFB_ERR_CMD_INVALID (time) Cmd not valid in current card state")
(error "pfbBusParms PFB_ERR_CMD_BAD_TOK_ROT (time) PFB: Bad Token Rot")
(error "pfbBusParms PFB_ERR_CMD_BAD_SLOT_TME (time) PFB: Bad Slot Time")
(error "pfbBusParms PFB_ERR_CMD_BAD_IDLE_1 (time) PFB: Bad Idle 1")
(error "pfbBusParms PFB_ERR_CMD_BAD_IDLE_2 (time) PFB: Bad Idle 2")
(error "pfbBusParms PFB_ERR_CMD_BAD_RDY_TME (time) PFB: Bad Ready Time")
(error "pfbBusParms PFB_ERR_CMD_BAD_QUI_TME (time) PFB: Bad Quit Time")
(error "pfbBusParms PFB_ERR_CMD_BAD_GAP_UPD (time) PFB: Bad Gap Update")

Description

This command is used to set the bus timing parameters. The card must be off line to use this command. The units for all timing parameters are in bit-times, the inverse of baud rate.

All network parameters are optional, or will be ignored if specified as '*', permitting only the desired parameters to be modified. If no network parameters are specified, then the command reduces to a query. In all cases, the current values of the parameters are returned.

This command is typically used in the configuration file. However, the card resets all network parameters to their defaults every time the card is taken off line, making it necessary to re-issue the command before returning on line.

The bus timing parameters that are not specified are automatically calculated by the card based on the baud rate. If the baud rate is changed after its initial setting by the first call to pfbNetParms, then the card can no longer detect which bus parameters were unspecified and therefore will not re-calculate them. Putting the card on line, then back off line resets the defaults and permits the bus parameters to be re-calculated correctly.

Example

Issuing the following commands:

(pfbNetParms 0 0 ACTIVE BAUD_1m5)
(pfbBusParms 0)

produces:

(pfbBusParms 0 500000 3000 151 900 150 128 0)