L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 358

Advertising
background image

L-force | PLC Designer

The Resources

356

DMS 3.2 EN 02/2011 TD29



See in the following the input and output parameters of the function block
DiagGetState. Define an instance of this function block in your PLC Designer
project to read the diagnosis information for a specific bus module:
Input variables of DiagGetState:

ENABLE: BOOL;

At a rising edge of ENABLE the function block starts working

DRIVERNAME:POINTER TO
STRING;

Name of the driver (address of the name) to which the diagnosis
request should be sent. If here is entered a 0, the diagnosis

request will be forwarded to all present drivers.

DEVICENUMBER:INT;

Identification of the bus which is managed by the driver. E.g.: the

Hilscher driver can handle up to 5 cards (busses). The index is 0-

based.

BUSMEMBERID:DWORD ;

Unique bus-/driver specific identification of the bus module. (E.g.:
for a CANopen-card this is the NodeID, for a PB-DP card this is the

station address of the participant etc. )

Output variables of DiagGetState

READY:BOOL ;

TRUE: the work on the diagnosis request has been terminated

STATE:INT;

If READY = TRUE then STATE gets one of the following values
which define the actual state of the function block:

-1: invalid input parameter
(NDSTATE_INVALID_INPUTPARAM:INT;)

0: function block does not work (NDSTATE_NOTENABLED:INT;)

1: function block is just reading the diagnosis info
(NDSTATE_GETDIAG_INFO:INT;)

2: diagnosis info is now available

(NDSTATE_DIAGINFO_AVAILABLE:INT;)

3: no diagnosis info is available

(NDSTATE_DIAGINFO_NOTAVAILABLE:INT;)

EXTENDEDINFO:ARRAY[0..129]
OF BYTE;

Up to 100 Bytes manufacturer specific diagnosis data of the bus.

Alternative diagnosis analysis via function block DiagGetBusState:

If a diagnostic address is specified in the configuration, the bus state will be
updated in the background. If no diagnostic address is specified or if no
configuration has been done in »PLC Designer«, then – if supported by the target
system – the function block DiagGetBusState can be instantiated and explicitly
called in order to get diagnosis data from the bus. This function block like
DiagGetState also must be available in a manufacturer specific library, e.g.
BusDiag.lib by 3S - Smart Software Solutions GmbH.

Advertising