Setting up an S7 connection using TCP/IP
The TCP/IP method of communication to the S7-300 and S7-400 PLC's via TCP/IP communication module uses the S7WIN, S7WINSP, S7NT, or S7NTSP protocol.
Software requirements
- Siemens SIMATIC NET software v6.1 SOFTNET-S7 Industrial Ethernet
- IFIXSCADA v5.x or above
- Windows XP + SP1
Hardware requirements
- Standard network card
- S7-300 with CPU315-2 DP
- Siemens power supply PS30/5A
- Siemens CP343-1 TCP
The hardware modules occupy the following slots in the Siemens PLC:
- Siemens power supply
- S7-300 CPU 315-2 DP
- Ethernet CP343-1 TCP
Example configuration
All wiring should be installed according to Siemens documentation.
Installing the SIMATIC NET software
You must log in as an Administrator to install the SIMATIC NET software. Close all other running applications, including any antivirus software you may be running.
- On the SIMATIC NET flash screen, start the installation by clicking Install SIMATIC NET Software.
- The PC configuration screen appears. Click Next.
- Select the English language option, then click Next. Click Next again.
- Click yes to the licensing agreement screen.
- Enter your Name and Company on the User Registration screen.
- If you already have SIMATIC NET software installed, this will be the drive selected by default. Clear the Run automatic authorization option, and then click next. The Setup: Configuration screen appears.
- Select all application options to be installed. (This is necessary if you do not already have STEP7 installed on your machine. If STEP7 v5.2 or higher is already installed, you do not have to select the NCM PC/S7 v5.2 application.) Click Next.
- The applications you selected are installed. At the prompt, click OK to restart your system. The system restarts and installs the selected applications. Click Finish to restart your system again.
The SIMATIC NET software is now installed.
Configuring the SIMATIC NET software
This step involves using the Commissioning Wizard to configure the software you installed in the previous step.
Configuring the module
When your system restarts after the software has been installed, your system's hardware configuration is scanned. The Commissioning Wizard appears automatically. (You can also access the Commissioning Wizard at Start/Simatic/SIMATIC NET/Settings/Commissioning Wizard.)
The number of steps required depends on the number of PC Ethernet cards (or modules) detected in your PC. The more modules you operate in the computer, the more steps are required.
- Click Next.
An Ethernet Network Card with with the IP addresses settings shown above was found. This is the network card that will be configured for communication with the Siemens PLC. This is put on index 5.
Note: The index of the network card can be set with the NCM PC Configuration (hardware configuration). The station index defaults to 5 if you use the Commissioning Wizard. - Select the Use the module for productive operation in configured PC station option, and then click next.
- Clear the SIMATIC NET OPC Server in configured PC Station option and select the Configure more applications option. Then click next.
- Register the names for your user application: enter VFD1 in the Name text box. This user application is put on index 1. Click Next.
Note: The name of the application is the VFD name. This comes later in the IFIX Project Editor under Communication | Ports in the Special options text box. - Click Next. This screen appears, confirming you have completed configuring the module:
- The configuration is saved and the PC station is reconfigured. Your existing configuration data is overwritten. Click OK to confirm at the prompt.
This completes the module configuration.
Configuring the project with the PC Station Wizard
The next step to configure the project using the PC Station Wizard.
- Start the PC Station Wizard.
- Choose Create a new project and configuration. A new project is created. Click Next.
- Define a new Project name; this example uses IFIXS7. Specify where the copy of the local PC station settings resides, and then click Next.
- Select the Edit network and connection configuration option, and then click Finish. NetPro automatically starts, displaying the network configuration.
- Click the Application box in the PC station, and then choose Insert | New Connection. The Insert New Connection dialog box appears.
- Choose the Unspecified item in the tree. From the Type menu in the Connection area, choose S7 connection. Then click Apply, and then click OK.
- In the Properties -S7-Connection dialog box, the local IP Address should be the address of the Ethernet card in the PC. This example uses 192.168.0.190. The partner IP Address should be that of the Ethernet CP343 module in the PLC, in this case 192.168.0.148. The Local ID is the connection identifier of this connection (here it is S7-Connection_1). It will be used later on as the address of the IFIX I/O device. Click Address Details.
Note: The Local ID S7-Connection_1 is used later in the IFIX Project Editor under Communication | I/O Devices in the I/O Device Address text box. This name is case-sensitive and cannot not contain any spaces. - In the Address Details dialog box, enter the card location of the CPU that the SIMATIC S7 communicates with. Here the card location is 2. Click OK.
Note: Some power supplies might occupy 2 slots. If so, the card location of the CPU is one higher at 3. - In the NetPro window the new S7-Connection_1 connection appears. Choose Network | Save and Compile. The Save and Compile dialog box appears.
- Select the Compile and check everything option, and then click OK.
- After completing the save and compile operation, a message appears in the NetPro window. This indicates the warnings and errors present in the configuration. If warnings occur here, then this is to be handled as information only. But if errors occur, the project configuration cannot be loaded. To view errors, choose View |Outputs.
- Highlight by clicking on the PC Station (TESTXP). Afterwards the connection table disappears in the message window. From the NetPro menu choose PLC | Download | Selected Stations to transfer the project configuration to the PC. Alternatively, right-click the PC Station and choose Download | Selected Stations.
- To confirm the overwrite of configuration data and to proceed with the download, click Yes.
- To confirm stopping the Target Module (Network interface Card), click OK.
- The configuration should now be successfully loaded. Exit NetPro and click next, and next again to finish the Commissioning Wizard. If you have errors, see for details.
Defining an access point for the application
The next step is to define an access point for the application.
- The Configuration Console should appear after terminating the Commissioning Wizard. If it doesn't, open the Configuration Console by selecting START / SIMATIC / Simatic Net / Settings / Configuration Console.
- In the Configuration Console dialog box, right-click the Access Point object, and choose New | New access point.
Note: You can choose any name for the Access point, but it cannot contain spaces and be longer than 32 characters. - In the New access point dialog box, enter your access point name (this example uses IFIXS7). Select the hardware component that will be associated with this access point (TCP/IP -> ASUSTeK/Broadcom 440x in the example).
Note: The access point name is used later in IFIXSCADA in the Project Editor under Communication | Boards in the Special Options text box. The access point name is case-sensitive.
After creating the access point the Configuration Console should look like this: - Close the Configuration Console.
This completes the Simatic NET software configuration.
Configuring the S7 driver
The IFIX S7 driver needs three names (settings) from the SIMATIC NET software
configuration. The following points are needed:
SIMATIC NET | Configuration example | IFIX Info |
Access point of the application | IFIXS7 | Boards, Special options Field |
VFD/Application Name | VFD1 | Ports, Special options Field |
Name of the connection (or Local ID) | S7-Connection_1 | IODevices, Address Field |
Using the Express Wizard
You use the Express Wizard to configure your communications.
- In IFIX Explorer, create a new (empty) test project.
- In the IFIXSCADA Project Editor, choose Communication | Express Wizard.
- In the wizard:
- Create a new I/O Servers e.g. IOServer.
- Create a new I/O Device e.g. IODev.
- Select external as the type of the I/O Device (PLC): Select the Siemens | S7-300 or S7-400| TCPIP using NE2000 network CARD for Windows NT for NT/W2K/XP/2003, or the TCPIP using NE2000 network CARD for Windows 95/98 for 95/98/ME option.
- Define the name of the connection. In this example it is S7-Connection_1.
Note: Do not select the Link I/O Device to an external tag Database option.
This completes this section.
Setting the Access Point
The next step in the process is to set the access point of the application.
- Open the Boards dialog box by choosing Communication | Boards.
- In the Special Opt text box, enter the access point of the application. This example uses IFIXS7.
Setting the VFD name
The next step is to set the VFD name.
- Open the Ports dialog box by choosing Communication | Ports.
- In the Special Opt text box enter the VFD Name. In this case VFD1.
Checking the name of the S7 connection
The next step is to check the name of the S7 connection.
- Open the I/O Device dialog box by choosing Communication | I/O Devices.
- In the Address field enter the name of the connection to the PLC. This example uses S7-Connection_1.
Variable declaration
The next step is to declare the variables.
- Open the Tags Form by choosing Tags | Variable Tags.
- Create a variable with the following information:
- Variable Tag Name: TestInteger
- I/O Device Name: IODev
- Type: INT
- Address: DB190,0
Troubleshooting your S7 connection
Question: I receive the following error message when downloading the PC station in the SIMATIC NCM PC manager:
- "The module "station manager" cannot be contacted. Change the on-line interface."
- "For On-line connections via the PC internal interface a station name must be assigned in the component configurator. This name must be identical to the name of the PC station, as configured in the STEP7 (or Simatic Net) project."
- "Online: No connection could be made. The participant does not announce itself."
Solution
- Check in SIMATIC NCM PC Manager under the Menu option Options | Set PG/PC Interface, whether the point of entrance S7ONLINE is linked with the PC internal (local) interface.
- The Station Configuration Editor tells you whether your module is Online. You can start the Station Configuration Editor by double-clicking the icon. This should not be OFFLINE, so to change its mode of operation, click Change Mode. The mode of operation should now change to ONLINE.
- Check the station name in the Station Configuration Editor. This must match with the name in SIMATIC NCM PC Manager. You can change the station name in the Station Configuration Editor by clicking Station Name.
- Open the Station Configuration Editor and the SIMATIC NCM PC Manager. Check the order and the number of configured components and the indexes that are used. These should match.
0 Comments:
Post a Comment