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

Page 737

Advertising
background image

L-force | PLC Designer

PLC Designer Visualization



DMS 3.2 EN 02/2011 TD29

735

Additional Call:

Via a user defined Windows-Dll you can define method calls for the ActiveX Control in
order to control the behaviour of the control at a call. For this purpose you must enter
the Dll in the field at Dll for Call. If you press the button you get the File Open dialog to
browse for a Dll. If the Dll is in the visualization files directory which is specified in the
project options, just the path relative to this directory will be entered, otherwise the

complete file path.



Stop!

If the Dll is to be used on a runtime system with a Target-Visualization, it must
explicitly be copied there. When the Control is called in the Target-Visualization,
only the filename contained in the path will be regarded.

The Dll is called as soon as the variable defined below in Condition for call gets TRUE
(rising edge). If no condition is specified, in the Target-Visualization it will be called in
each cycle of the visualization task!

Regard the following when creating an appropriate Dll:

The Dll must export a method "ExecuteActiveXCall" with this function prototype :

void ExecuteActiveXCall(IUnknown* pUnk, char* pszId, char*
pszParam, char* pszReturnBuffer, int nReturnBufferSize,
DWORD* pdwReturnFlag);

The function will be called with the following parameters which can be defined in the
configuration dialog:

pszId : string resp. string variable specified in field Methodidentification
pszParam : value specified in field Parameter

The parameter pUnk allows a query of further Com(ActiveX-)interfaces. With these

interfaces you can call any Method on your ActiveX-Control with any parameters
packed in a string!

The parameters pszReturnBuffer, nReturnBufferSize and pdwReturnFlag currently are
not used.

Example of a Dll source file (Click here) :

This example Dll will only call the methods GoBack or GoForward of the control if it
supports the IWebBrowser interface.

Advertising