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

Examples Private Sub cmdReadState_Click() lblAdsState.Caption = TcClientSync.ReadAdsState() End Sub Private Sub cmdWriteState_Click() If (txtAdsState.Text "") Then If (txtAdsState.Text TcClientSync.ReadAdsState()) Then Call TcClientSync.WriteAdsState(txtAdsState.Text) End If End If End Sub PLC program VAR_GLOBAL PLCBoolVar AT %MX0.0: BOOL := TRUE; PLCSIntVar AT %MB2 : USINT := 75; PLCIntVar AT %MB4 : UINT := 12423; PLCDIntVar AT %MB6 : UDINT := 43234532; PLCRealVar AT %MB10 : REAL := 3.1415; PLCLRealVar AT %MB14 : LREAL := 3.141592654; END_VAR 4.3 Active Server Pages Active Server Pages (ASP) provide a facility for the creation of HTML pages on the HTTP server dynamically, i.e.

in response to events. This is achieved by embedding script segments in the HTML code. The scripts are then executed by the web server. TcScript.dll is used for access to TwinCAT. The following sample uses the Internet Information Server (IIS) or the Personal Web Server (PWS) from Microsoft. Creating a TcScript.dll instance can be done most easily in the global.asa. The created instance is valid within the web application for all ASP pages. global.asa: Parameters can be appended to the URL of an ASP page. These parameters are separated from the URL by a '?', and have the structure VarName = VarWert.

At the beginning of an ASP page a check is made for whether the parameter set has been passed, and whether the value can be converted into a number. In that case, the parameter is copied to the VBScript variable intSet , and then passed to the global PLC variable PLCVarInt . The PLC variable is read at the end of the script, and written into the VBScript variable intActual . TX1000 36 Version: 1.0 Language / IDE Unpack sample program Visual Basic 6 https://infosys.beckhoff.com/content/1033/ tcscriptdll/ Resources/12459720971/.zip