EPICS using SLS s7plc driver



Similar documents
The goal is to program the PLC and HMI to count with the following behaviors:

TECHNICAL NOTE TNOI34

Service & Support. How can you establish a connection between an S PLC and SIMATIC NET OPC? S PLC, SIMATIC NET OPC.

FAQ Communication over IE

Service & Support. How can you establish a connection between a S PLC and SIMATIC NET OPC? S PLC, SIMATIC NET OPC.

WinCC. Communication Manual. Manual 2. This manual is part of the documentation package with the order number: 6AV6392-1CA05-0AB0 C79000-G8276-C156-01

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A) MODULE A5 Programming the CPU 314C-2DP

Using the WAGO PROFINET Coupler as Remote I/O with a Siemens S7 PLC

PROFINET IRT: Getting Started with The Siemens CPU 315 PLC

STEP 7 MICRO/WIN TUTORIAL. Step-1: How to open Step 7 Micro/WIN

1 Application Description Objective Goals... 3

Adding a Modbus TCP Device to the Network. Setting Up Your Network

Ethernet Interface Manual Thermal / Label Printer. Rev Metapace T-1. Metapace T-2 Metapace L-1 Metapace L-2

QuickPanel Control DeviceNet Master Communications Card (IC754DVNM01) Quick Start Guide. Thursday September 20, 2007

1. Installing The Monitoring Software

PROCESS AUTOMATION PLANNING AND INTEGRATION INFORMATION LB8106* Integration in Siemens SIMATIC PCS 7

Cisco - Configure the 1721 Router for VLANs Using a Switch Module (WIC-4ESW)

Applications & Tools. Configuration of Messages and Alarms in WinCC (TIA Portal) WinCC (TIA Portal) Application description December 2012

How to use KEPServerEX OPC Server (Kepware) with iologik 4000 (Modbus TCP/IP NA-4010 and Modbus Serial NA-4020/NA-4021)

TECHNICAL BULLETIN. Configuring Wireless Settings in an i-stat 1 Wireless Analyzer

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A) MODULE E05

SIMATIC NET. Functions (FC) and function blocks (FB) for SIMATIC NET S7 CPs. Preface. Overview and general information on working with FCs and FBs

Using the AnyBus -X Gateway to Communicate between a DVT camera and a Profibus Master

Ethernet Gateway for SIMATIC MPI/ PROFIBUS Driver

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A) MODUL E04

Technical Report CDC PC Station Guide Tutorial Nuno Cruz

Ethernet Radio Configuration Guide

S-SupremaConfigurationGuide-DOC 7/23/2014. Suprema Biometrics Configuration Guide ACS OnSite Aparato

eztcp Technical Document Modbus/TCP of eztcp Caution: Specifications of this document may be changed without prior notice for improvement.

CMC-PD01 PROFIBUS DP Slave Communication Card Operation Manual

Profinet to EDV111 Series LED Signs Siemens Function Block Software Manual

Training document for the company-wide automation solution Totally Integrated Automation (T I A) MODULE A5. PLC-Simulation with S7-PLCSIM

1 Application Description System Topology Hardware and Software Requirements... 3

S7 for Windows S7-300/400

The following sections describe the Gateway configuration pages in the SBG1000 Setup Program.

Siemens AG. SIMATIC S7 Ethernet 04/

CPU PN/DP: Configuring an ET. 200S as PROFINET IO device SIMATIC. PROFINET CPU PN/DP: Configuring an ET 200S as PROFINET IO device

1 How configure S7 PLC in the configuration tool

Ethernet Module Manual

Start-up of IVI-KHD2-4HRX, IVI-KHA6-4HRX at S7-300 V1.1. Table of Contents TABLE OF CONTENTS... 1

8/23/13 Configuring the S7 Server for Windows NT 4.0 to Access S7-400 PLCs via the Siemens CP1613 Card for ISO (Industrial Ethernet)

SOFTLINK 300. CPU Specifications. Reference Manual

BASLER ACE QUICK INSTALLATION GUIDE

Custom Solutions Center. Users Guide. Low Cost OEM PackML Templates L02 Release. Version LC-1.0

Software User Guide UG-461

Configuring the WT-4 for Upload to a Computer (Ad-hoc Mode)

RcWare SoftPLC Modbus server mapping editor User manual


ABB industrial drives. Quick start-up guide Drive Manager for SIMATIC

