pfbOnline

pfbOnline — puts the Profibus card online.

Synopsis

(pfbOnline card_id [operation...])
  

Parameters

card_id
The ID associated with the card initialized by this command. Up to 4 cards can be simultaneously accessed by the same driver, numbered 0 to 3. If not specified, then the next available ID (sequentially from 0) is assigned (see Description below).
operation
(Optional) The desired card operating mode to enable, one or more of:
DpMaster
DpSlave
FdlMsg
FdlSap
If no operation is specified, then the command will attempt to determine which operations can be started based on the configuration.

Returns

If the command is successfully issued to the card, then

  (pfbOnline card_id response status status_str)

where response, status and status_str are as defined for the pfbCmd command. Otherwise, one of the following error messages:

(error "pfbOnline DR_ERR_CARD_INVALID (time) invalid card: card_id")
(error "pfbOnline PFB_ERR_NO_CARD (time) Card not available")
(error "pfbOnline PFB_ERR_CMD_TIMEOUT (time) Cmd failed (timeout)")
(error "pfbOnline PFB_ERR_CMD_INVALID (time) Cmd not valid in current card state")

Description

This command simplifies the procedure for bringing the card online. At its core, it is equivalent to the command (pfbCmd card_id CMD_GO_ON). However, it also ensures that the appropriate enable and internal event flags are set. The command may take up to 7 seconds to complete. The card must be in an offline state, otherwise the command is invalid. The configuration data for the various operations (DP master, DP slave, FDL messages, FDL SAPs)must be set up before the card is put online. (See pfbLoadCfg command, as well as the following support files: pfbDpMaster.cfg, pfbDpSlave.cfg, pfbFdlSap.cfg, and pfbFdlMsg.cfg.)

When the card goes online, it checks the various configurations and allocates the required internal buffers (for SAP and messages). If no operation is specified, then the command performs a simple check of the configuration to determine which operations are possible. The following table provides a summary of the basis for the decision:

operationConfiguration checks.
DP masterAt least one master control block (slave device) defined.
DP slaveNot checked.
FDL messagesAt least one message block with a non-zero maximum transmit or receive length.
FDL SAPsAt least one SAP block with a defined type.

Example

> (pfbOnline 0 DpMaster)
(pfbOnline 0 "CMD_ON" 0x00 "PFB:Cmd status: no error")