1 Purpose This document describes how to set up a remote collaboration with a using an ewon as gateway. The remote collaboration will be set up for two network topologies: Figure 1: Network topologies The first topology uses a direct phone connection to access the ewon. In this case, the ewon IP address is known at connection time and is always the same. The second topology uses Internet to access the ewon. In this case, the ewon connects to the Internet with a callback. As the Internet side IP address assigned by the ISP changes at each connection, the ewon must be configured to publish its IP address right after it is connected to Internet. The link between the ewon and the PLC is achieved using an elink, which transports the MPI protocol over TCP/ IP. This document describes the consecutive steps of configuration starting from a PLC and an ewon just out of the box. 1.1 Elements The following elements are needful to follow this tutorial: An ewon with a firmware release supporting the NetMPI protocol (>= 3.5). The latest release is available for download at this address. A Siemens S7 PLC. The PLC used in this document has a 312C processor. A PC with modem for direct phone line connection to the ewon. An Internet connection, for both your PC and the ewon. An elink (MPI to Ethernet protocol converter) The elink_net driver for PC. Download it from here. The Simatic STEP 7 software to program the PLC. STEP 7 version 5.1 is used in the document. Using version 5.2 and latest Service Packs is even better. Windows XP is used in this document, but any 32 bits Windows Operating System supporting the STEP 7 software and the elink is suited. The use of Siemens S7-3xx or S7-4xx families of PLC corresponds exactly to this document. The use of Siemens S7-2xx family of PLC is also possible, provided you replace MPI by PPI in some profiles and you adapt the STEP 7 part described in this document to the microwin environment. Be sure the Siemens STEP 7 environment is configured with a PC Adapter (MPI) prior to install the elink_net driver: page 1 of 33
Available drivers in your Siemens software: When intalling the elink_net driver, pay attention to respect the old DOS 8.3 conventions (8 characters for folder or file names and 3 characters for file extensions, no space nor special characters). Otherwise the Siemens STEP 7 software might not be able to find the installed elink_net driver. page 2 of 33
2 Configuration Steps The set up of a complete remote collaboration will be explained using the following steps: The first three steps describe the common part of every type of connection, the two last ones describe the specific configurations. After each step, a test will be explained to check the step has been successfully achieved. 2.1 elink Configuration The first step is to configure the IP address of the elink. Figure 2: Configuration steps If it is not already done, download and install the elink_net driver page 3 of 33
Open elink_net Settings (start/programs/elinknet): Click on the elink Settings button: Figure 3: elink Network Settings Figure 4: elinks present in the local network page 4 of 33
Press Settings. Figure 5: elink Settings Set the IP Address to a free address on your network. In this case, 10.0.0.25 Set the Subnet mask to 255.255.255.0 Set the Gateway address to 0.0.0.0 Press Save permanently. A message appears asking you if the elink should be restarted. Answer Yes to restart it. You can check that the little led that is located on the elink frontside turns to red during about 5 seconds, then it turns back to green. page 5 of 33
The window elinks in the local network is now updated: You can test the IP setting by pinging the elink: Figure 6: Just setup elink in the local network Open a Command Prompt. Type ping <elink-address>, where <elink-address> is the IP address you have set to the elink (in our case: 10.0.0.25). You should get the same message as in the screenshot below: Figure 7: successful elink ping test page 6 of 33
If you have a Timeout message, then something went wrong in the configuration and you must restart the previous steps. You can try to unplug then plug again the elink from the PLC. Never forget that if you can give your elink an IP address that is different that you local subnet mask (for example you give the elink the address 62.10.23.25, and your local network is of type 10.0.0.xxx, then you will be able to see the newly configured elink in the elinks in the local network window, but you won t be able to ping it succesfully: Figure 8: unsuccessful elink ping test If that happens, you will have to redefine the elink to an address that is compatible with your local network. To do so, double-click on the elink you want to change in the elinks in the local network window. The following window then appears: Figure 9: Set IP address window First unplug your elink from the PLC, then plug it again Fill-in the field with an IP-Address that is compatible with your local network, then click on the Set button. page 7 of 33
If it takes more than a minute to you to set the IP address after you have plugged the elink again, or if you choose an address that already exists in your local network, then you will get the following error message: Figure 10: Set IP Address error message Choose a free compatible IP address and set it in the one minute time span, then click on Set, you will get the following message: Figure 11: Set IP Address successful message Then click on OK to come back to the elinks in the local network window. You are now able to successfully ping the elink The next step is to create a Station that will be common to the PLC and to the elink. page 8 of 33
2.2 Station configuration Come back to the elink Network settings dialog box, then click on New Station: Figure 12: Station parameters Enter the IP Address to the one you just configured for elink (10.0.0.25), set the Name to PLC, then OK. Note: If you want to connect a Siemens 200 series PLC (using the PPI protocol), you must then setup the Timeout in the Station dialog box, depending on the Communication Speed you have setup in the ELinKs Settings dialog box (9.6 kbit/s --> 18000 msec, 19.2 kbit/s --> 12000 msec, 187,5 kbit/s --> 6000 msec). Figure 13: The PLC Station Click on OK when coming back to the elink Network Settings dialog box. page 9 of 33
3 Test program In this section, we will set up a small test program. This program will be used later to test the ewon to PLC connection, as well as the remote monitoring itself. 3.1 PLC Connection Configuration We must first tell the software to use the elink to connect to the PLC. Open Simatic Manager Select Set PG/PC interface In the Options menu Select the elinknet(mpi) interface Click on Properties Figure 14: PG/PC Interface Set Station to "PLC" Click OK, then OK again to close the Set PG/PC interface dialog box. In the File menu, select New Enter Test in the Name field Change the storage path if necessary page 10 of 33
The following window appears: In the PLC menu, choose Upload Station. The following window appears: page 11 of 33
Click on the View button if no target station appears, you may then get the following result: The configuration is uploaded from the PLC to the PC. We can now see the structure of the PLC. Double-click SIMATIC 300(1) Figure 15: Select node address - Select target station page 12 of 33
You can see the CPU from your PLC, in our case it is a CPU 312C 3.2 Programming the Test Application The test program will consist of a single DB counter variable and a single block that will be executed once every second and will increment the counter. Double-click the CPU Double-click S7 Program(1) Right-click Blocks (in the left panel) Figure 16: PLC Structure page 13 of 33
Select Data Block in the Insert New Object menu Enter DB1 in the Name field and select Shared DB in the scrolling list next to it Press OK The DB1 data block is added to the project. Figure 17: Data Block Creation Double-click DB1 Figure 18: Project with DB1 Data Bloc page 14 of 33
Create the variable as shown below: Table 1: Variable creation Save and Exit the window We will now create the program run every second. Right-click Blocks Select Organisation Block from the Insert New Object menu: Set the name to OB35 Select STL in the Created in Language scrolling list Press OK The DB35 Organization block is added to the project Figure 19: Organization Block Creation page 15 of 33
Double-click OB35 Figure 20: OB35 program Enter Increment Counter for Network 1 Write the program as follows: L DB1.DBW 0 L 1 +I T DB1.DBW 0 Save and Quit To check the program, we will create a variable table to monitor DB1.DBW Right-click Blocks Select Variable Table in the Insert New Object menu page 16 of 33
Double-click VAT_1 Figure 21: Variable Table Press OK Double-click VAT_1 Enter DB1.DBW0 in the Address field Enter DEC in the Display field Save and Quit We will now download the application to the PLC Click on Blocks Click on Download in the toolbar Figure 22: Table Variable Entry page 17 of 33
We can now monitor the counter Double-click VAR_1 Click on the Monitor Variable button (that represent a pair of glasses) in the toolbar: Figure 23: Monitor Variable You should see the counter value incrementing every second. page 18 of 33
4 ewon Configuration 4.1 ewon IP address configuration In this section, we will show how to configure the ewon to access the PLC registers through an IO server configuration. The forwarding will be treated later. Setting the ewon IP Address The ewon is configured through its web server*. Right out of the box, the ewon has 10.0.0.53 as IP address. You can find the ebuddy utility on the ewon web site (http://www.ewon.biz (Support/Download Software)). This utility allows to find an ewon on the network and to change its IP address to match your LAN IP adresses range. * It is also possible to configure the ewon by dropping into it a file using an FTP client, but this is a more complex process that is explained in the ewon User Guide. Finding an ewon on the network with ebuddy Launch ebuddy.exe and click CTRL+L to switch in list mode if not the case. The list of the ewons that are connected on the network then appears: Setting the IP address from an ewon If the ewon you want to set the IP address is in the list, just right-click on it, and select Set IP Address in the contextual menu (if the ewon is not in the list, then right-click in the blank area under the list): page 19 of 33
Enter the ewon serial number in the Serial Number field if not yet done, or click on the Browse button. In this case, the dialog box below then displays: Select the ewon of which IP address you want to modify and click OK. You then come back to the previous wizard page, in which you must then enter the Username and Password fields that are required to connect to the ewon: page 20 of 33
Then click on Next and set the IP Address and Subnet Mask: Then click on Next again to launch the update and wait for the ewon to reboot: When done, click on Finish to exit from the IP Address Wizard. Now your ewon should appear in the ebuddy list with the new informations you have entered. Testing the ewon IP Address page 21 of 33
To test that the IP address has been assigned successfully, open a command prompt and ping the ewon. Open a DOS command prompt and enter ping <address> where <address> must be replaced by the newly assigned address. If the address has been correctly assigned, you should see the Ethernet led of the ewon blinking and the following screen: Figure 24: Pinging the ewon If, instead of a response time, you get a request timeout message, there is a problem and the steps must be reviewed. page 22 of 33
4.2 ewon Web Site We have assigned an IP address to the ewon so we can reach its HTTP server to configure it. Open a Web browser and type the address you assigned to the ewon in the address bar (10.0.0.24 in that case). The following login page appears: Figure 25: ewon login page A preconfigured adm user exists to allow the first configuration*. User name adm Password adm Click on Enter The following page appears: Figure 26: ewon main page * The default password of the adm login MUST be changed for obvious security reason. Refer to the user manual for explanation of how to change a user password. page 23 of 33
4.3 NetMPI Configuration Now that we have access to the website, we will configure the ewon to connect to a NETMPI network. The ewon embeds what is called IO Servers. Those servers are responsible of collecting the data on the network and make them available for further usage. Once the ewon can interact with the PLC, the variables of the PLC will be available as Tags. The IO servers are configured by accessing a specific web page that you can reach by clicking on the link IO Server Config from the ewon navigation bar. The following web page appears: Select NetMPI in the IO Server drop down box. After selecting the NetMPI server, the following page appears: Figure 27: NetMPI IO Server Configuration page 24 of 33
As the ewon dialogs with the PLC by mean of an Ethernet link with the elink, nothing special must be done for the link itself. Therefore, the NetMPI configuration only consists in setting the polling rate, which is done using topics*. * Topics are also used to set a common MPI address and IP address for several tags, but this will not be used in this tutorial. Please refer to the ewon User Manual for more information about topics. Check the Enabled check box for Topic A Set the Poll Rate to 1000 Click on Update Config A message tells you the configuration has been updated. 4.4 Setting up a Tag The ewon uses Tags* to monitor PLC registers (or bits of registers). Tags are the equivalent of entries of the Variable Table from the Simatic software. To check if the NetMPI connection is set up successfully, we will create a Tag to read the value of the counter. Select Tag Setup in the ewon navigation bar. The following page appears: Click on Create New Tag Figure 28: Tag Setup Main page A page appears to configure the new tag. The only sections of interest here are the Tag name and I/O Server Setup. Figure 29: DB1W0 Tag Setup *More information about Tags can be found in the ewon User Manual. page 25 of 33
Set the Tag name to DB1W0 Set the Description to Test Counter Set the Server Name to NetMPI Set the Topic Name to A Set the Address to DB1W0,2,<eLink Address> where <elink Address> is the address you assigned to the elink (10.0.0.25 here) Click on Add/Update Only Now, we will check the value of the Tag: Main Menu View I/O You should see the value of the Tag as follows: Click on Update several times at about one second of interval, you will see the counter value increasing. page 26 of 33
5 Direct Phone Line Connection Two more setups are required to configure a remote access to the S7 PLC through a direct phone connection to the ewon: the ewon must be configured to pick up the phone and act as a PPP server the address of the Remote host must be changed in the elink 5.1 ewon Configuration The dialup and PPP setup is done by mean of another web page. Select Configuration/System Setup/Communication from the View I/O page Select Dial Up (PPP) The Dial Up (PPP) setup page appears. So far, we are only interested into the Global Dialup and the Incoming Calls Config parts (the next ones will be treated later). Figure 30: Dial Up (PPP) configuration Set the Call direction allowed to Incoming and Outgoing Set the ewon PPP server IP address to 202.0.0.240 Set the ewon PPP server IP mask to 255.255.255.0 Let the ewon PPP server gateway to 0.0.0.0 Set the ewon PPP client allocated IP address to 202.0.0.1 Click on Update Dialup Setup Check that Enable IP forwarding is checked in the Router (Filter) configuration page page 27 of 33
5.2 elink_net driver configuration The Remote host address must be changed in the elinknet driver. Indeed, the remote host is now the ewon. The elink must be configured to use the ewon as a gateway, since the address of the PC running the Simatic software is unknown for the elink. Open the elink Network Settings application Press elink settings Press Settings Set the Gateway to the IP address of the ewon (10.0.0.24 here) Click on Save Permanently (the station address should not change, it's always the elink IP address) Important!: Problems may occur in case the IP range address is the same for the PC and the remote ewon and elink addresses (e.g.: it could not be 10.0.0.XX on both sides) A message asks if the elink should be restarted. Answer Yes. Click on OK to close the elink settings application. 5.3 Starting the Remote Access to the ewon 5.3.1 Testing the phone connection Configure a PC modem to call the ewon, the user name is adm, the password is also adm. Call the ewon Wait a short moment for the number to be dialed and the modems to interact When the connection is active, open a command prompt You are now able to ping the ewon at IP address 202.0.0.240 The PLC is now accessible as if you were directly connected to it, because ewon will forward any IP packet you will send to it towards the remote PLC. page 28 of 33
6 Internet Connection The principle of a remote collaboration through Internet consists in telling to the ewon to connect to Internet and publish its IP address, configure the elink with that IP address as its gateway, and use Simatic as if the elink and the remote S7 PLC were on the LAN. To tell the ewon to connect to Internet, we will use the callback mechanism. This mechanism consists in calling the ewon by means of a phone, making ring a certain amount of times (that you can define in the ewon ComSetup page), then hanging up. The ewon will now connect to the Internet to reach the ISP you have previously defined in the Outgoing Calls Config section from the Dial Up (PPP) ewon configuration page. Publishing the PPP IP address can be done by sending an email. The ewon has a built in facility for this. To configure a remote collaboration through Internet, we need to configure: the callback mechanism the IP address publishing Before starting the remote collaboration, we need to: call the ewon and let ring few times check the email to know the ewon public IP address configure the elink to set the Remote Host address to the one published by the ewon 6.1 Callback and IP Publishing The callback is fisrt configured in the Dial up (PPP) web page we have seen earlier and then in the dedicated Callback page. The sections of interest are the Global Dialup Config and Outgoing Calls Config parts. Set the Call direction allowed to Incoming and Outgoing Set the Server Phone Number, User Name and Password as instructed by your ISP Click on Update Dialup Setup A message tells the configuration has been updated. Figure 31: Dial Up outgoing configuration page 29 of 33
Now open the Callback configuration page. Check the Enabled check-box Check the Callback on RING radio-button Set the Publish IP address EMail to Your own email address, then Click on Update Callback Setup Figure 32: Callback configuration A SMTP server has to be configued in order for the ewon to send an Email. This is done in the Main/General ewon s configuration page: Enter the STMP Server Address (can be an URL or an IP address) Enter the SMTP Server Port Enter the From address, compatible with your ISP (for example: user@provider.net) Click on Update Config (a message appears telling your configuration has been saved successfully) page 30 of 33
Now enable the Enable Transparent forwarding function in the Router setup: Click on the Update Router Setup button. A message tells the configuration has been updated. 6.1.1 Callback Testing Take a standard phone and call the ewon Let the phone ring four times (See Callback configuration on page 30. above), then hang up Wait for the ewon to connect to the ISP and to get its IP address. (This can take a moment) Check your email You should have received an Email like the one below: Figure 33: Router Configuration Figure 34: Address publishing email page 31 of 33
You can test this address by clicking on the http link, or opening a browser and typing the address. You should see the ewon login web page appearing: Figure 35: Setting Transparent Forwarding to elink IP Address page 32 of 33
6.2 Starting the Remote Monitoring Call the ewon as just described in the previous section Open the elink_net and elink Configuration software Press elink settings Select the PLC station Press Change Station Figure 36: elink Station for Internet Set the IP address to the one published by the ewon Click on OK Click on OK again Start the Simatic software You should see the value of the counter incrementing. You can now transfer the upload the PLC configuration, change the application, monitor variables exactly as you would do with a direct Ethernet connection. page 33 of 33