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.


Remote Diagnostic

Remote Access

Setting possibilities in the registry and TwinCAT PLC Control.ini

The settings for data transmission via remote access are made in the registry and in the TwinCAT PLC Control.ini file.

In the case of analogue modem connections with low transmission rates or poor cable quality, it may be useful to reduce the size of the data blocks to be transmitted.

If it is intended to transmit a PLC project from the TwinCAT PLC Control to the controller per ADS via the modem connection, the size of the data blocks can be changed by means of the following settings:

Registry

MaxBlockSize
HKEY_LOCAL_MACHINE\SOFTWARE\BECKHOFF\TwinCAT\Plc MaxBlockSize (DWORD)

By default the size of the packet is assumed to be 16 KB (even if there is no key in the registry). The smallest block size is 512 bytes.

This means that large PLC projects to be loaded are subdivided into blocks.

Smaller block sizes should be configured if the connection is slow.

ConnectionTimeoutMSec
HKEY_LOCAL_MACHINE\SOFTWARE\BECKHOFF\TwinCAT\Plc ConnectionTimeoutMSec (DWORD)

The default value is decimal 8000 (= 8 seconds)

This value should be increased if the connection is slow.

TwinCAT PLC Control.ini

The file "TwinCAT PLC Control.ini" exists in the directory "..\TwinCAT\PLC"

[TwinCAT PLC Control]

FileTransferBlockSize=16384

The default value (even if there is no key in the INI file) is 1024; 16K is usually set in the case of a CX9000 in order to minimise the number of blocks.


Preventive notes

Besides the correct configuration settings and optimisations for reducing the size of the data blocks (BlockSize), the operator should pay attention to the following ‘preventive notes’ in order to ensure successful communication:

  • Avoid parallel communications
    Example:
    If it is intended to load a PLC project to a controller via a modem connection, parallel data communications such as RemoteDisplay or a logged-on System Manager should first be terminated (RemoteDisplay) or logged off (System Manager)
  • Set the host for parallel working to off
    Example:
    In some cases it should generally be refrained from performing additional work on the host PC.


Reference list

Below is a list of modems that have been successfully tested with the controller.

Modem | Firmware | Comment
USRobotics 56K Faxmodem | (1.0USR00E8\\Modem\PNPC107\U.S. Robotics 56K FAX EXT)FF | The USRobotics 56K Faxmodem is not equivalent to the USRobotics 56K Faxmodem USB.
westermo TD-33 | 4100-7303 | Error 678 in the case of an outgoing connection
westermo TDW-33 | 4101-0614 | Error 721 in the case of an incoming connection to the modem. However, this can be circumvented by counter-dialling.
westermo TDW-33 | 4101-06OA | -


Counter-dialling

In some cases it may be helpful to dial oneself out from the target system first, before dialling in to the station from outside. This procedure is known as counter-dialling.

Situations in which counter-dialling is useful:

1. Although the communication parameters have been set up correctly, dialling in from outside by modem cannot take place; the modem cannot establish a connection with the controller.

2. If, for example, the serial cable between the modem and the controller is unplugged and plugged in again during running operation, a connection is not automatically established between the modem and the controller since the interface is, so to speak, still occupied.


Setting up an incoming analogue modem connection under Windows XP

This article is concerned with the setting up of a Windows XP system for an incoming data modem connection.

Hardware required:

- analogue modem
- analogue telephone line
- Windows XP system

Preparation:

Connect your modem to the telephone line and to the Windows XP system. Then install the modem on the Windows XP system.

To set up the connection:

New connection:
Proceed via ‘Start -> Connect to -> Show all connections -> Create a new connection’. The ‘New Connection Wizard’ starts.
On the ‘Network Connection Type’ page, select the following: ‘Set up an advanced connection’.

The ‘Advanced Connection Options’ page opens. Select the connection type ‘Accept incoming connections’ here. Incoming connections will be accepted if this connection type is selected.

