Plc programming – Lenze ETC Motion Control User Manual

Page 415

Advertising
background image

PLC programming

Library

MMI communication functions

8

8.8

8.8.7

l

415

EDSTCXN EN 2.0

If a message from HMI is available when calling GetApplicationMessage, OK
is set to TRUE and the message copied into the defined buffer. The function
provides an immediate return in any case, even if no message from HMI is
available. In that case OK is set to FALSE.

By evaluating sb1_b the message can be identified by the PLC. The definition
of control blocks must take place between the PLC and MMI developer. The
length of the user data is stored in len_w in bytes.

The variables sb2_b and index_b are optional. Their use must be resolved
between the PLC and HMI developer. handle_b is reserved for the
simultaneous communication with several applications.

)

Note!

These messages are always transferred unsynchronised. Up to 10
messages of this type form MMI to PLC can be buffered in the
control, the rest will be lost. In this case the control reports a
corresponding error message. If necessary, synchronisation
mechanisms must be agreed between HMI and PLC.

8.8.7.2

PutApplicationMessage

FUNCTION_BLOCK PutApplicationMessage

(* sends a message with up to 512 Byte user
data to the MMI *)

VAR_INPUT

data_pab

: POINTER TO ARRAY[0..511] OF BYTE;

Datatypes_s

: STRING(255);

sb1_b

: BYTE;

sb2_b

: BYTE;

index_b

: BYTE;

handle_b

: BYTE;

len_w

: WORD;

END_VAR

VAR_INPUT

ok

: BOOL;

END_VAR

data_pab

Pointer to user data to be sent

Datatypes_s

Optional data descriptor, see DefDataTypes

sb1_b

Control block 1 of the message to HMI

sb2_b

Control block 2, optional

index_b

Block counter, optional

handle_b

Receiver ID, reserved

len_w

Length of received user data in bytes

ok

TRUE, if a message has been sent

Declaration

Parameters

Advertising