pfbNetParms

pfbNetParms — queries or sets basic Profibus network parameters.

Synopsis

(pfbNetParms card_id [stnAddr [active [baud [hiStnAddr [options]]]]])
  

Parameters

card_id
The target card ID (0..3).
stnAddr
The station address of the card on the Profibus network. Valid range is 0 to 126. The default card value is 0xff, an invalid station address, so this parameter must be set before the card is put online.
[Note]

In DP networks, address 126 is reserved for slaves whose address must be set while the slave is online.

active
Configures the card as an active or passive station on the network. A value of ACTIVE indicates the card will be configured as active; any other string or value is taken as passive. A card must be an active station to act as a DP master. An active station can both initiate and reply to messages, as well as participate in the token rotation. A passive station can only reply to messages and does not effect the token rotation time. The default card value is to be a passive station, so setting this parameter to ACTIVE is necessary if the card is to act as a master.
baud
This parameter sets the network baud rate. Baud rate can be specified using either the name or the code from the following table:
Baud RateNameCode
9600BAUD_9k60
19200BAUD_19k21
93.75KBAUD_93k752
187.5KBAUD_187k53
500KBAUD_500k4
750KBAUD_750k5
1.5MBAUD_1m56
3MBAUD_3m7
6MBAUD_6m8
12MBAUD_12m9
If baud is specified as AUTO, then the card attempts to determine the baud rate by listening to the network (without going online). The card default is 9600 baud.
hiStnAddr
Determines the highest allowed station address for any station on the network. Minimizing gaps in the addresses will reduce the network time spent soliciting for new nodes and maximize network time used for messages, therefore maximizing performance. If nodes are assigned consecutive station addresses (starting from 0) and this parameter is set to the highest address, then no soliciting takes place and all the network time is used for messages. The tradeoff is that no new nodes can come on the network. The gap update factor (see pfbBusParms) also effects how often soliciting takes place.
The card default is a high station address of 126.
options
(Optional) Sets several options, defined in the table below, relating to how the card operates on the network. The flags, which can be combined, can be specified as a number or as a simple Lisp expression, such as for example, (bor OPTION_REPEATER OPTION_STAY_OFF_ERR) which evalutes to 0x05. The default value is 0.
ValueNameDescription
0x01OPTION_REPEATERIf set, indicates to the card that there is at least one repeater on the network. This fact is used in calculating default bus parameters. The default is 0 (no repeaters).
0x02OPTION_FMSIf set, indicates to the card that there is at least one FMS device on the network. This fact is used in calculating default bus parameters. The default is 0 (DP only).
0x04OPTION_STAY_OFF_ERRThis bit determines the action taken by the card if the token error limit or message error limit are exceeded within 256 token cycles. If the bit is set, then the card will go offline with a fatal error and must be reloaded before being put back online. If 0 (the default), then the corresponding error counter is incremented, and the card transitions to offline and immediately back to online.

Returns

If succesful:

(pfbNetParms card_id stnAddr ACTIVE|PASSIVE baud hiStnAddr options optionsStr)

where:

stnAddr
hiStnAddr
Decimal values in range 0 to 126 or 255 if the value has not been specified (card default in effect).
baudThe current baud name.
optionsA hex value.
optionsStrA string representation of the value as an expression using option names.

Otherwise, one of the following error messages:

(error "pfbNetParms DR_ERR_CARD_INVALID (time) invalid card: card_id")
(error "pfbNetParms PFB_ERR_NO_CARD (time) Card not available")
(error "pfbNetParms PFB_ERR_CMD_TIMEOUT (time) Cmd failed (timeout)")
(error "pfbNetParms PFB_ERR_CMD_INVALID (time) Cmd not valid in current card state")
(error "pfbNetParms PFB_ERR_CMD_BAD_BAUD (time) PFB: Bad Baud")
(error "pfbNetParms PFB_ERR_CMD_BAD_STN_ADR (time) PFB: Bad Station Address")
(error "pfbNetParms PFB_ERR_CMD_BAD_HI_STN_ADR (time) PFB: Bad HI Station Address")
(error "pfbNetParms PFB_ERR_CMD_BAUD_DET_ERROR (time) PFB: Unable to detect baud rate")

Description

This command is used to set the essential network parameters needed for the card to go on line. The card must be off line to use this command.

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 (see pfbBusParms) 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

The command:

(pfbNetParms 0 0 ACTIVE BAUD_1m5)

configues card 0 as a master station 0 on a 1.5M baud network and returns:

(pfbNetParms 0 0 ACTIVE BAUD_1m5 126 0x00)