Next, the devices are selected with which the connection should be established. Select the modem that you have connected. It is also possible to select several devices.

If you wish to also permit VPN connections, this must be selected on the next page. This setting is not required for a simple data modem connection.

In order to prevent third parties from accessing your system, authorised users must be selected.

Nothing needs to be changed on the next page.

Exit the wizard via ‘Finish’.

Connect:

It is now possible for another system to dial in to your Windows XP system.


Setting up an outgoing analogue modem connection under Windows XP

This article is concerned with the setting up of a Windows XP system for an outgoing data modem connection.

Hardware required:

- analogue modem
- analogue telephone line
- Windows XP system

Preparation:

Connect your modem to the telephone line and to the Windows XP system. Then install the modem on the Windows XP system.

To set up the connection:

New connection:
Proceed via ‘Start -> Connect to -> Show all connections -> Create a new connection’. The ‘New Connection Wizard’ starts. On the ‘Network Connection Type’ page, select the following: ‘Connect to the network at my workplace’.

The ‘Network Connection’ page opens. Select ‘Dial-Up Connection’ for a modem connection.

On the ‘Connection Name’ page you can choose whatever name you like for the connection.

Finally it only remains to specify the telephone number with which the connection should be established.

Continue via ‘Next’ and exit the wizard via ‘Finish’.

Connect:
In order to connect, you now need only double-click on the connection that you have just set up. A window opens, in which you now enter the user name and password for the other end to which you wish to dial in.

The connection can now be established via ‘Connect’, provided that the other end is also ready for a connection.


Setting up an incoming analogue modem connection under CE

This article is concerned with the setting up of a CE system for an incoming data modem connection.

Hardware required:

- analogue modem
- analogue telephone line
- Windows CE system

Preparation:

Connect your modem to the telephone line and to the Windows CE system.

To set up the Windows CE system:

RAS Server:
Proceed via 'Start -> Settings -> Control Panel -> Configuration -> Ras Control' and select 'Enable RAS Server'. In ‘Line Settings’, enable/activate ‘Hayes Compatible on Com 1’. Only one item may be enabled at any one time.
Furthermore an additional user must be added. To do this, select ‘Add User’ in ‘User Settings’ and specify the user.

Exit ‘Configurations’ via ‘ok’. The Windows CE system is now fully set up for an incoming connection.

Note:
With some modems, or in the case of modems with a particular firmware, a connection still cannot be established. In this case please refer to the modem reference list and the page regarding

Counter-dialling.


Setting up an outgoing analogue modem connection under CE

This article is concerned with the setting up of a CE system for an outgoing data modem connection.

Hardware required:

- analogue modem
- analogue telephone line
- Windows CE system

Preparation:

Connect your modem to the telephone line and to the Windows CE system.

To set up the Windows CE system:

New connection:
Proceed via ‘Start -> Settings -> Control Panel -> Make a new connection’. There, select ‘Dial-Up Connection’ and, if need be, give the connection a name of your own choice.

Go to ‘Next -> Configure…’ in order to set the Baud rate.

Exit the window via ‘ok’ and continue via ‘Next’. Now only the telephone number is missing.

The new connection has now been set up and you can exit the menu via ‘Finish’.

Connect:
In order to connect, you now need only double-click on the connection that you have just set up. A window opens, in which you now enter the user name and password for the other end to which you wish to dial in.

If the exact telephone number that you entered appears at the right, you can now connect via ‘Connect’. Please note that the other end also needs to be set up for this.

Set up the ‘Dial Properties’ if the number does not exactly match your entry. To do this, adapt the ‘Dialling patterns’.

The Windows CE system is now fully set up for an outgoing data modem connection.


Remote maintenance

This article is concerned with the setting up of a Windows CE system, to which a GSM modem is connected, for a data modem connection.

Hardware required:

- GSM modem
- SIM card
- Windows CE System

Preparation:

Insert the SIM card in the GSM modem. Connect the GSM modem to the Windows CE system. Then switch on the power supply to both devices.

