L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 210

Advertising
background image

L-force | PLC Designer

Visualization

208

DMS 4.1 EN 03/2011 TD29

Method VariableWritten, assigned to POU:
METHOD VariableWritten : BOOL (* provides some information always when an
edit control field is closed in the visualization, i.e. a variable gets written by user
input in one of the upper rectangles *)
VAR_INPUT
pVar : POINTER TO BYTE;
varType : VisuElems.Visu_Types;
iMaxSize : INT;
pClient : POINTER TO VisuElems.VisuStructClientData;
END_VAR

// string stinfo, which will be displayed in the lower rectangle, is composed
PLC_PRG.stInfo := 'Variable written; type: ';
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, INT_TO_STRING(varType));
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, ', adr: ');
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, DWORD_TO_STRING(pVar));
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, ', by: ');
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, SEL(pClient^.globaldata.clienttype =
VisuElems.Visu_ClientType.Targetvisualization, 'other visu', 'targetvisu'));


Notice key events
The application can notice when a key event is released in an assigned visualization,
that means when the user operates and releases a key when the visualization is active.

Note: Regard the options of configuring keyboard operation of visualizations.

To get notified about such events, a function block (implementing the interface
VisuElems.IVisuUserEventManager, provided by VisuElemBase.library) can be attached
to the global instance VisuElems.Visu_Globals.g_VisuEventManager, using the
method SetKeyEventHandler of this instance like in the following example:

Advertising