Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The TwinCAT Technology is covered, including but not limited to the following patent applications and patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


Introduction

The ADS-Script-DLL permits access to ADS devices from script languages (VBScript or JScript). Script languages are used by the Windows Scripting Host (WSH) and in the creation of interactive internet applications. The scripts can be executed either on the web server (active server pages) or at the client (DHTML, ...).

Because the script languages only support a small number of data types, a corresponding method exists in the ADS device for every possible data type. This reduces the number of parameters to a minimum. The methods in which a variable is accessed by name (TcScriptSync::ReadVar() and TcScriptSync::WriteVar()) form exceptions to this rule. In these cases the ADS variable data type is found from the ADS device. Both methods convert the parameters internally into the associated data types before making their access to the ADS device.


Method summary

Because the script languages only support a small number of data types, a corresponding method exists in the ADS device for every possible data type. This reduces the number of parameters to a minimum. The methods in which a variable is accessed by name (TcScriptSync::ReadVar() and TcScriptSync::WriteVar()) form exceptions to this rule. In these cases the ADS variable data type is found from the ADS device. Both methods convert the parameters internally into the associated data types before making their access to the ADS device.

Application | Method
general | Communication | TcScriptSync::ConnectTo()
Read | TcScriptSync::ReadAdsState()
Write | TcScriptSync::WriteAdsState()
by address | by variable name
synchronous Read TcScriptSync::ReadBool()
TcScriptSync::ReadInt8()
TcScriptSync::ReadInt16()
TcScriptSync::ReadInt32()
TcScriptSync::ReadReal32()
TcScriptSync::ReadReal64()
TcScriptSync::ReadArrayOfBool()
TcScriptSync::ReadArrayOfInt8()
TcScriptSync::ReadArrayOfInt16()
TcScriptSync::ReadArrayOfInt32()
TcScriptSync::ReadArrayOfReal32()
TcScriptSync::ReadArrayOfReal64()
 TcScriptSync::ReadVar()
Write TcScriptSync::WriteBool()
TcScriptSync::WriteInt8()
TcScriptSync::WriteInt16()
TcScriptSync::WriteInt32()
TcScriptSync::WriteReal32()
TcScriptSync::WriteReal64()
TcScriptSync::WriteArrayOfBool()
TcScriptSync::WriteArrayOfInt8()
TcScriptSync::WriteArrayOfInt16()
TcScriptSync::WriteArrayOfInt32()
TcScriptSync::WriteArrayOfReal32()
TcScriptSync::WriteArrayOfReal64()
 TcScriptSync::WriteVar()


ConnectTo

Opens a communication channel between the object and an ADS device (PLC, NC, ...).

object.ConnectTo(
  sAmsNetId	As String,
  nPort		As Long)

Parameters

sAmsNetId
AdsAmsNetId.
nPort
Port number.

Return value

-

Description

The first parameter contains the six-figure AdsAmsNetId. The individual values are separated from one another by a dot. If an empty string is passed, the local AdsAmsNetId is used.

If a communication channel was already open before the call to ConnectTo(), it is automatically closed. The communication channel is also closed if the object is deleted.

Examples

VBScript:

Dim TcClientSync
Set TcClientSync = CreateObject("TCSCRIPT.TcScriptSync")
Call TcClientSync.ConnectTo("", 801)

JScript:

var TcClientSync;
TcClientSync = new ActiveXObject("TCSCRIPT.TcScriptSync");
TcClientSync.ConnectTo("172.16.17.13.1.1", 811);


ReadAdsState

Reads the current ADS state of an ADS device.

object.ReadAdsState() As Long

Parameters

-

Return value

ADS-Status.

Description

Any ADS device can adopt a number of states. The PLC, for instance, can be in either the STOP or the RUN state. This state can be interrogated with the aid of the ReadAdsState() method. A summary of all the possible states is found, for instance, in the description of the ADSSTATE enum of the ADS-OCX. When evaluating the ADS state it must be remembered that not every ADS device can adopt every state. The NC, for instance, can not be in the STOP state.
The most important of the ADS states are RUN (5) and STOP (6), and they are used most often in connection with the PLC.

Examples

VBScript:

Dim nAdsState
nAdsState = TcClientSync.ReadAdsState()
WScript.echo "AdsState = ", nAdsState

JScript:

var nAdsState;
nAdsState = TcClientSync.ReadAdsState();
WScript.echo("AdsState = ", nAdsState);


WriteAdsState

Changes the ADS status of an ADS device.

object.WriteAdsState(
  nAdsState	As Long
)

Parameters

nAdsState
new ADS status.

Return value

-

Description

Any ADS device can adopt a number of states. The PLC, for instance, can be in either the STOP or the RUN state. This state can be changed by means of the WriteAdsState() method. A summary of all the possible states is found, for instance, in the description of the ADSSTATE enum of the ADS-OCX. When evaluating the ADS state it must be remembered that not every ADS device can adopt every state. The NC, for instance, can not be in the STOP state.
The most important of the ADS states are RUN (5) and STOP (6), and they are used most often in connection with the PLC.

Examples

VBScript:

Call TcClientSync.WriteAdsState(5)

JScript:

TcClientSync.WriteAdsState(5);


ReadVar

Reads the value of a variable from an ADS device.

object.ReadVar(
  sVarName	As String
) As Variant

Parameters

sVarName
Name of the ADS variable.

Return value

Value of the ADS variable.

Description