BECKHOFF. Application Notes. BC9000: Getting Started Guide. For additional documentation, please visit.

IGSS. Interactive Graphical SCADA System. Quick Start Guide

v v Alarm Notifications: [Y] Bounding boxes for analytics: [N]

Creating the program. TIA Portal. SIMATIC Creating the program. Loading the block library. Deleting program block Main [OB1] Copying program blocks

Instruction Manual. Ethernet I/O modules Part 1: MSX-Exxxx and SPS: Principles

To perform Ethernet setup and communication verification, first perform RS232 setup and communication verification:

Schneider OS-Loader usage via Ethernet or USB.

Flexi Soft Ethernet IP: Implicit Messaging with a Omron PLC

OPERATION MANUAL. MV-410RGB Layout Editor. Version 2.1- higher

Configuring Windows 7 64 bit for AutoVISION

Setting up an MS SQL Server for IGSS

SIMATIC NET. CP AS-Interface Master B C. Preface Contents. Technical Description and Installation Instructions Interface to the User Program

User Manual Document HTTP-Direct / FTPServer and FLASH file system

USER GUIDE. Ethernet Configuration Guide (Lantronix) P/N: Rev 6

FACTORY AUTOMATION MANUAL IC-KP-B12-V45

WUA Mbps Wireless USB Network Adapter

Ethernet/IP Comms between a WAGO and a Mettler Toledo JAGXTREME Terminal Application note

Arduino Wifi shield And reciever. 5V adapter. Connecting wifi module on shield: Make sure the wifi unit is connected the following way on the shield:

CP500 CONTROL PANELS. CP500 Soft: First Step with AC500 series on Ethernet. Step8. ABB Entrelec 1SBC159100M0202_Ch8 En

1-Port Wireless USB 2.0 Print Server Model # APSUSB201W. Quick Installation Guide. Ver. 2A

C-more Remote Access, Data Log, FTP File Transfer, and Tutorial

Cover sheet. Reading out the topology data of a PROFINET IO system SFB52 "RDREC" FAQ September Service & Support. Answers for industry.

LOGO! LOGO! App V.10. LOGO! app 1. Making basic settings and establishing a connection to LOGO! Using the device overview 3. Creating controls 4

Application Note Profinet Modules

ImagineWorldClient Client Management Software. User s Manual. (Revision-2)

Creating a Project with PSoC Designer

Application Note: Connecting to a 2500 Series Processor using PLC Workshop

Application Note Siemens PLC and SIMATIC STEP 7 / TIA Portal

Appendix A. CMS(Client Management Software)

How-To-Do. Hardware Configuration SLIO CPU 014

The Answer to the 14 Most Frequently Asked Modbus Questions

Configuring the WT-4 for Upload to a Computer (Infrastructure Mode)

Beckhoff TwinCAT. Assigning IP Addresses to Beckhoff Ethernet Devices

Access to remote DVR from IE USER S MANUAL CONTENT

1. Open Thunderbird. If the Import Wizard window opens, select Don t import anything and click Next and go to step 3.

SYMETRIX SOLUTIONS: TECH TIP August 2015

EPSON Scan Server & EPSON TWAIN Pro Network

xlogic App from Easy Electronic-Overview

Wireless LAN g USB Adapter

7.7 Ethernet Communication (AFPX-COM5)

8/23/13 Configuring the S7 I/O Server for Windows 95 to Access S7 PLCs Via the Profibus Network

WRE6505. User s Guide. Quick Start Guide. Wireless AC750 Range Extender. Default Login Details. Version 1.00 Edition 1,

WAVES. MultiRack SETUP GUIDE V9.80

About This Guide SolarEdge Configuration Tool Software Guide. About This Guide

Configuring PROFINET

Tutorial : Getting Started with Movicon 11 Cod. DOCS 11 TUT-E Build 1010

IEEE b WLAN PC Card

MTX Setup Manual. Special Notice. MTX Setup Manual 1

Configuring the WT-4 for Upload to a Computer (Infrastructure Mode)

DOMUSBOX. User guide. Index

SmartPTT File Transfer User's Guide. Version 2.0

Transcription:

