Beckhoff Automation GmbH & Co. KG TF2000 — 4.3.2.3 Methods and properties

Configuration | ADS PLC properties can only be used explicitly in the HMI by linking the property individually to a control attribute. If the entire function block is linked to a control attribute, the property is not called. This is the case when a function block is used as the source data of the DataGrid or as a user control parameter. PLC methods The methods must be switched visible in the PLC with an attribute pragma via ADS. {attribute 'TcRpcEnable'} METHOD MyMethod : BOOL VAR_INPUT bInput : BOOL; END_VAR Afterwards you can see the methods in the TwinCAT HMI. Within the TwinCAT HMI Configuration Window, you can call them explicitly.

At runtime in the client, you can call the methods using a JavaScript/TypeScript function and the Framework API. Below you will find an example for the call via Framework API. // call of method without parameter TcHmi.Symbol.readEx2("%s%PLC1.MAIN.fbTest.MethodWithoutParam%/s%", function (data) { console.log(data); }); // call of method with parameter TcHmi.Symbol.writeEx("%s%PLC1.MAIN.fbTest.MyMethod%/s%", { bInput: true }, function (data) { console.log(data); }); If the method has a return value, you can access the return value within the callback function in the Result object. TF2000 41 Version: 1.8.0