To set up the Windows CE system and the GSM modem:

1. RAS Server:
Proceed via 'Start -> Settings -> Control Panel -> Configuration -> Ras Control' and select 'Enable RAS Server'. In ‘Line Settings’, activate/enable ‘Hayes Compatible on Com 1’. Only one item may be enabled at any one time.

Add another user under ‘User Settings’ -> ‘Add User’. It is not necessary to specify a domain.

Exit 'Configurations' via 'ok' and return to 'Control Panel', from where you now access 'Network and Dial-up Connections'.

2. New connection:
There, select 'Make a new connection'. You can give the connection a name of your own choice or retain the suggested name. It is important to select the type ‘Dial-up Connection’.

Go to ‘Next -> Configure…’ in order to set the Baud rate to 9600.

Exit the window via ‘ok’ and continue via ‘Next’. All that remains now is to specify the dial number, which does not yet exist.

Exit this window by clicking ‘Finish’. After that, also close the ‘Network and Dial-Up Connections’ window.

3. AUTOEXEC:
The connection set up in item 2 serves to open the port. This item is concerned with carrying this out at every restart.

Open ‘NotepadCE’ via ‘Start -> Programs -> Windows Explorer -> Hard Disk -> System’ in order to edit the file ‘Autoexec.cmd’, which is to be found under ‘Hard Disk -> System’. The name of the file may be slightly different. If this is the case, you will need to rename it later to autoexec.cmd. Before that, open the file in Notepad and insert the line ‘start cxstartras ‘My Connection’ qwert 1’. ‘My Connection’ is the dial-up connection that you have just set up. If your connection has a different name, insert that at this place. ‘qwert’ is the user that you have just added and ‘1’ is the associated password. Adapt these points too.

After saving the changes, please do not forget to rename the file to AUTOEXEC.CMD, if that is not already its name.

Now reboot the Windows CE system.


Remote maintenance

This article is concerned with the setup of an MDA for creating a data modem connection for dialing in from an MDA to a GSM modem.

Hardware required:

- MDA with Windows Mobile 5

To set up the MDA:

Proceed via the menu ‘Settings -> Connections -> Connections -> Administration of existing connections -> Modem -> New’. First of all you must enter a name for the connection (‘My Connection’) and select ‘Mobile telephone connection’ as the modem.

On the next page, enter the dial number of the SIM card that is inserted in the GSM modem. Ideally you should also enter the country dialling code, although this is not compulsory.

The user name and password that you have set up on the CX now need to be entered. If you have also set up a domain, this also needs to be entered.

All settings have now been made. You can end the connection setup via ‘Finish’.

Test:

For test purposes you now need to set up the GSM modem to which you want to dial in and the system connected to it.

Sample with TcAdsWebService:

In order to test the connection, please put these files in the ‘www’ folder on your CX. In the HTML file, change the URL of the TcAdsWebService.dll and the NetId. The JavaScript file remains unchanged.

Please create this boot project on the CX. Test the HTML file on your CX. If there is no error, take your MDA once again. Connect yourself to the GSM modem. To do this, select ‘Settings -> Connections -> Connections -> Administration of existing connections -> Modem’. Press and hold your connection (‘My Connection’) and select ‘Connect’.

Switch to Internet Explorer, where you can now enter the URL of the HTML page and click on refresh.

It may take a moment until the connection is established and the page is found and loaded. Once the page has been constructed, it can similarly take a while until the values are displayed.

Note:

If a connection exists but nothing is displayed in Explorer, this means that the MDA has timed out. The timeout can be changed, for example using the ’Ping’ function of the freeware program vxUtil.

Note:

If the HTML page is displayed in Explorer but no values, even after a longer waiting time, please increase the refresh time in the HTML page.

Sample with Opc Server:

If you have installed Opc Server on your CX, you can also use this sample. Here you also need to change the URL, which in this case is that of the OPC server.

The problems and their rectification are identical to those in the previous sample. It may therefore also be necessary to change the refresh time or (also) the MDA timeout (see note).