The reading procedure is performed synchronously.

Examples

VBScript:

Dim VarValue
VarValue = TcClientSync.ReadVar(".PLCVarSInt")
WScript.echo "VarValue = ", VarValue

JScript:

var VarValue;
VarValue = TcClientSync.ReadVar(".PLCVarSInt");
WScript.echo("VarValue = ", VarValue);


ReadBool

Reads a variable of type boolean from an ADS device.

object.ReadBool(
  nIndexGroup	As Long,
  nIndexOffset	As Long
) As Boolean

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.

Return value

Value of the ADS variable.

Description

The reading procedure is performed synchronously. In IEC 61131-6 this corresponds to the BOOL data type.

Examples

VBScript:

Dim VarBool
VarBool = TcClientSync.ReadBool(&H4020, 0)
WScript.echo "VarBool = ", VarBool

JScript:

var VarBool;
VarBool = TcClientSync.ReadBool(0x4020, 0);
WScript.echo("VarBool = ", VarBool);


ReadInt8

Reads a variable of type byte from an ADS device.

object.ReadInt8(
  nIndexGroup	As Long,
  nIndexOffset	As Long
) As Byte

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.

Return value

Value of the ADS variable.

Description

The reading procedure is performed synchronously. In IEC 61131-6 this corresponds to the BYTE, SINT or USINT data type.

Examples

VBScript:

Dim VarInt8
VarInt8 = TcClientSync.ReadInt8(&H4020, 0)
WScript.echo "VarInt8 = ", VarInt8

JScript:

var VarInt8;
VarInt8 = TcClientSync.ReadInt8(0x4020, 0);
WScript.echo("VarInt8 = ", VarInt8);


ReadInt16

Reads a variable of type integer from an ADS device.

object.ReadInt16(
  nIndexGroup	As Long,
  nIndexOffset	As Long
) As Integer

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.

Return value

Value of the ADS variable.

Description

The reading procedure is performed synchronously. In IEC 61131-6 this corresponds to the WORD, INT or UINT data type.

Examples

VBScript:

Dim VarInt16
VarInt16 = TcClientSync.ReadInt16(&H4020, 0)
WScript.echo "VarInt16 = ", VarInt16

JScript:

var VarInt16;
VarInt16 = TcClientSync.ReadInt16(0x4020, 0);
WScript.echo("VarInt16 = ", VarInt16);


ReadInt32

Reads a variable of type long from an ADS device.

object.ReadInt32(
  nIndexGroup	As Long,
  nIndexOffset	As Long
) As Long

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.

Return value

Value of the ADS variable.

Description

The reading procedure is performed synchronously. In IEC 61131-6 this corresponds to the DWORD, DINT or UDINT data type.

Examples

VBScript:

Dim VarInt32
VarInt32 = TcClientSync.ReadInt32(&H4020, 0)
WScript.echo "VarInt32 = ", VarInt32

JScript:

var VarInt32;
VarInt32 = TcClientSync.ReadInt32(0x4020, 0);
WScript.echo("VarInt32 = ", VarInt32);


ReadReal32

Reads a variable of type float from an ADS device.

object.ReadReal32(
  nIndexGroup	As Long,
  nIndexOffset	As Long
) As Single

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.

Return value

Value of the ADS variable.

Description

The reading procedure is performed synchronously. In IEC 61131-6 this corresponds to the REAL data type.

Examples

VBScript:

Dim VarReal32
VarReal32 = TcClientSync.ReadReal32(&H4020, 0)
WScript.echo "VarReal32 = ", VarReal32

JScript:

var VarReal32;
VarReal32 = TcClientSync.ReadReal32(0x4020, 0);
WScript.echo("VarReal32 = ", VarReal32);


ReadReal64

Reads a variable of type double from an ADS device.

object.ReadReal64(
  nIndexGroup	As Long,
  nIndexOffset	As Long
) As Double

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.

Return value

Value of the ADS variable.

Description

The reading procedure is performed synchronously. In IEC 61131-6 this corresponds to the LREAL data type.

Examples

VBScript:

Dim VarReal64
VarReal64 = TcClientSync.ReadReal64(&H4020, 0)
WScript.echo "VarReal64 = ", VarReal64

JScript:

var VarReal64;
VarReal64 = TcClientSync.ReadReal64(0x4020, 0);
WScript.echo("VarReal64 = ", VarReal64);


TcScriptSync::ReadArrayOfBool()

TwinCAT ADS-Script-DLL - Reference

ReadArrayOfBool

Reads an array of booleans from the ADS device.

object.ReadArrayOfBool(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nCount		As Long
) As Variant

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to be read.

Return value

The array being read from the ADS device

Description

The read process is executed synchronously. In the IEC 61131-6 the array represents the data type ARRAY OF BOOL..

Samples

VBScript:

Dim VarArrayBool
VarArrayBool = TcClientSync.ReadArrayOfBool(&H4020, 0, 2)
WScript.echo "VarArrayBool(0) = ", VarArrayBool(0)
WScript.echo "VarArrayBool(1) = ", VarArrayBool(1)

JScript:

var VarArrayBool;
VarArrayBool = TcClientSync.ReadArrayOfBool(0x4020, 0, 2);
WScript.echo("VarArrayBool[0] = ", VarArrayBool[0]);
WScript.echo("VarArrayBool[1] = ", VarArrayBool[1]);


TcScriptSync::ReadArrayOfInt8()

TwinCAT ADS-Script-DLL - Reference