EPICS using SLS s7plc driver PLC configurations National Synchrotron Radiation Research Center Radio Frequency Group Yu-Han Lin In this documents, the following items are used: Software 1) EPICS Base 3.14.8.2 (http://www.aps.anl.gov/epics/base/r3 14/index.php) 2) Step 7 SIMATIC Manager V5.2 3) SLS s7 driver (http://epics.web.psi.ch/software/s7plc/) Hardware 1) Siemens S7 300 PLC 2) Siemens CP343 Communication module

2/1 EPICS using SLS s7plc driver Configuration of Siemens S7 PLC Step 1: Create an empty project. Execute the SIMATIC Manager and create a new project called EPICS_PLC as shown in Figure 1. Figure 1 Step 2: Insert a PLC station in project. On the EPICS_PLC project, click the right button to insert a SIMATIC Station as shown in Figure 2.The result is shown in Figure 3. Figure 2 Figure 3 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 3/1 Step 3: Configure the hardware configuration of the PLC. In the SIMATIC Station as shown in Figure 3, doubleclick Hardware ; this operation leads you into the hardware configuration tool (figure 4). According to your PLC hardware, configure the modules at the right position. As all configurations are finished as shown in Figure 4, press button 1 to compile the configuration code, and then press button 2 to download the configurations into the PLC. Figure 4 Step 4: Configure the connection profile of the PLC. When the hardware is properly set up, the sections CPU 318-2 and CP 343-1 are automatically created in the SIMATIC Station as shown in Figure 5. In the CPU 318-2 section, double-click the Connection to configure the PLC connections. Figure 5 Nation Synchrotron Radiation Research Center,

4/1 EPICS using SLS s7plc driver The network configuration is similar to the hardware configuration. You need only to drag a station or subnet into the project, and the entry becomes automatically created. Figure 6 Here we seek to create an Industrial Ethernet subnet; so we drag the Industrial Ethernet into the project as shown in Figure 6. Figure 7 shows the result. Double-click the CP 343-1 module (the red rectangular area); a property configuration window pops up (Figure 8) to configure the Ethernet property such as the IP address and the mask. For example, the ip address of the CP 343-1 module is set to be 140.110.205.61. Figure 7 Select the Ethernet(1) in a subnet that we just created, so that the CP343-1 module will connect to Ethernet. Figure 9 shows the results of the configuration of CP343-1 Figure 8 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 5/1 Figure 9 Figure 10 Step 5: Create a communication channel for EPICS. There is no communication channel that can serve for data transmission / receiving. Select the CPU module; the communication channel becomes displayed at the bottom of the Netpro window. To create a new communication channel, click the right button on the CPU module, and select Insert New Connection. As illustrated in Figure 12, a configuration window pops up. Figure 11 Nation Synchrotron Radiation Research Center,

6/1 EPICS using SLS s7plc driver ` Use the Connection Partner group to specify the system or device with which PLC is going to communicate. For PLC to communicate with EPICS IOC, choose Unspecified. The Connection group is used to specify the communication protocol of PLC. Choose TCP connection for EPICS IOC communication, then press the OK button. A notification window will appear as shown in Figure 13; press OK again to ignore the message. Figure 12 Figure 13 The configuration program leads you to configure the property of the TCP connection. As demonstrated in Figure 14, the General Information tab shows the ID and LADDR parameters. These two parameters are the identification number of this communication channel, and are used later. Figure 14 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 7/1 The Addresses tab is used to specify the ip and port parameters of the local (PLC) and the partner (IOC). The local ip address has been set at step 4 (Figure 8). The default local port is 2000. Do NOT specify the ip address and port of partner. If these two parameters were specified, the communication between PLC and IOC might fail. Figure 15 The Options tab is used to specify the communication mode of PLC. Set the mode to be Send/Recv. Press OK : the configuration of TCP connection is then finished. Figure 16 Nation Synchrotron Radiation Research Center,

8/1 EPICS using SLS s7plc driver When the connection configuration is finished, as shown in Figure 17, click on the CPU module; the connection information becomes displayed at the bottom of the NetPro window. Click button 1 to compile the network configurations, and then click button 2 to download the setting into the PLC CPU. If all configurations are correct, a no error message appears on the screen. Figure 17 Figure 18 Step 6: Insert data blocks for transmission and receiving. Back to the SIMATIC Manager, select the Blocks section in the tree. There is only one organization block OB1 in the Block section as illustrated in Figure 19. We need to create two data blocks: one serves for data transmission, and the other for data receiving. Figure 19 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 9/1 Click the right button on the screen; select Insert New Object -> Data Block as shown in Figure 20. Figure 20 In the Data Block properties configuration window (Figure 21), rename the data block DB10, and set the type to be Shared DB. Create another data block, and rename it DB11 with type Shared DB. We will later use DB10 for data transmission and DB11 for data receiving. Figure 21 Nation Synchrotron Radiation Research Center,

10/1 EPICS using SLS s7plc driver As shown in Figure 22, two data blocks were created, but the contents of these two data blocks are not yet defined. We therefore need to define the contents of these two data blocks. Double-click on DB10 ; a configuration window as Figure 23 pops up. Modify the contents of DB10, as shown in Figure 24. Figure 22 Open DB11, and modify the content of DB11 to be the same as DB10. Save these modifications, and close the configuration window. Note that you can define the contents of DB10 and DB11 to meet your data format that you seek to transmit and to receive. Figure 24 is just illustrated as an example. Figure 23 Figure 24 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 11/1 Step 7: Insert functions for data transmission and receiving. In the SIMATIC Manager, click the right button on the screen and select Insert New Object -> Function. A configuration window for a function pops up. Figure 25 Rename this function to be FC1, and you can choose the programming language in the Created in Language row. Return to the SIMATIC Manager, and double-click FC1 to load FC1 for editing. Figure 26 Figure 27 Nation Synchrotron Radiation Research Center,

12/1 EPICS using SLS s7plc driver Figure 28 Figure 28 shows the programming editor of FC1. In network 1, the memory address M100.0 is turned on/off per 100 ms. We can use this memory address as the switch to turn on/off the data transmission. In network 2, we need to call the sub-program AG_SEND, which can be found in the Program elements tree. Note that the AG_SEND function depends on the module. This function is used to send data. Double-click the AG_SEND ; it becomes automatically added to the selected network. Table 1 Network 1: AN T 1 L S5T#100MS SD T 0 A T 0 L S5T#100MS SD T 1 = M 100.0 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 13/1 Figure 29 The editor will ask you to input the required parameters. Fill these rows with proper parameters, then save and quit. Network 2: Table 2 Note: 1) The ID and LADDR are used to identify the connection channel; they must match the values in Figure 14. 2) For CP300 series, the maximum length of AG_SEND is bounded by 240 bytes. 3) In network 2, we use memory address M100.0 to turn on/off the transmission. 4) Data block (DB10) of length 240 bytes is sent. CALL "AG_SEND" ACT :=M100.0 ID :=1 LADDR :=W#16#100 SEND :=DB10.Contents LEN :=240 DONE :=M0.0 ERROR :=M0.1 STATUS :=MW10 Nation Synchrotron Radiation Research Center,

14/1 EPICS using SLS s7plc driver Back at the SIMATIC Manager, FC5 (AG_SEND) is automatically inserted into this project. Double-click OB1 to load OB1 for editing. Figure 30 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 15/1 Figure 31 The editor of OB1 is shown in Figure 31. The FC1, which is created to send data, is called in network 1. To receive data from IOC, we need an AG_RECV function to listen to the messages from Ethernet. Again, move the mouse to network 2, and double-click the AG_RECV function. The function becomes automatically inserted into OB1 and the project. Nation Synchrotron Radiation Research Center,

16/1 EPICS using SLS s7plc driver Figure 32 Again, the editor asks you to fill in the required parameters. Fill these rows with proper parameters, then save and quit. Note: 1) The ID and LADDR must also match the values in Figure 14. 2) For the CP300 series, the maximum length of AG_RECV is also bounded by 240 bytes. 3) The received data will be written into DB11, and the length of the received message will be written to MW30. Table 3 Network 2: CALL "AG_RECV" ID :=1 LADDR :=W#16#100 RECV :=P#DB11.DBX 0.0 BYTE 240 NDR :=M1.2 ERROR :=M1.3 STATUS :=MW20 LEN :=MW30 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 17/1 Figure 33 Select all components in SIMATIC Manager, and press the download button to download all components into PLC. The general-purpose communication configuration is then finished. Communication Example In this example, we will 1) confirm the connection between PLC and EPICS IOC, 2) put an analog value into PLC from IOC, 3) multiply this analog value by 2 in PLC, 4) read this value, 5) read a bit (switch) status, and 6) modify this bit status (turn on/off the switch). Nation Synchrotron Radiation Research Center,

18/1 EPICS using SLS s7plc driver Figure 34 In the PLC terminal, insert a new network (Network 3) in Organization block 1 (OB1) to 1) load the value from DB11.DBW0, 2) multiply this value by 2, and 3) save the value to DB10.DBW0. Insert another new network (Network 4) to read the bit status of DB11 and turn on/off the output device. The program is shown in Figure 35. Remember to download the modified OB1 into PLC by pressing the download button. Then switch the PLC to RUN mode. Figure 35 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 19/1 Table 4 shows the modified contents of data base example.db. The record s7-status is used to verify the PLC connection status. The record ai16-1 is an analog input record that reads the value of the first word of DB10 (i.e. DB10.DBW0). The record ao16-1 is an analog output record that writes the value to the first word of DB11 (i.e. DB11.DBW0). The records bi-x/bo-x are the binary input/output records; they read/write the value from/to the x-th bit of the third byte of DB10/DB11. Table 4 record(bi, s7-status) { field(dtyp, "S7plc stat") field(inp, "@ Station:0") field(scan, "I/O Intr") field(znam, "disconnected") field(onam, "connected") field(zsv, "MAJOR") field(flnk, "s7-status-counter") record(calc, s7-status-counter) { field(inpa, "s7-status-counter") field(calc, "A+1") field(flnk, "s7-disconnect-counter") record(calc, s7-disconnect-counter) { field(inpa, "s7-status") field(inpb, "s7-disconnect-counter.la") field(inpc, "s7-disconnect-counter") field(calc, "(A=0&&B=1)?C+1:C") record(ai, ai16-1) { field(scan, " I/O Intr") field(dtyp, "S7plc") field(inp, "@ Station:0/0 T=WORD") record(ao, ao16-1) { field(dtyp, "S7plc") field(out, "@ Station:0/0 T=WORD") record(bi, bi-1) { field(scan, "I/O Intr") field(dtyp, "S7plc") field(inp, "@ Station:0/2 B=0 T=BYTE") record(bi, bi-2) { field(scan, "I/O Intr") field(dtyp, "S7plc") field(inp, "@ Station:0/2 B=1 T=BYTE") record(bi, bi-3) { field(scan, "I/O Intr") field(dtyp, "S7plc") field(inp, "@ Station:0/2 B=2 T=BYTE") record(bi, bi-4) { field(scan, "I/O Intr") field(dtyp, "S7plc") field(inp, "@ Station:0/2 B=3 T=BYTE") record(bo, bo-1) { field(dtyp, "S7plc") field(out, "@ Station:0/2 B=0 T=BYTE") field(pini, "YES") record(bo, bo-2) { field(dtyp, "S7plc") field(out, "@ Station:0/2 B=1 T=BYTE") field(pini, "YES") record(bo, bo-3) { field(dtyp, "S7plc") field(out, "@ Station:0/2 B=2 T=BYTE") field(pini, "YES") record(bo, bo-4) { field(dtyp, "S7plc") field(out, "@ Station:0/2 B=3 T=BYTE") field(pini, "YES") Nation Synchrotron Radiation Research Center,

20/1 EPICS using SLS s7plc driver Table 5 shows the startup script of the IOC. Note that the <IP address> and the <port> field must exactly match the PLC connection configurations (see Figure 15). Set the input size and output size to 240 bytes, which is the maximum limit of a CP343 module. dbloaddatabase../../dbd/s7plcapp.dbd s7plcapp_registerrecorddevicedriver var s7plcdebug 1 #s7plcconfigure name,ipaddr,port,insize,outsize,bigendian,recvtimeout,sendintervall #connects to PLC <name> on address <IPaddr> port <port> #<insize> : size of data bock PLC -> IOC [bytes] #<outsize> : size of data bock IOC -> PLC [bytes] #<bigendian>=1 : Motorola format data (MSB first) #<bigendian>=0 : Intel format data (LSB first) #<recvtimeout> : time to wait for input before disconnecting [ms] #<sendintervall> : time to wait before sending new data to PLC [ms] s7plcconfigure Station:0,140.110.205.61,2000,240,240,1,2000,500 dbloadrecords example.db iocinit Table 5 National Synchrotron Radiation Research Center,

EPICS using SLS s7plc driver 21/1 Figure 36 Execute the start up script. The result of the execution is illustrated in Figure 36. It is easy to read/write an analog value from/to the PLC and turn on/off a switch of a device. Enjoy EPICS! Nation Synchrotron Radiation Research Center,