Download:

TcAdsWebService-Sample
 TcOpcWebService-Sample


VPN

VPN (Virtual Private Network)

Windows CE-System

VPN connections Windows CE system
Via a router to several Windows CE systems
Windows CE system access with an upstream NAT router


VPN Windows CE-System

There are two possibilities to create a VPN connection when using a Windows CE system. For both connections a router is required as a VPN server and the Windows CE systems are VPN clients. It is not possible to set up the VPN server on a Windows CE system.

VPN connections Windows CE system
Via a router to several Windows CE systems
Windows CE system access with an upstream NAT router


VPN - Automatischer Verbindungsaufbau (CE)

VPN - Automatic Link Connection (CE)

Follow these instructions, if you want your Windows CE - PC to connect automatically with a VPN (virtual private network) after booting:

Install a VPN Dialup access

Here you find detailed informations to install a VPN Dialup access under Windows CE.

Install Autostart

  1. open the Beckhoff Startup Manager under Windows CE6

    Note: Under Windows CE5 the Startup Manager is not available. Here you find informations to install autostart under Windows CE5.

  2. click on the button "New" and create a new autostart item

  3. enter a name
  4. select as "Type: Shell Command"
  5. optional you can enter a description
  6. click OK.
  7. activate autostart

  8. click on the tab "Shell Command"

  9. enter as "Shell Command" the path to the Beckhoff Tool "CxStartRas" (standard: \Hard Disk\System\CxStartRas.exe)

    Parameters are:

    • the name of the VPN-connection

    • the Username

    • the password

    separated with blanks

  10. Note: On "Start/Control Panel/Network and Dial.up Connections" you can check the parameters.

    You can test the connection with a click on "Start" and customize it with a click on "Configure".

  11. when configuration is ready, save the autostart-settings and click on "Exit"

You have installed an automatic VPN connection. At the next booting the operation system tries to build up the connection automatically.

Note: To cut the VPN connection execute the file "CxStartRas.exe" in the command line with the parameters "name of the VPN-connection" and "/disconnect".


VPN - CE system access with upstream NAT router

If a router with NAT function is used in the network in which the Windows CE system is situated, port forwarding must be configured on the router for external access to the controller.

Structure

External queries to the router will be interpreted by the router and relayed to an internal host (the Windows CE system) in accordance with a configured port forwarding. In a port forwarding, an internal host is made externally available via a certain port.

In the case of our Windows CE system, for example, the following ports could be forwarded:

TwinCAT tcp/48898
CerHost tcp/987

For example:
An internal Windows CE system with the IP address 192.168.2.1 should be accessible through the Internet via Cerhost.
To do this, a port forwarding is configured on the router that maps TCP Port 987 to the internal IP address 192.168.2.1.

Setting up the Windows CE system

No settings need to be made in the Windows CE system. A connection just needs to be made to the router and the router used as a gateway.

Setting up the router

The router setup depends on the brand and type. Please refer to your router’s documentation regarding this point.

Connection to CE system

The external IP address of the NAT router must be used to connect TwinCAT or CerHost to the plc.


VPN - via a router to several Windows CE systems

For this connection a router is required that will function as a VPN server.

The creation of this connection is therefore dependent on the router.

We recommend the use of a router that supports the IPSec protocol.

Structure

The router is configured as a VPN gateway. As a result, VPN queries will be authenticated at its external interface. If login is successful, a connection (VPN tunnel) is established at its internal interface, at which the Windows CE systems are available.

Setting up the Windows CE system

No settings need to be made in the Windows CE system. A connection just needs to be made to the router and the router used as a gateway.

Setting up the router

The router setup depends on the brand and type. Please refer to your router’s documentation regarding this point.

Dialling in

Special software is required for dialling in. Some manufacturers require their own software for the establishment of a connection (e.g. Safenet, Cisco VPN client etc.). Please refer to the manufacturer’s documention regarding this point also.