ReadArrayOfInt8

Reads an array of bytes from the ADS device.

object.ReadArrayOfInt8(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nCount		As Long
) As Variant

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to be read.

Return value

The array being read from the ADS device

Description

The read process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF BYTE, ARRAY OF SINT or ARRAY OF USINT..

Samples

VBScript:

Dim VarArrayInt8
VarArrayInt8 = TcClientSync.ReadArrayOfInt8(&H4020, 0, 2)
WScript.echo "VarArrayInt8(0) = ", VarArrayInt8(0)
WScript.echo "VarArrayInt8(1) = ", VarArrayInt8(1)

JScript:

var VarArrayInt8;
VarArrayInt8 = TcClientSync.ReadArrayOfInt8(0x4020, 0, 2);
WScript.echo("VarArrayInt8[0] = ", VarArrayInt8[0]);
WScript.echo("VarArrayInt8[1] = ", VarArrayInt8[1]);


TcScriptSync::ReadArrayOfInt16()

TwinCAT ADS-Script-DLL - Reference

ReadArrayOfInt16

Reads an array of integers from the ADS device.

object.ReadArrayOfInt16(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nCount		As Long
) As Variant

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to be read.

Return value

The array being read from the ADS device

Description

The read process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF WORD, ARRAY OF INT or ARRAY OF UINT.

Samples

VBScript:

Dim VarArrayInt16
VarArrayInt16 = TcClientSync.ReadArrayOfInt16(&H4020, 0, 2)
WScript.echo "VarArrayInt16(0) = ", VarArrayInt16(0)
WScript.echo "VarArrayInt16(1) = ", VarArrayInt16(1)

JScript:

var VarArrayInt16;
VarArrayInt16 = TcClientSync.ReadArrayOfInt16(0x4020, 0, 2);
WScript.echo("VarArrayInt16[0] = ", VarArrayInt16[0]);
WScript.echo("VarArrayInt16[1] = ", VarArrayInt16[1]);


TcScriptSync::ReadArrayOfInt32()

TwinCAT ADS-Script-DLL - Reference

ReadArrayOfInt32

Reads an array of longs from the ADS device.

object.ReadArrayOfInt32(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nCount		As Long
) As Variant

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to be read.

Return value

The array being read from the ADS device

Description

The read process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF DWORD, ARRAY OF DINT or ARRAY OF UDINT.

Samples

VBScript:

Dim VarArrayInt32
VarArrayInt32 = TcClientSync.ReadArrayOfInt32(&H4020, 0, 2)
WScript.echo "VarArrayInt32(0) = ", VarArrayInt32(0)
WScript.echo "VarArrayInt32(1) = ", VarArrayInt32(1)

JScript:

var VarArrayInt32;
VarArrayInt32 = TcClientSync.ReadArrayOfInt32(0x4020, 0, 2);
WScript.echo("VarArrayInt32[0] = ", VarArrayInt32[0]);
WScript.echo("VarArrayInt32[1] = ", VarArrayInt32[1]);


TcScriptSync::ReadArrayOfReal32()

TwinCAT ADS-Script-DLL - Reference

ReadArrayOfReal32

Reads an array of floats from the ADS device.

object.ReadArrayOfReal32(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nCount		As Long
) As Variant

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to be read.

Return value

The array being read from the ADS device

Description

The read process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF REAL.

Samples

VBScript:

Dim VarArrayReal32
VarArrayReal32 = TcClientSync.ReadArrayOfReal32(&H4020, 0, 2)
WScript.echo "VarArrayReal32(0) = ", VarArrayReal32(0)
WScript.echo "VarArrayReal32(1) = ", VarArrayReal32(1)

JScript:

var VarArrayReal32;
VarArrayReal32 = TcClientSync.ReadArrayOfReal32(0x4020, 0, 2);
WScript.echo("VarArrayReal32[0] = ", VarArrayReal32[0]);
WScript.echo("VarArrayReal32[1] = ", VarArrayReal32[1]);


TcScriptSync::ReadArrayOfReal64()

TwinCAT ADS-Script-DLL - Reference

ReadArrayOfReal64

Reads an array of doubles from the ADS device.

object.ReadArrayOfReal64(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nCount		As Long
) As Variant

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to be read.

Return value

The array being read from the ADS device

Description

The read process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF LREAL.

Samples

VBScript:

Dim VarArrayReal64
VarArrayReal64 = TcClientSync.ReadArrayOfReal64(&H4020, 0, 2)
WScript.echo "VarArrayReal64(0) = ", VarArrayReal64(0)
WScript.echo "VarArrayReal64(1) = ", VarArrayReal64(1)

JScript:

var VarArrayReal64;
VarArrayReal64 = TcClientSync.ReadArrayOfReal64(0x4020, 0, 2);
WScript.echo("VarArrayReal64[0] = ", VarArrayReal64[0]);
WScript.echo("VarArrayReal64[1] = ", VarArrayReal64[1]);


WriteVar

Writes into a variable in an ADS device.

object.WriteVar(
  sVarName	As String,
  nValue		As Variant
)

Parameters

sVarName
Name of the ADS variable.
nValue
The value that is to be written into the variable.

Return value

-

Description

The writing procedure is performed synchronously.

Examples

VBScript:

Dim VarValue = 0
Call TcClientSync.WriteVar(".PLCSIntVar", VarValue)

JScript:

var VarValue = 0;
TcClientSync.WriteVar(".PLCSIntVar", VarValue);


