2 diaggetstate function block, Diaggetstate function block, Diaggetstate function block ( 41) – Lenze PROFIBU PC-based Automation User Manual

Page 41: You must, Diaggetstate, Function block ( 41), Control technology | profibus communication manual

Advertising
background image

DMS 2.2 EN 07/2011 TD17

L

41

Control technology | PROFIBUS communication manual

Function libraries

BusDiag.lib function library

8.1.2

DiagGetState function block

If a station available on the bus reports an error, its specific diagnostics information can be

read with the DiagGetState block.
DiagGetState must be called explicitly with the device number and the bus member ID

(station address).

Inputs (VAR_INPUT)

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

Always set to ’0’: 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 PROFIBUS station

attached corresponds to the instance 0, the second to the instance 1 etc.

• For a second MC-PBM communication card, for instance, there is a second

GetBusState instance with another %MByy address. In order to obtain extended

diagnostics with the

DiagGetState function block ( 41)

, you must call the block

with Instance := 1.

BUSMEMBERID

DWORD

Station address of the PROFIBUS station for which the diagnostics information is to

be requested.

Identifier/data type

Meaning/possible settings

READY

BOOL

FALSE: The diagnostics order is processed.

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 Invalid input parameter

• Constant NDSTATE_INVALID_INPUTPARAM

Value = 0 Diagnostics information is not released.

• Constant NDSTATE_NOTENABLED

Value = 1 Diagnostics information is requested.

• Constant NDSTATE_GETDIAG_INFO

Value = 2 Diagnostics information is available.

• Constant NDSTATE_DIAGINFO_AVAILABLE

Value = 3 No diagnostics information available (error when reading data).

• Constant NDSTATE_DIAGINFO_NOTAVAILABLE

Advertising