Beckhoff Automation GmbH & Co. KG TwinCAT 2 | ADS-Script-DLL — 4.3 Active Server Pages

Examples The PLC variable is also read if no parameter was passed to the ASP page. Within the HTML area the value of the VBScript variable intActual is inserted into the HTML code via the response object (provided by ASP) and transferred to the client. I.e. every time the ASP page is called (with or without parameters), the current value of the PLC variable is displayed in the explorer. To accept input from the operator, forms are used within HTML. These entries are passed as parameters to a particular page. In our sample, the same page (default.asp) is called again. set is passed as a parameter (name of the input field), with the corresponding value entered by the operator.

Since the page is being called again with the parameter set , the value following the set parameter is written into the PLC. default.asp: Dim intActual, intSet Application.Lock If Not (IsEmpty(Request.Querystring("set"))) Then If (IsNumeric(Request.Querystring("set"))) Then intSet = cint(Request.Querystring("set")) call TcPLC.WriteVar(".PLCVarInt", intSet) End if End If intActual = TcPLC.ReadVar(".PLCVarInt") Application.Unlock%> set: ponse.Write intSet %>"> actual: Presentation in Internet Explorer: Pure HTML is sent back here to the client (Internet Explorer). It is also possible for the pages to be called by computers on which TwinCAT is not installed (e.g.

a handheld PC, or even by smartphones). TwinCAT is here exclusively accessed by web servers. The HTML page sent to the client (Internet Explorer): TX1000 37 Version: 1.0