WriteBool

Writes a variable of type boolean.

object.WriteBool(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  bValue		As Boolean
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.
bValue
The value that is to be written into the variable.

Return value

-

Description

The writing procedure is performed synchronously. In IEC 61131-6 this corresponds to the BOOL data type.

Examples

VBScript:

Dim VarBool = 0
Call TcClientSync.WriteBool(&H4020, 0, VarBool)

JScript:

var VarBool = 0;
TcClientSync.WriteBool(0x4020, 0, VarBool);


WriteInt8

Writes a variable of type byte.

object.WriteInt8(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nValue		As Byte
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.
nValue
The value that is to be written into the variable.

Return value

-

Description

The writing procedure is performed synchronously. In IEC 61131-6 this corresponds to the BYTE, SINT or USINT data type.

Examples

VBScript:

Dim VarInt8 = 0
Call TcClientSync.WriteInt8(&H4020, 0, VarInt8)

JScript:

var VarInt8 = 0;
TcClientSync.WriteInt8(0x4020, 0, VarInt8);


WriteInt16

Writes a variable of type integer.

object.WriteInt16(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nValue		As Integer
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.
nValue
The value that is to be written into the variable.

Return value

-

Description

The writing procedure is performed synchronously. In IEC 61131-6 this corresponds to the WORD, INT or UINT data type.

Examples

VBScript:

Dim VarInt16 = 0
Call TcClientSync.WriteInt16(&H4020, 0, VarInt16)

JScript:

var VarInt16 = 0;
TcClientSync.WriteInt16(0x4020, 0, VarInt16);


WriteInt32

Writes a variable of type long.

object.WriteInt32(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  nValue		As Long
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.
nValue
The value that is to be written into the variable.

Return value

-

Description

The writing procedure is performed synchronously. In IEC 61131-6 this corresponds to the DWORD, DINT or UDINT data type.

Examples

VBScript:

Dim VarInt32 = 0
Call TcClientSync.WriteInt32(&H4020, 0, VarInt32)

JScript:

var VarInt32 = 0;
TcClientSync.WriteInt32(0x4020, 0, VarInt32);


TcScriptSync::WriteReal32()

TwinCAT ADS-Script-DLL - Reference

WriteReal32

Writes a variable of type single.

object.WriteReal32(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  fValue		As Single
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.
fValue
The value that is to be written into the variable.

Return value

-

Description

The writing procedure is performed synchronously. In IEC 61131-6 this corresponds to the REAL data type.

Examples

VBScript:

Dim VarReal32 = 0
Call TcClientSync.WriteReal32(&H4020, 0, VarReal32)

JScript:

var VarReal32 = 0;
TcClientSync.WriteReal32(0x4020, 0, VarReal32);


WriteReal64

Writes a variable of type double.

object.WriteReal64(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  fValue		As Double
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable.
fValue
The value that is to be written into the variable.

Return value

-

Description

The writing procedure is performed synchronously. In IEC 61131-6 this corresponds to the LREAL data type.

Examples

VBScript:

Dim VarReal64 = 0
Call TcClientSync.WriteReal64(&H4020, 0, VarReal64)

JScript:

var VarReal64 = 0;
TcClientSync.WriteReal64(0x4020, 0, VarReal64);


TcScriptSync::WriteArrayOfBool()

TwinCAT ADS-Script-DLL - Reference

WriteArrayOfBool

Writes an array of booleans to an ADS device.

object.WriteArrayOfBool(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  pValue		As Variant
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to write.

Return value

-

Return value

The array being read from the ADS device

Description

The write process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF BOOL.

Samples

VBScript:

Dim VarArrayBool(1)
VarArrayBool(0) = True
VarArrayBool(1) = False
Call TcClientSync.WriteArrayOfBool(&H4020, 0, VarArrayBool)

JScript:

var VarArrayBool[2];
VarArrayBool[0] = true;
VarArrayBool[1] = false;
TcClientSync.WriteArrayOfBool(0x4020, 0, VarArrayBool);


TcScriptSync::WriteArrayOfInt8()

TwinCAT ADS-Script-DLL - Reference

WriteArrayOfInt8

Writes an array of bytes to an ADS device.

object.WriteArrayOfInt8(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  pValue		As Variant
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to write.

Return value

-

Return value

The array being read from the ADS device

Description

The write process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF BYTE, ARRAY OF SINT oder ARRAY OF USINT.

Samples

VBScript:

Dim VarArrayInt8(1)
VarArrayInt8(0) = 0
VarArrayInt8(1) = 1
Call TcClientSync.WriteArrayOfInt8(&H4020, 0, VarArrayInt8)

JScript:

var VarArrayInt8[2];
VarArrayInt8[0] = 0;
VarArrayInt8[1] = 1;
TcClientSync.WriteArrayOfInt8(0x4020, 0, VarArrayInt8);


TcScriptSync::WriteArrayOfInt16()

TwinCAT ADS-Script-DLL - Reference

WriteArrayOfInt16

Writes an array of integers to an ADS device.

object.WriteArrayOfInt16(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  pValue		As Variant
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to write.

Return value

-

Return value

The array being read from the ADS device

Description

The write process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF WORD, ARRAY OF INT oder ARRAY OF UINT.

Samples

VBScript:

Dim VarArrayInt16(1)
VarArrayInt16(0) = 0
VarArrayInt16(1) = 1
Call TcClientSync.WriteArrayOfInt16(&H4020, 0, VarArrayInt16)

JScript:

var VarArrayInt16[2];
VarArrayInt16[0] = 0;
VarArrayInt16[1] = 1;
TcClientSync.WriteArrayOfInt16(0x4020, 0, VarArrayInt16);


TcScriptSync::WriteArrayOfInt32()

TwinCAT ADS-Script-DLL - Reference

WriteArrayOfInt32

Writes an array of longs to an ADS device.

object.WriteArrayOfInt32(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  pValue		As Variant
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to write.

Return value

-

Return value

The array being read from the ADS device

Description

The write process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF DWORD, ARRAY OF DINT or ARRAY OF UDINT.

Samples

VBScript:

Dim VarArrayInt32(1)
VarArrayInt32(0) = 0
VarArrayInt32(1) = 1
Call TcClientSync.WriteArrayOfInt32(&H4020, 0, VarArrayInt32)

JScript:

var VarArrayInt32[2];
VarArrayInt32[0] = 0;
VarArrayInt32[1] = 1;
TcClientSync.WriteArrayOfInt32(0x4020, 0, VarArrayInt32);


TcScriptSync::WriteArrayOfReal32()

TwinCAT ADS-Script-DLL - Reference

WriteArrayOfReal32

Writes an array of floats to an ADS device.

object.WriteArrayOfReal32(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  pValue		As Variant
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to write.

Return value

-

Return value

The array being read from the ADS device

Description

The write process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF REAL.

Samples

VBScript:

Dim VarArrayReal32(1)
VarArrayReal32(0) = 0.1
VarArrayReal32(1) = 1.2
Call TcClientSync.WriteArrayOfReal32(&H4020, 0, VarArrayReal32)

JScript:

var VarArrayReal32[2];
VarArrayReal32[0] = 0.1;
VarArrayReal32[1] = 1.2;
TcClientSync.WriteArrayOfReal32(0x4020, 0, VarArrayReal32);


TcScriptSync::WriteArrayOfReal64()

TwinCAT ADS-Script-DLL - Reference

WriteArrayOfReal64

Writes an array of doubles to an ADS device.

object.WriteArrayOfReal64(
  nIndexGroup	As Long,
  nIndexOffset	As Long,
  pValue		As Variant
)

Parameters

nIndexGroup
Index group of the ADS variable.
nIndexOffset
Index offset of the ADS variable
nCount
Number of elements to write.

Return value

-

Return value

The array being read from the ADS device

Description

The write process is executed synchronously. In the IEC 61131-6 the array corresponds to the data type ARRAY OF LREAL.

Samples

VBScript:

Dim VarArrayReal64(1)
VarArrayReal64(0) = 0.1
VarArrayReal64(1) = 1.2
Call TcClientSync.WriteArrayOfReal64(&H4020, 0, VarArrayReal64)

JScript:

var VarArrayReal64[2];
VarArrayReal64[0] = 0.1;
VarArrayReal64[1] = 1.2;
TcClientSync.WriteArrayOfReal64(0x4020, 0, VarArrayReal64);


Overview

Description | Source text
Example 1: Windows Scripting Host | ADS-Script-DLL Sample01.exe
Example 2: Visual Basic | ADS-Script-DLL Sample02.exe
Example 3: Active Server Pages | ADS-Script-DLL Sample03.exe


Windows Scripting Host

Load the PLC program into the local PLC on your PC and run the PLC program. Then call the script.

After the communication channel has been opened, a check is made as to whether the PLC is in the RUN state. If not, the PLC is started. The next step is that all the PLC variables are read off and individually displayed. Then all the variables are incremented, and are checked by reading off and displaying them again. The PLC is finally stopped.

VBScript:

Dim TcClientSync
Dim VarBool, VarInt8, VarInt16, VarInt32, VarReal32, VarReal64

'create TcScript-Object
Set TcClientSync = CreateObject("TCSCRIPT.TcScriptSync")
Call TcClientSync.ConnectTo("", 801)

if (TcClientSync.ReadAdsState() <> 5) then
WScript.echo("PLC is not running!" & vbCrLf & "Start PLC.")
Call TcClientSync.WriteAdsState(5)
end if

'read from PLC
VarBool = TcClientSync.ReadBool(&H4020, 0)
WScript.echo "VarBool = ", VarBool

VarInt8 = TcClientSync.ReadInt8(&H4020, 2)
WScript.echo "VarInt8 = ", VarInt8

VarInt16 = TcClientSync.ReadInt16(&H4020, 4)
WScript.echo "VarInt16 = ", VarInt16

VarInt32 = TcClientSync.ReadInt32(&H4020, 6)
WScript.echo "VarInt32 = ", VarInt32

VarReal32 = TcClientSync.ReadReal32(&H4020, 10)
WScript.echo "VarReal32 = ", VarReal32

VarReal64 = TcClientSync.ReadReal64(&H4020, 14)
WScript.echo "VarReal64 = ", VarReal64

'write to PLC
Call TcClientSync.WriteBool(&H4020, 0, NOT VarBool)
Call TcClientSync.WriteInt8(&H4020, 2, VarInt8 + 1)
Call TcClientSync.WriteInt16(&H4020, 4, VarInt16 + 1)
Call TcClientSync.WriteInt32(&H4020, 6, VarInt32 + 1)
Call TcClientSync.WriteReal32(&H4020, 10, VarReal32 + 1.1)
Call TcClientSync.WriteReal64(&H4020, 14, VarReal64 + 1.11)

Call TcClientSync.WriteVar(".PLCBoolVar", VarBool)
Call TcClientSync.WriteVar(".PLCSIntVar", VarInt8 + 2)
Call TcClientSync.WriteVar(".PLCIntVar", VarInt16 + 2)
Call TcClientSync.WriteVar(".PLCDIntVar", VarInt32 + 2)
Call TcClientSync.WriteVar(".PLCRealVar", VarReal32 + 2.1)
Call TcClientSync.WriteVar(".PLCLRealVar", VarReal64 + 2.11)

'read again from PLC
VarBool = TcClientSync.ReadVar(".PLCBoolVar")
WScript.echo "VarBool = ", VarBool

VarInt8 = TcClientSync.ReadVar(".PLCSIntVar")
WScript.echo "VarInt8 = ", VarInt8

VarInt16 = TcClientSync.ReadVar(".PLCIntVar")
WScript.echo "VarInt16 = ", VarInt16

VarInt32 = TcClientSync.ReadVar(".PLCDIntVar")
WScript.echo "VarInt32 = ", VarInt32

VarReal32 = TcClientSync.ReadVar(".PLCRealVar")
WScript.echo "VarReal32 = ", VarReal32

VarReal64 = TcClientSync.ReadVar(".PLCLRealVar")
WScript.echo "VarReal64 = ", VarReal64

if (TcClientSync.ReadAdsState() = 5) then
WScript.echo("PLC is running!" & vbCrLf & "Stop PLC.")
Call TcClientSync.WriteAdsState(6)
end if

JScript:

var TcClientSync;
var VarBool, VarInt8, VarInt16, VarInt32, VarReal32, VarReal64;

// create TcScript-Object
TcClientSync = new ActiveXObject("TCSCRIPT.TcScriptSync");
TcClientSync.ConnectTo("", 801);

if (TcClientSync.ReadAdsState() != 5)
{
WScript.echo("PLC is not running!\nStart PLC.");
TcClientSync.WriteAdsState(5);
}

// read from PLC
VarBool = TcClientSync.ReadBool(0x4020, 0);
WScript.echo("VarBool = ", VarBool);

VarInt8 = TcClientSync.ReadInt8(0x4020, 2);
WScript.echo("VarInt8 = ", VarInt8);

VarInt16 = TcClientSync.ReadInt16(0x4020, 4);
WScript.echo("VarInt16 = ", VarInt16);

VarInt32 = TcClientSync.ReadInt32(0x4020, 6);
WScript.echo("VarInt32 = ", VarInt32);

VarReal32 = TcClientSync.ReadReal32(0x4020, 10);
WScript.echo("VarReal32 = ", VarReal32);

VarReal64 = TcClientSync.ReadReal64(0x4020, 14);
WScript.echo("VarReal64 = ", VarReal64);

// write to PLC
TcClientSync.WriteBool(0x4020, 0, !VarBool);
TcClientSync.WriteInt8(0x4020, 2, VarInt8 + 1);
TcClientSync.WriteInt16(0x4020, 4, VarInt16 + 1);
TcClientSync.WriteInt32(0x4020, 6, VarInt32 + 1);
TcClientSync.WriteReal32(0x4020, 10, VarReal32 + 1.1);
TcClientSync.WriteReal64(0x4020, 14, VarReal64 + 1.11);

TcClientSync.WriteVar(".PLCBoolVar", VarBool);
TcClientSync.WriteVar(".PLCSIntVar", VarInt8 + 2);
TcClientSync.WriteVar(".PLCIntVar", VarInt16 + 2);
TcClientSync.WriteVar(".PLCDIntVar", VarInt32 + 2);
TcClientSync.WriteVar(".PLCRealVar", VarReal32 + 2.1);
TcClientSync.WriteVar(".PLCLRealVar", VarReal64 + 2.11);

// read again from PLC
VarBool = TcClientSync.ReadVar(".PLCBoolVar");
WScript.echo("VarBool = ", VarBool);

VarInt8 = TcClientSync.ReadVar(".PLCSIntVar");
WScript.echo("VarInt8 = ", VarInt8);

VarInt16 = TcClientSync.ReadVar(".PLCIntVar");
WScript.echo("VarInt16 = ", VarInt16);

VarInt32 = TcClientSync.ReadVar(".PLCDIntVar");
WScript.echo("VarInt32 = ", VarInt32);

VarReal32 = TcClientSync.ReadVar(".PLCRealVar");
WScript.echo("VarReal32 = ", VarReal32);

VarReal64 = TcClientSync.ReadVar(".PLCLRealVar");
WScript.echo("VarReal64 = ", VarReal64);

if (TcClientSync.ReadAdsState() == 5)
{
WScript.echo("PLC is running!\nStop PLC.");
TcClientSync.WriteAdsState(6);
}

Unpack the example program 'Windows Scripting Host'.


Visual Basic

The ADS-Script DLL does not make use of all Visual Basic's facilities. The ADS-OCX is more suitable if you want to access TwinCAT from Visual Basic, since it has been written to match Visual Basic. The particular value of the ADS-Script DLL is its use with script languages (VBScript and JScript). A Visual Basic program is included at this point, in order to demonstrate the facilities of the ADS-Script DLL more clearly.

First load the PLC program into the local PLC (run-time system 1) on your PC. Then start the Visual Basic program:

Unless you provide some other indication, a communication channel is created to your local PLC. If a different AdsAmsNetId and another port number are entered, you can create a connection to a different run-time system on another PC. The above-mentioned PLC program, however, must still be active on that other run-time system. It is also necessary that a remote computer, if selected, is entered into the TwinCAT System Control.

You can choose whether to read off the PLC variables by address (IndexGroup and IndexOffset) or by variable name. The same applies to writing new values. This is of no significance to the operator - it is just a matter of demonstrating the two possibilities.

The state of the PLC can be read off and altered in the upper right hand corner. A 5 corresponds to the RUN state, while a 6 corresponds to STOP.

Option Explicit

Public TcClientSync As TCSCRIPTLib.TcScriptSync
Public nAdsAmsPort As Integer
Public strAdsAmsNetId As String

Private Sub Form_Load()
Set TcClientSync = CreateObject("TcScript.TcScriptSync")
Call TcClientSync.ConnectTo("", 801)
End Sub

Private Sub Form_Terminate()
Set TcClientSync = Nothing
End Sub

Private Sub cmdConnect_Click()
nAdsAmsPort = CLng(txtAdsAmsPort.Text)
if (Len(txtAdsAmsNetId.Text) > 0) Then
strAdsAmsNetId = txtAdsAmsNetId.Text
Else
strAdsAmsNetId = ""
End If
Set TcClientSync = CreateObject("TcScript.TcScriptSync")
Call TcClientSync.ConnectTo(strAdsAmsNetId, nAdsAmsPort)
End Sub

Private Sub cmdRead_Click()
Dim VarBool As Variant
Dim VarInt8 As Byte
Dim VarInt16 As Integer
Dim VarInt32 As Long
Dim VarReal32 As Single
Dim VarReal64 As Double

VarBool = TcClientSync.ReadBool(&H4020, 0)
lblBoolean.Caption = VarBool

VarInt8 = TcClientSync.ReadInt8(&H4020, 2)
lblInt8.Caption = VarInt8

VarInt16 = TcClientSync.ReadInt16(&H4020, 4)
lblInt16.Caption = VarInt16

VarInt32 = TcClientSync.ReadInt32(&H4020, 6)
lblInt32.Caption = VarInt32

VarReal32 = TcClientSync.ReadReal32(&H4020, 10)
lblReal32.Caption = VarReal32

VarReal64 = TcClientSync.ReadReal64(&H4020, 14)
lblReal64.Caption = VarReal64
End Sub

Private Sub cmdReadByName_Click()
Dim VarBool As Variant
Dim VarInt8 As Byte
Dim VarInt16 As Integer
Dim VarInt32 As Long
Dim VarReal32 As Single
Dim VarReal64 As Double

VarBool = TcClientSync.ReadBoolVar(".PLCBoolVar")
lblBoolean.Caption = VarBool

VarInt8 = TcClientSync.ReadInt8Var(".PLCSIntVar")
lblInt8.Caption = VarInt8

VarInt16 = TcClientSync.ReadInt16Var(".PLCIntVar")
lblInt16.Caption = VarInt16

VarInt32 = TcClientSync.ReadInt32Var(".PLCDIntVar")
lblInt32.Caption = VarInt32

VarReal32 = TcClientSync.ReadReal32Var(".PLCRealVar")
lblReal32.Caption = VarReal32

VarReal64 = TcClientSync.ReadReal64Var(".PLCLRealVar")
lblReal64.Caption = VarReal64
End Sub

Private Sub cmdWrite_Click()
Dim VarBool As Boolean
Dim VarInt8 As Byte
Dim VarInt16 As Integer
Dim VarInt32 As Long
Dim VarReal32 As Single
Dim VarReal64 As Double

If (txtBoolean.Text <> "") Then
VarBool = CBool(txtBoolean.Text)
Call TcClientSync.WriteBool(&H4020,
0, VarBool)
txtBoolean.Text = VarBool
End If

If (txtInt8.Text <> "") Then
VarInt8 = CByte(txtInt8.Text)
Call
TcClientSync.WriteInt8(&H4020, 2, VarInt8)
txtInt8.Text = VarInt8
End If

If (txtInt16.Text <> "") Then
VarInt16 = CInt(txtInt16.Text)
Call
TcClientSync.WriteInt16(&H4020, 4, VarInt16)
txtInt16.Text = VarInt16
End If

If (txtInt32.Text <> "") Then
VarInt32 = CLng(txtInt32.Text)
Call
TcClientSync.WriteInt32(&H4020, 6, VarInt32)
txtInt32.Text = VarInt32
End If

If (txtReal32.Text <> "") Then
VarReal32 = CSng(txtReal32.Text)
Call
TcClientSync.WriteReal32(&H4020, 10, VarReal32)
txtReal32.Text = VarReal32
End If

If (txtReal64.Text <> "") Then
VarReal64 = CDbl(txtReal64.Text)
Call
TcClientSync.WriteReal64(&H4020, 14, VarReal64)
txtReal64.Text = VarReal64
End If
End Sub

Private Sub cmdWriteByName_Click()
Dim VarBool As Boolean
Dim VarInt8 As Byte
Dim VarInt16 As Integer
Dim VarInt32 As Long
Dim VarReal32 As Single
Dim VarReal64 As Double

If (txtBoolean.Text <> "") Then
VarBool = CBool(txtBoolean.Text)
Call
TcClientSync.WriteBoolVar(".PLCBoolVar", VarBool)
txtBoolean.Text = VarBool
End If

If (txtInt8.Text <> "") Then
VarInt8 = CByte(txtInt8.Text)
Call
TcClientSync.WriteInt8Var(".PLCSIntVar", VarInt8)
txtInt8.Text = VarInt8
End If

If (txtInt16.Text <> "") Then
VarInt16 = CInt(txtInt16.Text)
Call
TcClientSync.WriteInt16Var(".PLCIntVar", VarInt16)
txtInt16.Text = VarInt16
End If

If (txtInt32.Text <> "") Then
VarInt32 = CLng(txtInt32.Text)
Call
TcClientSync.WriteInt32Var(".PLCDIntVar", VarInt32)
txtInt32.Text = VarInt32
End If

If (txtReal32.Text <> "") Then
VarReal32 = CSng(txtReal32.Text)
Call
TcClientSync.WriteReal32Var(".PLCRealVar", VarReal32)
txtReal32.Text = VarReal32
End If

If (txtReal64.Text <> "") Then
VarReal64 = CDbl(txtReal64.Text)
Call
TcClientSync.WriteReal64Var(".PLCLRealVar", VarReal64)
txtReal64.Text = VarReal64
End If
End Sub

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

Unpack the example program 'Visual Basic'.


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 example uses either the Internet Information Server (IIS) or the Personal Web Server (PWS) from Microsoft.
The generation of an instance of TcScript.dll can most easily be carried out in global.asa. The instance that has been generated is valid for all ASP pages within the web application.

global.asa:

<OBJECT RUNAT="Server" SCOPE="Application" ID="TcPLC" PROGID="TcScript.TcScriptSync"> </OBJECT>
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart()
  Call TcPLC.ConnectTo("", 801)
End Sub

</SCRIPT>

Parameters can be appended to the URL of an ASP page. These parameters are separated from the URL by a '?', and take the form 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. The PLC variable is also read out if no parameters were passed to the ASP page.
Within the HTML region, the response object (which makes the ASP available) inserts the value of the VBScript variable intActual into the HTML code, and the code is then passed to the client. In other words, every time the ASP page is called (with or without parameters) the current value of the PLC variable is displayed in the Explorer.
Forms are used within HTML in order to accept input from the user. These entries are passed as parameters to a particular page. In our example, the same page (default.asp) is called again, with set being passed as the parameter (name of the input field), along with the corresponding value that was entered by the user. Since the page is being called again with the parameter set, the value following the set parameter is written into the PLC.

default.asp:

<%@ Language=VBScript %>
<%Option Explicit
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%>

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<form method="get" action="default.asp" name="tempSet">set: <input name="set" size="4" value="<% Response.Write intSet %>"></form>
actual: <% Response.Write intActual %>
</body>
</html>

Appearance 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 smart phones). TwinCAT is here exclusively accessed by web servers.

The HTML page sent to the client (Internet Explorer):

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<form method="get" action="default.asp" name="tempSet">set: <input name="set" size="4" value="100"></form>
actual: 100
</body>
</html>

Unpack the example program 'Active Server Pages'.


Active Server Pages for Windows CE

This example is a special form of example 3. Please familiarize yourself first with example 3 before you continue.

Windows CE can be used as a web server for ASP pages (by copying the needed files in the "WWW"-directory). The functionality of this web server is limited, because it is not able to handle the "global.asa" file. As a consequence it is (among others) not possible to set up global variables and objects; they have to be created every time a site is invoked. This can be archieved by instantiating it inside of the script (see below).

default.asp:

<%@ language=JScript %>
<%
   TcClient = new ActiveXObject("TcScript.TcScriptSync");
   TcClient.ConnectTo("", 801);

   var nIntSet = 0;
   var nIntActual = 0;
   var sSet = Request.QueryString("set");

   if ((sSet != null) && (sSet.length != 0))
   {
      var bSetIsNumber = true;

      for (var i = 0; ((i < sSet.length) && (bSetIsNumber == true)); i++)
      {
         var sChar = sSet.charAt(i);
         if (ValidChars.indexOf("0123456789.") == -1)
         {
            bSetIsNumber = false;
         }
      }

      if (bSetIsNumber == true)
      {
         nIntSet = parseInt(sSet);
         if(nIntSet >= 0)
         {
            TcClient.WriteVar(".PLCVarInt", nIntSet);
         }
      }
   }

   nIntActual = TcClient.ReadVar(".PLCVarInt");
%>

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <title>TwinCAT ADS-Script-DLL - Sample 04 - Windows CE</title>
   </head>

   <body>
      <h1>TwinCAT ADS-Script-DLL - Sample 04 - Active Server Pages for Windows CE</h1>
      <form method="get" action="default.asp" name="tempSet">
         set: <input name="set" size="4" value="<% Response.Write( nIntSet ); %>">
      </form>
      actual: <% Response.Write( nIntActual ); %>
   </body>
</html>

Appearance in Internet Explorer:

The HTML page sent to the client (Internet Explorer):

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <title>TwinCAT ADS-Script-DLL - Sample 04 - Windows CE</title>
   </head>

   <body>
      <h1>TwinCAT ADS-Script-DLL - Sample 04 - Active Server Pages for Windows CE</h1>
      <form method="get" action="Sample04.asp" name="tempSet">
         set: <input name="set" size="4" value="3">
      </form>
      actual: 3
   </body>
</html>

Unpack the example program 'Active Server Pages for Windows CE'.