Control technology | profibus communication manual – Lenze PROFIBU PC-based Automation User Manual
Page 40

Control technology | PROFIBUS communication manual
Function libraries
BusDiag.lib function library
40
L
DMS 2.2 EN 07/2011 TD17
Inputs (VAR_INPUT)
The status is updated in the background. Thus, the input variables do not need to be pre-
assigned.
Outputs (VAR_OUTPUT)
Identifier/data type
Meaning/possible settings
ENABLE
BOOL
The function block is activated in an edge-controlled manner:
• Positive edge (TRUE) = diagnostics information is detected and READY is set to
TRUE.
DRIVERNAME
POINTER TO
STRING
Name of the driver (address of the name) to which the diagnostics order is to be
transmitted.
• If a ’0’ is entered here, the diagnostics order is passed to all available drivers.
DEVICENUMBER
INT
Identification of the bus which is managed by this module (driver).
• The instance results from the PLC configuration. The first node attached
corresponds to instance 0, the second one to the instance 1 and so on.
• For a second MC-PBM communication card, you must create a second
GetBusState instance with another %MByy address. In order to obtain the
extended diagnostics with the
DiagGetState function block ( 41)
, you must call
the block with Instance := 1.
Identifier/data type
Meaning/possible settings
READY
BOOL
Always TRUE: Processing of the diagnostics order is completed.
STATE
INT
When READY = TRUE, STATE indicates the current status of the block by one of the
following values. These values are assigned to global constants. The constants are
stored in the BusDiag.lib function library.
Value = 1 The bus is ok, no error.
• Constant BUSSTATE_BUSOK
Value = 2 A bus error has occurred.
• Constant BUSSTATE_BUSFAULT
Value = 3 There is no PROFIBUS communication or communication has been
aborted.
• Constant BUSSTATE_BUSNOTCOMMUNICATING
Value = 4 The PROFIBUS is set to STOPPED.
• Constant BUSSTATE_BUSSTOPPED
EXTENDEDINFO
ARRAY [0...129]
OF BYTE
1:1 relation between the ARRAY index and the station number of the slave.
Only the first three bits of the byte are used:
Bit 0 The PROFIBUS station is configured.
Bit 1 The PROFIBUS station is active at the bus.
Bit 2 The PROFIBUS station sends an error message.
• Detailed information can be obtained via the
Note!
After the bus is activated, the slaves set the Error-Flag (bit 2) so that the master
first reads out the diagnostics information. If the diagnostics information for the
corresponding slave is read out via the
, the
Error-Flag is reset.