Ethernet E/A-Module: S7 Kommunikation - ADDI-DATA
Transcription
Ethernet E/A-Module: S7 Kommunikation - ADDI-DATA
Instruction Manual Ethernet I/O modules Part 1: MSX-Exxxx and SPS: Principles DIN EN ISO 9001:2000 certified Edition: 02.02-02/2009 Product information This manual contains the technical installation and important instructions for correct commissioning and usage, as well as production information according to the current status before printing. The content of this manual and the technical product data may be changed without prior notice. ADDI-DATA GmbH reserves the right to make changes to the technical data and the materials included herein. Warranty and liability The user is not permitted to make changes to the product beyond the intended use, or to interfere with the product in any other way. ADDI-DATA shall not be liable for obvious printing and phrasing errors. In addition, ADDI DATA, if legally permissible, shall not be liable for personal injury or damage to materials caused by improper installation and/or commissioning of the board by the user or improper use, for example, if the board is operated despite faulty safety and protection devices, or if notes in the operating instructions regarding transport, storage, installation, commissioning, operation, thresholds, etc. are not taken into consideration. Liability is further excluded if the operator changes the board or the source code files without authorisation and/or if the operator is guilty of not monitoring the permanent operational capability of working parts and this has led to damage. Copyright This manual, which is intended for the operator and its staff only, is protected by copyright. Duplication of the information contained in the operating instructions and of any other product information, or disclosure of this information for use by third parties, is not permitted, unless this right has been granted by the product licence issued. Non-compliance with this could lead to civil and criminal proceedings. ADDI-DATA software product licence Please read this licence carefully before using the standard software. The customer is only granted the right to use this software if he/she agrees with the conditions of this licence. The software must only be used to set up the ADDI-DATA boards. Reproduction of the software is forbidden (except for back-up and for exchange of faulty data carriers). Disassembly, decompilation, decryption and reverse engineering of the software are forbidden. This licence and the software may be transferred to a third party if this party has acquired a board by purchase, has agreed to all the conditions in this licence contract and the original owner does not keep any copies of the software. Trademarks • ADDI-DATA, MSX-Box and MSX-E are registered trademarks of ADDI-DATA GmbH. • Turbo Pascal, Delphi, Borland C, Borland C++ are registered trademarks of Borland Software Corporation. • Microsoft .NET, Microsoft C, Visual C++, Windows XP, Windows 98, Windows 2000, Windows 95, Windows NT, Windows EmbeddedNT, Windows Vista, Windows Server 2003, Windows Embedded, Windows Server 2000 and MS-DOS are registered trademarks of Microsoft Corporation. • LabVIEW, LabWindows/CVI, DASYLab, DIAdem are registered trademarks of National Instruments Corporation. • CompactPCI is a registered trademark of PCI Industrial Computer Manufacturers Group. • VxWorks is a registered trademark of Wind River Systems, Inc. • RTX is a registered trademark of Ardence. • SIMATIC S7, S7-300, STEP7, CPU313C-2DP and CP343-1 Lean are registered trademarks of Siemens AG. www.addi-data.com 2 Warning The following risks result from improper implementation and from use of the product contrary to the regulations: Personal injury Damage to the module, PC and peripherals Pollution of the environment Protect yourself, others and the environment! Read the safety precautions (yellow leaflet) carefully! If this leaflet is not enclosed with the documentation, please contact us and ask for it. Observe the instructions of the manual! Make sure that you do not forget or skip any step. We are not liable for damages resulting from a wrong use of the product. Used symbols: i IMPORTANT! Designates hints and other useful information. WARNING! Designates a possibly dangerous situation. If the instructions are ignored, the module, the PC and/or peripherals may be destroyed. WARNING! Designates a possibly dangerous situation. If the instructions are ignored, the module, the PC and/or peripherals may be destroyed and persons may be endangered. www.addi-data.com 3 Contents MSX-Exxxx and SPS: Principles Contents Warning........................................................................................................................................ 3 1 Introduction...................................................................................................................... 5 1.1 Documentation content ..................................................................................................................5 1.2 Documentation structure ................................................................................................................5 2 The combination principle .............................................................................................. 6 2.1 More powerful PLC using intelligent Ethernet I/O modules.........................................................6 2.2 Requirements regarding electronic measuring equipment of the MSX-E module.....................6 2.3 Significant benefits of the MSX-E modules for the PLC................................................................6 2.4 Connection of an MSX-E module to a PLC.....................................................................................8 2.5 The connection of an MSX-E module and a PLC ...........................................................................8 2.5.1 Data acquisition without programming (Autostart).....................................................................8 2.5.2 Data acquisition with TCP/IP MODBUS...........................................................................................9 3 Appendix ........................................................................................................................ 10 3.1 Compatible Ethernet I/O modules ................................................................................................10 3.2 Glossary...........................................................................................................................................11 3.3 Index ...............................................................................................................................................12 4 Contact and support ...................................................................................................... 12 Figures Fig. 2-1: MSX-E module: Structure .............................................................................................................7 Fig. 2-2: MSX-E module: Connection to a PLC...........................................................................................8 Fig. 2-3: SPS: Retrieval of external measurement values ..........................................................................9 Tables Table 3-1: Compatible Ethernet I/O modules ..........................................................................................10 www.addi-data.com 4 Introduction MSX-Exxxx and SPS: Principles 1 Introduction 1.1 Documentation content This documentation describes how you can use intelligent Ethernet I/O modules, Ethernet and a standard protocol such as TCP/IP to carry out even complex, “rapid” measuring tasks or signal processing (such as determining average values) simply, reliably and cost-effectively via a PLC. You can find detailed information about the respective MSX-Exxxx modules 1 in the ADDI-DATA product catalog or in the relevant manuals. Chapter 3.1 of this first part contains an overview of the compatible MSX-E modules. 1.2 Documentation structure The documentation is divided into 3 parts: Part 1: MSX-Exxxx and PLC: Principles The first part of the documentation describes the principles of combining PLC and MSX-E modules. Part 2: Connection to a PLC SIMATIC S7 Part 2 answers the following questions: Which requirements are necessary to connect an MSX-E module to a PLC (hardware etc.)? How are PLC and MSX-E modules parameterised? Which settings generally have to be made and for what reason? What do I have to be aware of when connecting one (or more) MSX-E modules to a PLC? Part 3: Web interface description The third part of the documentation explains in more detail the interface of the module website (MSX-E3011 and MSX-E37xx) including the relevant settings. 1 MSX-Exxxx = Common name for the Ethernet I/O modules www.addi-data.com 5 The combination principle MSX-Exxxx and SPS: Principles 2 The combination principle 2.1 More powerful PLC using intelligent Ethernet I/O modules High flexibility and good value components have helped the PLC concept to reach its triumphant success. Alongside control and regulation, PLCs are increasingly taking over other tasks such as alarms, visualisation and data logging. Sensors and actuators ceased to be discrete some time ago, but can be combined directly with the PLC at reduced wiring costs. Ethernet networks have proven themselves in office IT for a long time now. The link between office IT and manufacturing IT meets the information, monitoring and security requirements of modern management simultaneously. Working in series makes programmable logic controllers slower than hardwired programmed logic controllers. But demanding tasks such as the simultaneous reading of several channels or the simultaneous acquisition of several signal types which originate from inductive/digital transducers, shaft encoders or analog inputs are carried out using high- performance electronic measuring equipment. Examples of this are an acquisition of several measurement values in a buffer in order to make data available later or a very rapid acquisition and assessing of values independent of the PLC cycle. 2.2 • • • • • • • • • Simultaneous acquisition of different measurement values (e.g. surface quality and position) ¾ Allows for precise corrections at known fault sites Calculation of minimum and maximum values or average values ¾ In order to categorise any irregularities within or outside a predefined tolerance or to relieve the load on the PLC Direct use in the production hall near the test item Reliable operation at high temperatures and with splash water Easy connection to the PLC Communication via standard Ethernet ¾ In order to also forward values to the IT level for prompt assessment of production quality Parameterisation without programming, e.g. over an integrated web interface ¾ Integration as easy as possible Diagnostics and monitoring without special programs or SPC On-board temporary storage so that no values are lost 2.3 • • • • Requirements regarding electronic measuring equipment of the MSX-E module Significant benefits of the MSX-E modules for the PLC They can be cascaded and synchronised in the μs area. ¾ Simultaneous acquisition of different measurement values, e.g. inductive transducers and position of the test item Extended temperature range from -40 °C to +85 °C Degree of protection IP 65: protection against jet water and dust ¾ No “protection” of switch cabinets necessary; money- and time-saving Numerous protective circuits: optical isolation of up to 1,000 V, short-circuit and reverse polarity protection www.addi-data.com 6 The combination principle • • • • • MSX-Exxxx and SPS: Principles Parameterisation and monitoring via web server ¾ Measurement values directly on the screen of the technician's PC ¾ Saving of time, in particular when setting up measuring facilities, and flexibility Easy connection to the PLC via TCP/IP ¾ Problem-free forwarding of measuring data to the IT level ¾ Remote maintenance with password protection and encryption On-board RAM for data storage Software updates can be easily installed at any time on the MSX-E modules. Complex computing tasks (such as calculating several sensors in one result) can be realised as required. The MSX-E modules are available for different signal types: • Digital I/O, 24 V • Analog inputs, voltage or current, 16 bit • Analog outputs, voltage or current, 16 bit • Inductive transducers (HB, LVDT, Mahr-compatible) • Incremental shaft encoders and transducers • Sin/cos signals (1Vpp/11μApp) for shaft encoders or digital transducers • Etc. The mode of operation for all MSX-E modules is identical: Each module has a control side and a signal side. The connection to the control side is the same for all modules. Fig. 2-1: MSX-E module: Structure www.addi-data.com 7 The combination principle 2.4 MSX-Exxxx and SPS: Principles Connection of an MSX-E module to a PLC The MSX-E modules are connected to the PLC via Ethernet. Thus no special lines or communication buses are needed. Additional modules can be added to the network very easily. By means of an Ethernet controller, which can manage the TCP/IP protocol, the PLC is able to access the additional modules. There are both hardware solutions (communication processor – CP) and software solutions for this, whereas a hardware solution may be more suitable, depending on the application. A separate hardware controller enables faster communication and reduces the load on the PLC CPU less than software Ethernet management over the PLC CPU. Fig. 2-2: MSX-E module: Connection to a PLC 2.5 The connection of an MSX-E module and a PLC 2.5.1 Data acquisition without programming (Autostart) The actual measuring is parameterised and saved on the modules using the website. You can use the Autostart function to load the measuring settings when the module is booted and to execute them automatically. As such, no additional programming is required on the PLC. Example: 16 analog inputs (8x +/-10 V, 8x +/-5 V), each with a speed of 25 kHz, should be acquired for a total of 0.5 seconds. The measuring should only be started once the test item is in the correct position, that is, the PLC signals the start of the measuring to the MSX-E module using a digital 24 V output (hardware trigger). If the measuring has been previously parameterised and saved on the module, the module boots up after it is powered on and waits for the hardware trigger. If it identifies the hardware trigger, the measuring starts and the module acquires the measurement values for 0.5 seconds. It subsequently waits for the next trigger. www.addi-data.com 8 The combination principle MSX-Exxxx and SPS: Principles Via the receive function (FC6), the PLC can access the values and save these in a data block (DB) (1 DWORD per channel). Afterwards they can be further processed as required. Due to their own intelligence (ARM9), the modules can carry out calculations, e.g. of the minimum, maximum and average values, independently. Fig. 2-3: SPS: Retrieval of external measurement data The configuration of the PLC and the MSX-E modules is described in detail in Part 2 of the Instruction Manuals Ethernet I/O modules: Connection to a PLC SIMATIC S7. 2.5.2 Data acquisition with TCP/IP MODBUS The acquisition of the measurement values can also be started using TCP/IP-MODBUS. Here, the measuring or data acquisition is not parameterised on the modules and loaded when they are powered up; instead, they are called to the PLC through MODBUS functions. This operation is described in a separate documentation (“MODBUS Interface Description”). www.addi-data.com 9 Appendix MSX-Exxxx and SPS: Principles 3 Appendix 3.1 Compatible Ethernet I/O modules Table 3-1: Compatible Ethernet I/O modules Ethernet I/O module Description MSX-E1516* Ethernet digital I/O module, 16 digital inputs/outputs, 24 V, IP 65 MSX-E1701* Ethernet multifunction counter module, 4 incremental counter inputs, 16 digital I/O, 24 V, IP 65 MSX-E1711* Ethernet multifunction counter module, 4 sin/cos counter inputs (1 Vpp), 16 digital I/O, 24 V, IP 65 MSX-E1721* Ethernet multifunction counter module, 4 sin/cos counter inputs (11 μApp), 16 digital I/O, 24 V, IP 65 MSX-E3011 Ethernet analog input module, 16 analog inputs, differential, 16 bit, IP 65 MSX-E3700 Ethernet module for length measurement, 24 bit, 16/8/4 inductive transducers, LVDT, half-bridge, IP 40 MSX-E3701 Ethernet module for length measurement, 24 bit, 16/8/4 inductive transducers, LVDT, half-bridge, Mahr-compatible, IP 65 MSX-E3711 Ethernet module for length measurement, 24 bit, simultaneous, 8 transducers, counter and temperature inputs, IP 65 * on request www.addi-data.com 10 Appendix 3.2 MSX-Exxxx and SPS: Principles Glossary Ethernet Ethernet is a system for connecting a number of computer systems to form a local area network, with protocols to control the passing of information and to avoid simultaneous transmission by two or more systems. Trigger A trigger is a pulse or signal for starting or stopping a special task. Triggers are often used for controlling data acquisition. Counter A counter is a circuit that counts pulses or measures pulse duration. IP address This is a unique string of numbers separated by full stops that identifies each computer attached to the Internet. Usually it also has a version containing words separated by full stops. LSB = least significant bit LSB is the lowest order bit in a digital quantity. MSB = most significant bit MSB is the highest order bit in a digital quantity. PLC = programmable logic controller A PLC is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines. PLCs are used in many different industries and machines such as packaging and semiconductor machines. Unlike generalpurpose computers, the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. A PLC is an example of a real-time system. Socket A socket is a bidirectional software interface to interprocess (IPC) or network communication. Sockets are a standardised interface (API) between the network protocol implementation of the operating system and the actual application software. www.addi-data.com 11 Appendix 3.3 MSX-Exxxx and SPS: Principles Index benefits 6 connection to PLC 8 data acquisition Autostart 8 TCP/IP MODBUS 9 Glossary 11 requirements 6 signal types 7 www.addi-data.com 12 Contact and support MSX-Exxxx and SPS: Principles 4 Contact and support Do you have any questions? Write or phone us: Address: ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmünster E-Mail: [email protected] Phone: +49 7229 1847-0 Manual and software download on the Internet: www.addi-data.com www.addi-data.com 13 Instruction Manual Ethernet I/O modules Part 2: Connection to a PLC SIMATIC® S7® DIN EN ISO 9001:2000 certified Edition: 02.01-01/2009 Product information This manual contains the technical installation and important instructions for correct commissioning and usage, as well as production information according to the current status before printing. The content of this manual and the technical product data may be changed without prior notice. ADDI-DATA GmbH reserves the right to make changes to the technical data and the materials included herein. Warranty and liability The user is not permitted to make changes to the product beyond the intended use, or to interfere with the product in any other way. ADDI-DATA shall not be liable for obvious printing and phrasing errors. In addition, ADDI DATA, if legally permissible, shall not be liable for personal injury or damage to materials caused by improper installation and/or commissioning of the board by the user or improper use, for example, if the board is operated despite faulty safety and protection devices, or if notes in the operating instructions regarding transport, storage, installation, commissioning, operation, thresholds, etc. are not taken into consideration. Liability is further excluded if the operator changes the board or the source code files without authorisation and/or if the operator is guilty of not monitoring the permanent operational capability of working parts and this has led to damage. Copyright This manual, which is intended for the operator and its staff only, is protected by copyright. Duplication of the information contained in the operating instructions and of any other product information, or disclosure of this information for use by third parties, is not permitted, unless this right has been granted by the product licence issued. Non-compliance with this could lead to civil and criminal proceedings. ADDI-DATA software product licence Please read this licence carefully before using the standard software. The customer is only granted the right to use this software if he/she agrees with the conditions of this licence. The software must only be used to set up the ADDI-DATA boards. Reproduction of the software is forbidden (except for back-up and for exchange of faulty data carriers). Disassembly, decompilation, decryption and reverse engineering of the software are forbidden. This licence and the software may be transferred to a third party if this party has acquired a board by purchase, has agreed to all the conditions in this licence contract and the original owner does not keep any copies of the software. Trademarks • ADDI-DATA, MSX-Box and MSX-E are registered trademarks of ADDI-DATA GmbH. • Turbo Pascal, Delphi, Borland C, Borland C++ are registered trademarks of Borland Software Corporation. • Microsoft .NET, Microsoft C, Visual C++, Windows XP, Windows 98, Windows 2000, Windows 95, Windows NT, Windows EmbeddedNT, Windows Vista, Windows Server 2003, Windows Embedded, Windows Server 2000 and MS-DOS are registered trademarks of Microsoft Corporation. • LabVIEW, LabWindows/CVI, DASYLab, DIAdem are registered trademarks of National Instruments Corporation. • CompactPCI is a registered trademark of PCI Industrial Computer Manufacturers Group. • VxWorks is a registered trademark of Wind River Systems, Inc. • RTX is a registered trademark of Ardence. • SIMATIC S7, S7-300, STEP7, CPU313C-2DP and CP343-1 Lean are registered trademarks of Siemens AG. www.addi-data.com 2 Warning The following risks result from improper implementation and from use of the product contrary to the regulations: Personal injury Damage to the module, PC and peripherals Pollution of the environment Protect yourself, others and the environment! Read the safety precautions (yellow leaflet) carefully! If this leaflet is not enclosed with the documentation, please contact us and ask for it. Observe the instructions of the manual! Make sure that you do not forget or skip any step. We are not liable for damages resulting from a wrong use of the product. Used symbols: i IMPORTANT! Designates hints and other useful information. WARNING! Designates a possibly dangerous situation. If the instructions are ignored, the module, the PC and/or peripherals may be destroyed. WARNING! Designates a possibly dangerous situation. If the instructions are ignored, the module, the PC and/or peripherals may be destroyed and persons may be endangered. www.addi-data.com 3 Contents Connection to a PLC SIMATIC S7 Contents Warning........................................................................................................................................ 3 Chapter overview........................................................................................................................ 6 1 MSX-E module and PLC configuration............................................................................ 7 1.1 Prerequisite ......................................................................................................................................7 1.2 Principle structure ............................................................................................................................7 1.3 Program overview............................................................................................................................8 1.4 Data conversion ...............................................................................................................................8 1.4.1 Little Endian format (Intel format ..................................................................................................9 1.4.2 Big Endian Format (Motorola Format ............................................................................................9 2 Parameterising the PLC ................................................................................................. 10 2.1 Introduction ...................................................................................................................................10 2.2 S7 Ethernet configuration.............................................................................................................10 3 Reading the measurement data ................................................................................... 16 3.1 Introduction ...................................................................................................................................16 3.2 Prerequisites ...................................................................................................................................16 3.3 S7: Description of the function blocks..........................................................................................16 3.3.1 FC1: Converting data to the Motorola format ............................................................................17 3.3.2 FC3: Converting a DWORD data type to a REAL data type ........................................................18 3.3.3 FC4: Converting to millimetres (for transducers..........................................................................18 3.3.4 FC7: Converting to volts or mA.....................................................................................................20 3.3.5 FC20: Dynamic Reading of a DWORD Value from a Table .........................................................21 3.3.6 FC21: Dynamic writing of a REAL value to a table ......................................................................22 3.3.7 FC6: Reading data from a network connection...........................................................................23 4 Simple S7 example......................................................................................................... 26 4.1 Configuring the module using the web interface.......................................................................26 4.1.1 Auto-refresh mode ........................................................................................................................26 4.1.2 Sequence mode..............................................................................................................................29 4.2 S7: Example description.................................................................................................................34 4.2.1 OB1: Main block.............................................................................................................................34 4.2.2 Network 1: Definition of the number of values to read.............................................................34 4.2.3 Network 2: Selecting the appropriate conversion unit...............................................................35 4.2.4 Network 3: Reading the measurement values from the TCP connection..................................35 4.2.5 Network 4: Initialising the index ..................................................................................................36 4.2.6 Network 5: Display in Motorola format .......................................................................................37 4.2.7 Network 6: Managing the sequence counter value ....................................................................37 4.2.8 Network 7: Type cast instead of conversion ................................................................................38 4.2.9 Network 8: Converting to millimetres..........................................................................................38 4.2.10 Network 9: Converting to volts.....................................................................................................39 4.2.11 Network 10: Processing the sequence counter value..................................................................39 4.2.12 Network 11: Save and check .........................................................................................................40 5 Recommendations ......................................................................................................... 41 5.1 Auto-refresh and sequence mode ................................................................................................41 5.1.1 Acquisition in auto-refresh mode.................................................................................................41 5.1.2 Acquisition in sequence mode ......................................................................................................42 5.2 Trigger ............................................................................................................................................43 5.2.1 Introduction ...................................................................................................................................43 5.2.2 Module configuration ...................................................................................................................44 5.2.3 BasicSample: Example of trigger enhancement ..........................................................................44 5.3 Querying the current measurement values in auto-refresh mode ............................................45 5.3.1 Introduction ...................................................................................................................................45 5.3.2 Module configuration ...................................................................................................................45 5.3.3 BasicSample: Adjustment example for querying the measurement values...............................46 www.addi-data.com 4 Contents 5.4 6 6.1 6.2 7 Connection to a PLC SIMATIC S7 Connecting several modules to a PLC...........................................................................................47 Appendix ........................................................................................................................ 48 Glossary...........................................................................................................................................48 Index ...............................................................................................................................................49 Contact and support ...................................................................................................... 50 Figures Fig. 1-1: Fig. 1-2: Fig. 2-1: Fig. 2-2: Fig. 2-3: Fig. 2-4: Fig. 2-5: Fig. 2-6: Fig. 2-7: Fig. 2-8: Fig. 3-1: Fig. 3-2: Fig. 3-3: Fig. 3-4: Fig. 3-5: Fig. 5-1: Fig. 5-2: Fig. 5-3: Fig. 5-4: MSX-E module and PLC: Principle structure.............................................................................7 Retrieval of external measurement data .................................................................................8 SIMATIC Manager: S7 Ethernet configuration ......................................................................10 Ethernet configuration: TCP connection................................................................................11 TCP connection properties: General information..................................................................12 TCP connection properties: Addresses ...................................................................................13 Login window ..........................................................................................................................14 Network protocol: TCP port number......................................................................................14 Dataserver: Action ...................................................................................................................15 Dataserver: Blocking TCP/IP transfer ......................................................................................15 SIMATIC Manager: List of blocks ............................................................................................16 TCP connection properties ......................................................................................................23 Acquisition/Autostart: Binary data packet structure.............................................................24 Data block with the RAW table ..............................................................................................25 RAW table in the data block...................................................................................................25 Auto-refresh mode: Acquisition cycle ....................................................................................41 Sequence mode: Acquisition cycle..........................................................................................42 Web interface: TCP port number............................................................................................46 SIMATIC Manager: S7 Ethernet configuration ......................................................................47 Tables Table 3-1: Table 3-2: Table 3-3: Table 3-4: FC1: Function call sequence ....................................................................................................17 FC3: Function call sequence ....................................................................................................18 FC4: Function call sequence ....................................................................................................19 FC7: Function call sequence ....................................................................................................21 www.addi-data.com 5 Chapter overview Connection to a PLC SIMATIC S7 Chapter overview In this manual you will find the following information: Content Chapter 1 Principles of the MSX-E module and PLC configuration 2 Description of the PLC parameterisation or Ethernet configuration 3 Explanation of the S7 function blocks 4 Description of the S7 example networks 5 Recommendations in terms of acquisition mode, trigger, etc. 6 Appendix containing a glossary and an index 7 Contact and support address www.addi-data.com 6 MSX-E module and PLC configuration Connection to a PLC SIMATIC S7 1 MSX-E module and PLC configuration 1.1 Prerequisite The prerequisite for using MSX-E modules with a PLC is that the PLC must have an Ethernet interface and can open an active TCP connection (TCP sockets). 1.2 Principle structure Each MSX-E module has a data server that provides the acquired measurement values. The PLC can access these measurement values using a TCP connection, thereby reading the data. The acquisition itself can be started either by an external trigger (digital 24 V input) or automatically. Fig. 1-1: MSX-E module and PLC: Principle structure MSX-Exxxx Acquisition Data server Network connector Trigger input TCP connection optional PLC In the PLC, the data is read using the FC6 function (receive function) and then stored in a data block (DB). From here, it can be further processed as required. www.addi-data.com 7 MSX-E module and PLC configuration 1.3 Connection to a PLC SIMATIC S7 Program overview Fig. 1-2: Retrieval of external measurement data OB1: This operation block calls up the receive function (FC6). FC6: With this function, data is read from a TCP connection (socket) and subsequently saved in a data block. 1.4 Data conversion Note that the MSX-E modules send data in the Little Endian format (Intel format), whereas an S7 PLC works with Big Endian coding (Motorola format). As a result, the values of the MSX-E modules on the PLC have to be converted into the Big Endian format (Motorola format). This data coding plays an important role as otherwise the measurement results will be interpreted incorrectly. ADDI-DATA provides you with a corresponding conversion function: Function: Name: FC1 INTEL_TO_MOTOROLA. www.addi-data.com 8 MSX-E module and PLC configuration Connection to a PLC SIMATIC S7 1.4.1 Little Endian format (Intel format The least significant bit (LSB) is transferred first: 16 bit 32 bit 0x1234 0x12345678 >> >> 0x34 0x78 0x12 0x56 0x34 0x12 0x56 0x78 1.4.2 Big Endian Format (Motorola Format The most significant bit (MSB) is transferred first: 16 bit 32 bit 0x1234 0x12345678 www.addi-data.com >> >> 0x12 0x12 0x34 0x34 9 Parameterising the PLC Connection to a PLC SIMATIC S7 2 Parameterising the PLC 2.1 Introduction ADDI-DATA provides a software packet that displays the connection between an MSX-E module and an S7 PLC. The example is based on a SIMATIC S7 PLC from Siemens. If you want to use an S7-compatible PLC from a different manufacturer (such as IBH-Softec, Vipa etc.), then you have to use the relevant manufacturer’s original FCs. You may also have to adapt the data blocks etc. (Siemens: 9 DWORD; Vipa: 36 bytes). The example given for the S7 from Siemens is called BasicSample and was developed for the S7-300’s Ethernet connection with CP343-1. It is used for reading values from the TCP connection (TCP socket). 2.2 S7 Ethernet configuration The following configuration is based on an S7-300 with CP343-1. Your PLC may display other menus, although the settings are the same nevertheless. Fig. 2-1: SIMATIC Manager: S7 Ethernet configuration Open the SIMATIC Manager and then the BasicSample project. To configure the TCP connection, double-click on the “Ethernet” object name. www.addi-data.com 10 Parameterising the PLC Connection to a PLC SIMATIC S7 Fig. 2-2: Ethernet configuration: TCP connection Click on CPU313C-2DP (see the top arrow). In the table at the bottom, double-click on the selected line (see the bottom arrow). The table says that the Ethernet connection is a TCP connection. www.addi-data.com 11 Parameterising the PLC Connection to a PLC SIMATIC S7 Fig. 2-3: TCP connection properties: General information So that the S7 can create the connection to the MSX-E module, Aktiver Verbindungsaufbau [Active Connection Setup] must be selected. On the right-hand side of the figure above, you see the Bausteinparameter [Block Parameters] that have to be used together with the FC6 (AG_RECV) function. The connection ID (socket ID) and the address are specified. Click on the Adressen [Addresses] tab. www.addi-data.com 12 Parameterising the PLC Connection to a PLC SIMATIC S7 Fig. 2-4: TCP connection properties: Addresses In Lokal PORT [Local PORT] enter the port number of the S7. This must correspond to the MSX-E module’s port number. In Partner enter the MSX-E module’s IP address and its port number. The port number must agree with the one that was defined on the module’s web interface. To check this, open a web browser (such as Firefox or Internet Explorer) and enter the following address: http://IP address of the module. www.addi-data.com 13 Parameterising the PLC Connection to a PLC SIMATIC S7 A login window is displayed. By default, the user name and password are both: mxadmin. Fig. 2-5: Login window On the web interface, click on the Dataserver menu option. In the Network protocol section, change the port number if you cannot use the default port number. Fig. 2-6: Network protocol: TCP port number www.addi-data.com 14 Parameterising the PLC Connection to a PLC SIMATIC S7 If you have changed the port number, in the Action area click on Save and then on Restart. Fig. 2-7: Dataserver: Action Ensure that in the Blocking TCP/IP transfer section, the activate blocking TCP/IP transfer? option no is selected. Fig. 2-8: Dataserver: Blocking TCP/IP transfer If you have made this change, in the Action area click on Save and then on Restart (see Fig. 2-7). www.addi-data.com 15 Reading the measurement data Connection to a PLC SIMATIC S7 3 Reading the measurement data 3.1 Introduction As already mentioned in chapter 2, ADDI-DATA provides you with an example of an S7 PLC from Siemens. The aim of this is example is to demonstrate how the PLC reads the measurement data of an MSX-E module from a TCP connection. 3.2 Prerequisites Ensure that the following prerequisites are fulfilled: • • • • 3.3 Siemens CPU313C-2DP (PLC) Siemens CP343-1 Lean (Ethernet module for the PLC) FC6 (AG_RECV) for S7-300 (function for asynchronous communication) S7 example for STEP7. S7: Description of the function blocks Fig. 3-1: SIMATIC Manager: List of blocks www.addi-data.com 16 Reading the measurement data Connection to a PLC SIMATIC S7 3.3.1 FC1: Converting data to the Motorola format Description: With the MSX-E modules, the data is displayed in the Intel format, whereas the S7 PLC displays it in the Motorola format. If your PLC already uses the Intel format, you do not need this function block. However, if your PLC works in the Motorola format, you can use this block to convert the values. Input parameters: INTEL: Raw value in the Intel format as a DWORD data type that is read from the MSX-E module Output parameters: MOTOROLA: Value in the Motorola format as a DWORD data type Example of the sequence of function calls: Table 3-1: FC1: Function call sequence FC number Name Description FC6 AG_RECV Read value from the network FC1 INTEL_TO_MOTOROLA. Convert value to the Motorola format www.addi-data.com 17 Reading the measurement data Connection to a PLC SIMATIC S7 3.3.2 FC3: Converting a DWORD data type to a REAL data type Description: On the MSX-E modules the measurement values are coded to 4 bytes and sent via the TCP connection as byte packets. By default the measurement values are sent as raw values. Example: Module MSX-E3011 with Gain 1 Unipolar If 10 volts are measured, the module does not send the value 10, but 65535. This value is designated as a raw value. 65535 is a raw value that is converted to the suitable unit: ((Voltage range/resolution) x raw value) + minimum voltage ((20 / 65535) x 65535) + (-10) = 10 volts If the modules convert the raw values to the appropriate unit immediately and send them, no additional conversion is required on the PLC. The values that are read from the TCP connection should first be displayed correctly and then converted with a type cast to the REAL data type. The type cast is required, because the values that are received cannot be directly sent and received as a REAL type. Input parameters: RAW: Raw value that was converted by the module to the appropriate unit, as a DWORD data type in the Motorola format Output parameters: REAL_VALUE: Type cast value as a REAL data type Example of the sequence of function calls: Table 3-2: FC3: Function call sequence FC number Name Description FC6 AG_RECV Read value from the network FC1 INTEL_TO_MOTOROLA. Convert value to the Motorola format FC3 DWORD_TO_REAL Display value as a REAL type (type cast) 3.3.3 FC4: Converting to millimetres (for transducers Description: www.addi-data.com 18 Reading the measurement data Connection to a PLC SIMATIC S7 This function can be used with the MSX-E370x and MSX-E3711 modules to convert raw values into millimetres. Input parameters: LEN: Value as a REAL data type that defines the transducer path in millimetres RAW: Value as a REAL data type that is already displayed in the Motorola format (see Functional call sequence) Output parameters: MM: Measurement value as a REAL data type in millimetres Example of the sequence of function calls: Table 3-3: FC4: Function call sequence FC number Name Description FC6 AG_RECV Read value from the network FC1 INTEL_TO_MOTOROLA. Convert value to the Motorola format FC3 DWORD_TO_REAL Display value as a REAL type (type cast) FC4 STANDARDIZATION_MM Convert value to millimetres www.addi-data.com 19 Reading the measurement data Connection to a PLC SIMATIC S7 3.3.4 FC7: Converting to volts or mA Description: This function can be used with the MSX-E3011 module to convert raw values into volts. Input parameters: RAW: Value as a REAL data type that is already displayed in the Motorola format (see Functional call sequence) MIN: Value as a REAL data type that defines the minimum voltage value of the voltage range. Example: Module MSX-E3011 With Gain 1 Bipolar, this value is equal to -10 volts. With Gain 2 Bipolar, this value is -5 volts. MAX: Value as a REAL data type that defines the maximum voltage value of the voltage range. Example: Module MSX-E3011 With Gain 1 Bipolar, this value is equal to +10 volts. With Gain 2 Bipolar, this value is +5 volts. RESOLUTION: Value as a REAL data type that defines the resolution of the measurement range. Example: An MSX-E3011 module has a resolution of 16 bit (= 65535 steps). Output parameters: VOLTAGE: Measurement value as a REAL data type in volts www.addi-data.com 20 Reading the measurement data Connection to a PLC SIMATIC S7 Example of the sequence of function calls: Table 3-4: FC7: Function call sequence FC number Name Description FC6 AG_RECV Read value from the network FC1 INTEL_TO_MOTOROLA. Convert value to the Motorola format FC3 DWORD_TO_REAL Display value as a REAL type (type cast) FC7 STANDARDIZATION_VOLT Convert value to volts 3.3.5 FC20: Dynamic Reading of a DWORD Value from a Table Description: This function block is not absolutely necessary. It enables a DWORD value to be read from a DWORD table (which is located in a data block). Instead of a fixed definition of the table index, the latter can be dynamically managed using this block. However, FC20 does not involve any error management (such as error = index > table width). Input parameters: INDEX: Index as an INT data type to be read from the table cell PDB: Data block in which the table is located as a DWORD data type Output parameters: DATA: The value that is read as a DWORD data type www.addi-data.com 21 Reading the measurement data Connection to a PLC SIMATIC S7 3.3.6 FC21: Dynamic writing of a REAL value to a table Description: This function block is not absolutely necessary. It enables a REAL value to be written from a REAL table (which is located in a data block). Instead of a fixed definition of the table index, the latter can be dynamically managed using this block. However, FC21 does not involve any error management (such as error = index > table width). Input parameters: INDEX: Index as an INT data type to be written to the table cell PDB: Data block in which the table is located as a REAL data type DATA: Value to be written as a REAL data type www.addi-data.com 22 Reading the measurement data Connection to a PLC SIMATIC S7 3.3.7 FC6: Reading data from a network connection Description: This function block was created by Siemens and enables data to be read from a network connection. Input parameters: ID: 1 is the number of the communication identifier. LADDR: The value W#16#0100 is the address of the function block. Fig. 3-2: TCP connection properties www.addi-data.com 23 Reading the measurement data Connection to a PLC SIMATIC S7 RECV: This is the indicator in which the data has to be saved; in this case, in DB101. P#DB101.DBX0.0 BYTE 36 means that an indicator to the offset 0 is passed to the DB101 data block (RAW_DATABLOCK) and 36 bytes (9 DWORD) are expected. The number of bytes expected may change as required. Ensure that the table in which the values are saved is sufficiently wide. The number of bytes always corresponds to a data packet. The size of a data packet is specified in the module’s web interface. On the web interface, click on the Acquisition/Autostart menu option. Select the Auto-Refresh or Sequence mode. In the Binary data packet structure or Binary data frame packet structure section, size of a packet in bytes displays the size of the data packet. Fig. 3-3: Acquisition/Autostart: Binary data packet structure www.addi-data.com 24 Reading the measurement data Connection to a PLC SIMATIC S7 If the function block received the values from the MSX-E module, you will see the values in the following sequence in the table for the target data block: RAW[0]: contains the value “counter” RAW[1]: contains the value “channel 1” RAW[2]: contains the value “channel 2” … RAW[9]: contains the value “channel 8” The following example is based on an S7 screenshot (Binary data packet structure) and a data block containing the RAW table as a DWORD data type with a width of 36 bytes. Fig. 3-4: Data block with the RAW table Fig. 3-5: RAW table in the data block Output parameters NDR: If the number of bytes are read and NDR equals 1, then no error occurred. If NDR equals 0, then check ERROR and STATUS to find the errors that are displayed. LEN: This is the number of read bytes. The number must be 36 (= 9 x 4 bytes). www.addi-data.com 25 Simple S7 example Connection to a PLC SIMATIC S7 4 Simple S7 example Please configure networks 1-3 according to the description in the following chapters. 4.1 Configuring the module using the web interface This chapter lists only those steps that are necessary to apply the programming example BasicSample to a module. For a detailed description of the web interface, see Part 3 of the Instruction Manuals Ethernet I/O Modules: Web interface description. You can use the default settings of the BasicSample to configure an acquisition in auto-refresh or sequence mode. You must ensure that, in the sequence mode, the value of the sequence counter is not transmitted by default, whereas in auto-refresh mode this value is always available. For this reason, you have to select the relevant setting on the web interface (see chapter 4.1.2). 4.1.1 Auto-refresh mode On the web interface, from the left-hand side menu, select the Acquisition/Autostart option. In the Type of acquisition section, click on the Auto refresh acquisition mode. From the list below, select the transducer type that is used. It is the same for all channels. www.addi-data.com 26 Simple S7 example Connection to a PLC SIMATIC S7 Define the division factor. In the Channels to acquire area, select the channels you want to acquire. Optional: The module can calculate an average value. You can select the calculation type in the Average mode list. This calculation can be carried out per sequence or per channel. With the per sequence calculation, all selected channels are acquired at once for each sequence. Average value is the value that is used to calculate the average values. www.addi-data.com 27 Simple S7 example Connection to a PLC SIMATIC S7 In the S7 example, the type cast setting (see chapter 4.2.3) is selected by default. You have to select Convert data in mm so that the module immediately converts the raw values into the correct unit. The unit (such as volts) depends on the module type. Click on Convert data in mm. Optional: Select yes to activate Autostart. Optional: Click on Save to save the current configuration. www.addi-data.com 28 Simple S7 example Connection to a PLC SIMATIC S7 To start the acquisition, in the Start/stop acquisition section, click on Start. 4.1.2 Sequence mode On the web interface, from the left-hand side menu, select the Acquisition/Autostart option. In the Type of acquisition section, click on the Sequence acquisition mode. From the list below, select the transducer type that is used. It is the same for all channels. www.addi-data.com 29 Simple S7 example Connection to a PLC SIMATIC S7 Define the division factor. In the Channels area, select the channels you want to acquire. www.addi-data.com 30 Simple S7 example Connection to a PLC SIMATIC S7 Optional: In the Delay section you can define the wait time between the individual sequences. You enter the number of sequences to acquire in the sequences to acquire field. If this value is 0, acquisition is continuous. If it is a value between 1 and 4294967295, the number of sequences is predefined. www.addi-data.com 31 Simple S7 example Connection to a PLC SIMATIC S7 In the S7 example, the type cast setting (see chapter 4.2.3) is selected by default. You have to select Convert data in mm so that the module immediately converts the raw values into the correct unit. The unit (such as volts) depends on the module type. Click on Convert data in mm. In sequence mode, the sequence counter counts the number of sequences that have already been acquired. If Send sequence counter is selected, the sequence counter value is sent in addition to the data. Optional: Select yes to activate Autostart. www.addi-data.com 32 Simple S7 example Connection to a PLC SIMATIC S7 Optional: Click on Save to save the current configuration. To start the acquisition, in the Start/stop acquisition section, click on Start. www.addi-data.com 33 Simple S7 example 4.2 Connection to a PLC SIMATIC S7 S7: Example description 4.2.1 OB1: Main block Description: OB1 (organisation block 1) is executed periodically. As soon as it ends, it starts again. To obtain a simple overview of the entire source code, all function blocks are called from OB1 in BasicSample. 4.2.2 Network 1: Definition of the number of values to read Description: Enter the number of values to read. In this example, 9 values are read. The first value can be a value of the sequence counter, or a value of the 8 channels. If a sequence counter value is expected, set the COUNTER_AVAILABLE variable. If not, this variable should be reset. www.addi-data.com 34 Simple S7 example Connection to a PLC SIMATIC S7 4.2.3 Network 2: Selecting the appropriate conversion unit Description: Before the BasicSample is transmitted to the S7, you need to define in network 2 the conversion unit using the CONVERT_IN variable. CONVERT_IN = 0: The module does not return any raw values, only the converted values (type cast is executed). CONVERT_IN = 1: The module returns raw values. With the MSX-E37xx module, these are converted by the PLC into the unit millimetres. CONVERT_IN = 2: The module returns raw values. With the MSX-E3011 module, these are converted by the PLC into the unit volts. As already mentioned, you can determine on the module’s web interface that the measurement values are converted into the appropriate unit (see chapter 4.1.2: Other information in data packet section). 4.2.4 Network 3: Reading the measurement values from the TCP connection Description: FC6 attempts to read 36 bytes from the MSX-E module from the TCP connection ID 1 and ADDR W#16#100. If no connection errors occurred and the 36 bytes are available, the RCV_NDR variable is set to “true”. The RECV (P#DB101.DBX0.0) input parameter is a pointer to the data. DB101 is a data block to which the 36 bytes are copied (36 bytes = 9 x DWORD). RECV can be adapted as required. If the number of bytes to read was changed, you should also check whether the number of elements in the DB101 and DB102 data blocks is sufficient. For more information, see chapter 3.3.7. www.addi-data.com 35 Simple S7 example Connection to a PLC SIMATIC S7 4.2.5 Network 4: Initialising the index Description: The program uses two data structures. The RAW_DATABLOCK (DB101) structure contains a DWORD table in which the raw values that were read are available. The data structure REAL_DATABLOCK (DB102) contains a REAL table in which the converted raw values are saved as a REAL data type. The INDEX variable is set to 0. INDEX is used to manage the table index dynamically. www.addi-data.com 36 Simple S7 example Connection to a PLC SIMATIC S7 4.2.6 Network 5: Display in Motorola format Description: From the RAW_DATABLOCK table, a raw value is read from the relevant cell in the INDEX. This value is converted from the Intel format (MSX-E module) into the Motorola format (PLC). 4.2.7 Network 6: Managing the sequence counter value Description: If the sequence counter value is expected and the INDEX is 0, then the value is a sequence counter value. The program then jumps into the network that contains the CPT marking. The sequence counter value is always the first value in the table. www.addi-data.com 37 Simple S7 example Connection to a PLC SIMATIC S7 4.2.8 Network 7: Type cast instead of conversion Description: As the module already returns converted values, no additional conversion is required. MOVE copies the DWORD raw values into a variable of the data type REAL (type cast). Afterwards, the program jumps into the network with the marking SAVE. 4.2.9 Network 8: Converting to millimetres Description: The module returns raw values. With FC3, the DWORD raw values are converted to the REAL data type, and with FC4 they are converted into the unit millimetres. Subsequently, the program jumps into the network with the marking SAVE. www.addi-data.com 38 Simple S7 example Connection to a PLC SIMATIC S7 4.2.10 Network 9: Converting to volts Description: The module returns raw values. With FC3, the DWORD raw values are converted to the REAL data type, and with FC7 they are converted into the unit volts. The program then jumps into the network that contains the SAVE marking. 4.2.11 Network 10: Processing the sequence counter value Description: The sequence counter value is converted as a DWORD data type into REAL. Afterwards, the program jumps into the network with the marking SAVE. www.addi-data.com 39 Simple S7 example Connection to a PLC SIMATIC S7 4.2.12 Network 11: Save and check Description: FC21 saves the value in the REAL table. ADD_I increases the INDEX variable so that the next raw value can be read. CMP < I checks whether all raw values were read. If not, then the program jumps into the network with the marking LOOP. www.addi-data.com 40 Recommendations Connection to a PLC SIMATIC S7 5 Recommendations 5.1 Auto-refresh and sequence mode i IMPORTANT! The PLC requires a certain time to read the values from the TCP connection (PLC cycle > acquisition cycle) if you do not configure an average value calculation in the auto-refresh mode, or a delay in the sequence mode. This is also the case if a small “division factor” is configured in both modes. This can result in a delay between the actual status of the channels and the measurement values that are read. If the packets from the TCP connection are not read quickly enough, there may be a FIFO overrun which causes the module to terminate the connection to the PLC. 5.1.1 Acquisition in auto-refresh mode Fig. 5-1: Auto-refresh mode: Acquisition cycle Memory location for 5 values Value: counter Value: chnl 0 Auto-refresh: acquisition cycle: read channels Value: chnl 1 Value: chnl 2 Value: chnl 3 TCP connection Storage DB Value: counter PLC cycle: read values Value: chnl 0 Value: chnl 1 Value: chnl 2 Value: chnl 3 www.addi-data.com 41 Recommendations Connection to a PLC SIMATIC S7 Figure 5-1 displays the acquisition cycle with 4 channels of an MSX-E module in auto-refresh mode (light blue). As only one memory location is available for the 5 values, after each cycle the values of the previous cycle are overwritten with those of the current cycle. The MSX-E module sends the values to the PLC as soon as it is connected. The values from the TCP connection (green) are read in the PLC cycle. MSX-E acquisition cycle (auto-refresh) < PLC cycle -> values may be lost MSX-E acquisition cycle (auto-refresh) > PLC cycle -> all values are received MSX-E acquisition cycle (auto-refresh) = PLC cycle -> all values are received Note: With a socket FIFO overrun, values may be lost. 5.1.2 Acquisition in sequence mode Fig. 5-2: Sequence mode: Acquisition cycle FIFO buffer 0 for 5 values FIFO buffer 1 for 5 values FIFO buffer X for 5 values Value: counter Value: chnl 0 Acquisition cycle: read channels Value: chnl 1 Value: chnl 2 Value: chnl 3 TCP connection Storage DB Value: counter PLC cycle: read values Value: chnl 0 Value: chnl 1 Value: chnl 2 Value: chnl 3 www.addi-data.com 42 Recommendations Connection to a PLC SIMATIC S7 Figure 5-2 displays the acquisition cycle with 4 channels of an MSX-E module in sequence mode (light blue). The values of the current cycle are written to a new FIFO buffer, that is, no values are overwritten. The MSX-E module sends the values to the PLC as soon as it is connected. The values from the TCP connection (green) are read in the PLC cycle. MSX-E acquisition cycle (auto-refresh) < PLC cycle -> all values are received MSX-E acquisition cycle (auto-refresh) > PLC cycle -> all values are received MSX-E acquisition cycle (auto-refresh) = PLC cycle -> all values are received Note: With a socket FIFO overrun, values may be lost. 5.2 Trigger 5.2.1 Introduction With the MSX-E modules, the measurement can be started by a trigger. For more information, see Part 3 of the Instruction Manuals Ethernet I/O Modules: Web interface description. The following information describes how the acquisition start can be controlled using a hardware trigger. Each time that a rising edge is identified at the MSX-E module’s trigger input, the module sends a packet with a sequence counter value and 8 measurement values. www.addi-data.com 43 Recommendations Connection to a PLC SIMATIC S7 5.2.2 Module configuration The configuration described in chapter 4.1.1 (auto-refresh mode) or chapter 4.1.2 (sequence mode) can be used as a basis for defining the following trigger configuration: 5.2.3 BasicSample: Example of trigger enhancement To start the acquisition, you can set a digital output (A124.0) for the module in network 2. This has to be connected with the module’s digital trigger input (Trig/Sync In). www.addi-data.com 44 Recommendations 5.3 Connection to a PLC SIMATIC S7 Querying the current measurement values in auto-refresh mode 5.3.1 Introduction The PLC has the option of querying one or more current measurement values asynchronously (without a hardware trigger). This method can be used if only one or several current measurement values of the module are required at a certain time. The following chapter describes how a current packet containing a sequence counter value and eight measurement values is read. The BasicSample is adapted accordingly for this purpose (see chapter 5.3.3). Note that the transmission time is extended if several PLCs access an MSX-E module simultaneously. 5.3.2 Module configuration The configuration described in chapter 4.1.1 (auto-refresh mode) or chapter 4.1.2 (sequence mode) can be used as a basis. On the web interface under Dataserver, in the Blocking TCP/IP transfer section, for activate blocking TCP/IP transfer? select the option yes. For TCP/IP transfer timeout? you can set a timeout of 2 seconds so that the data server does not permanently block the data. www.addi-data.com 45 Recommendations Connection to a PLC SIMATIC S7 In the Action section, click on Save and then on Restart. Fig. 5-3: Web interface: TCP port number 5.3.3 BasicSample: Adjustment example for querying the measurement values So that you can read the current values, two data packets have to be acquired. Only the second packet is taken into account, as the first packet contains previous measurement values. The BasicSample is adjusted as follows: In network 3, copy function block FC6 and insert it to the right of the original block. www.addi-data.com 46 Recommendations 5.4 Connection to a PLC SIMATIC S7 Connecting several modules to a PLC You can connect several MSX-E modules to a PLC. In this case, for each module you have to create a new TCP connection (socket). To do this, follow the instructions in chapter 2.2 and enter a different port number in the field Eigenschaften – TCP-Verbindung for each module. Fig. 5-4: SIMATIC Manager: S7 Ethernet configuration www.addi-data.com 47 Appendix Connection to a PLC SIMATIC S7 6 Appendix 6.1 Glossary Ethernet Ethernet is a system for connecting a number of computer systems to form a local area network, with protocols to control the passing of information and to avoid simultaneous transmission by two or more systems. Socket A socket is a bidirectional software interface to interprocess (IPC) or network communication. Sockets are a standardised interface (API) between the network protocol implementation of the operating system and the actual application software. IP address This is a unique string of numbers separated by full stops that identifies each computer attached to the Internet. Usually it also has a version containing words separated by full stops. Trigger A trigger is a pulse or signal for starting or stopping a special task. Triggers are often used for controlling data acquisition. Counter A counter is a circuit that counts pulses or measures pulse duration. LSB = least significant bit LSB is the lowest order bit in a digital quantity. MSB = most significant bit MSB is the highest order bit in a digital quantity. PLC = programmable logic controller A PLC is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines. PLCs are used in many different industries and machines such as packaging and semiconductor machines. Unlike generalpurpose computers, the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. A PLC is an example of a real-time system. www.addi-data.com 48 Appendix 6.2 Connection to a PLC SIMATIC S7 Index configuration Ethernet – S7 10 MSX-E module 26 connecting several modules 47 conversion data type 18 millimetres 19, 38 unit 19 volts 20, 39 data block 7 data conversion 8, 17 Big Endian format 9 Little Endian format 9 data format Intel format 9 Motorola format 9 dynamic reading 21 dynamic writing 22 function blocks FC1 17 FC20 21 FC21 22 FC3 18 FC4 19 FC6 23 FC7 20 glossary 48 Intel format 9 www.addi-data.com main block 34 Motorola format 9, 17, 37 network 1 34 network 10 39 network 11 40 network 2 35 network 3 35 network 4 36 network 5 37 network 6 37 network 7 38 network 8 38 network 9 39 OB1 34 organisation block 34 prerequisites S7 16 program overview 8 recommendations 41 trigger 43 trigger enhancement 44 type cast 18, 38 web interface auto-refresh mode 26 sequence mode 29 49 Contact and support Connection to a PLC SIMATIC S7 7 Contact and support Do you have any questions? Write or phone us: Address: ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmünster E-Mail: [email protected] Phone: +49 7229 1847-0 Manual and software download on the Internet: www.addi-data.com www.addi-data.com 50 Instruction Manual Ethernet I/O modules Part 3: Web interface description DIN EN ISO 9001:2000 certified Edition: 02.01-01/2009 Product information This manual contains the technical installation and important instructions for correct commissioning and usage, as well as production information according to the current status before printing. The content of this manual and the technical product data may be changed without prior notice. ADDI-DATA GmbH reserves the right to make changes to the technical data and the materials included herein. Warranty and liability The user is not permitted to make changes to the product beyond the intended use, or to interfere with the product in any other way. ADDI-DATA shall not be liable for obvious printing and phrasing errors. In addition, ADDI DATA, if legally permissible, shall not be liable for personal injury or damage to materials caused by improper installation and/or commissioning of the board by the user or improper use, for example, if the board is operated despite faulty safety and protection devices, or if notes in the operating instructions regarding transport, storage, installation, commissioning, operation, thresholds, etc. are not taken into consideration. Liability is further excluded if the operator changes the board or the source code files without authorisation and/or if the operator is guilty of not monitoring the permanent operational capability of working parts and this has led to damage. Copyright This manual, which is intended for the operator and its staff only, is protected by copyright. Duplication of the information contained in the operating instructions and of any other product information, or disclosure of this information for use by third parties, is not permitted, unless this right has been granted by the product licence issued. Non-compliance with this could lead to civil and criminal proceedings. ADDI-DATA software product licence Please read this licence carefully before using the standard software. The customer is only granted the right to use this software if he/she agrees with the conditions of this licence. The software must only be used to set up the ADDI-DATA boards. Reproduction of the software is forbidden (except for back-up and for exchange of faulty data carriers). Disassembly, decompilation, decryption and reverse engineering of the software are forbidden. This licence and the software may be transferred to a third party if this party has acquired a board by purchase, has agreed to all the conditions in this licence contract and the original owner does not keep any copies of the software. Trademarks • ADDI-DATA, MSX-Box and MSX-E are registered trademarks of ADDI-DATA GmbH. • Turbo Pascal, Delphi, Borland C, Borland C++ are registered trademarks of Borland Software Corporation. • Microsoft .NET, Microsoft C, Visual C++, Windows XP, Windows 98, Windows 2000, Windows 95, Windows NT, Windows EmbeddedNT, Windows Vista, Windows Server 2003, Windows Embedded, Windows Server 2000 and MS-DOS are registered trademarks of Microsoft Corporation. • LabVIEW, LabWindows/CVI, DASYLab, DIAdem are registered trademarks of National Instruments Corporation. • CompactPCI is a registered trademark of PCI Industrial Computer Manufacturers Group. • VxWorks is a registered trademark of Wind River Systems, Inc. • RTX is a registered trademark of Ardence. • SIMATIC S7, S7-300, STEP7, CPU313C-2DP and CP343-1 Lean are registered trademarks of Siemens AG. www.addi-data.com 2 Warning The following risks result from improper implementation and from use of the product contrary to the regulations: Personal injury Damage to the module, PC and peripherals Pollution of the environment Protect yourself, others and the environment! Read the safety precautions (yellow leaflet) carefully! If this leaflet is not enclosed with the documentation, please contact us and ask for it. Observe the instructions of the manual! Make sure that you do not forget or skip any step. We are not liable for damages resulting from a wrong use of the product. Used symbols: i IMPORTANT! Designates hints and other useful information. WARNING! Designates a possibly dangerous situation. If the instructions are ignored, the module, the PC and/or peripherals may be destroyed. WARNING! Designates a possibly dangerous situation. If the instructions are ignored, the module, the PC and/or peripherals may be destroyed and persons may be endangered. www.addi-data.com 3 Contents Web interface description Contents Warning........................................................................................................................................ 3 Chapter overview........................................................................................................................ 6 1 Ethernet I/O Module MSX-Exxxx ..................................................................................... 7 1.1 Introduction .....................................................................................................................................7 1.2 Accessing the Web Interface...........................................................................................................7 1.3 Web Interface Overview..................................................................................................................8 1.3.1 System information..........................................................................................................................8 1.3.2 Network............................................................................................................................................8 1.3.3 Transducers database (MSX-E37xx only) ........................................................................................9 1.3.4 Acquisition/Autostart ......................................................................................................................9 1.3.5 Monitor.............................................................................................................................................9 1.3.6 Dataserver ........................................................................................................................................9 1.3.7 Modbus server..................................................................................................................................9 1.3.8 I/O diagnostic ...................................................................................................................................9 1.3.9 Security .............................................................................................................................................9 1.3.10 System diagnostic.............................................................................................................................9 1.3.11 NTP client..........................................................................................................................................9 1.3.12 Contact us! .......................................................................................................................................9 2 Acquisition modes ......................................................................................................... 10 2.1 Difference Between Auto-Refresh and Sequence Mode ............................................................10 2.2 Auto-Refresh Mode .......................................................................................................................10 2.2.1 Type of acquisition (Acquisition Mode Selection) .......................................................................10 2.2.2 Channels to acquire (Channel Selection)......................................................................................10 2.2.3 Average setup (Calculation of the Average Value).....................................................................11 2.3 Sequence (Sequence Mode) ..........................................................................................................13 2.3.1 Type of acquisition (Acquisition Mode Selection) .......................................................................13 2.3.2 Channels to acquire (Channel Selection)......................................................................................14 2.4 Delay (Wait Time) ..........................................................................................................................14 2.5 Number of sequences to acquire (Number of Sequences)..........................................................17 3 Acquisition Mode of Common Parameters.................................................................. 19 3.1 Trigger configuration ....................................................................................................................19 3.2 Digital trigger input filter (Digital Filter).....................................................................................25 3.3 Autostart (Automatic Acquisition Start) ......................................................................................26 3.4 Action on current configuration (Save the Configuration) ........................................................27 3.5 Other information in data packet / Data frame (Additional Data)............................................28 3.6 Binary data packet structure / Binary data frame packet structure (Packet Format) ...............29 4 MSX-E370x: Specific Information ................................................................................. 30 4.1 Transducer type (Transducer Selection) .......................................................................................30 4.2 Division Factor (Switching Time)...................................................................................................30 4.3 Acquisition time .............................................................................................................................31 5 MSX-E3011: Specific Information ................................................................................. 32 5.1 Conversion time .............................................................................................................................32 5.2 Configure polarity (Polarity Selection) .........................................................................................33 5.3 Configure gain (Gain Selection)....................................................................................................33 6 Network (Network Parameters).................................................................................... 35 6.1 Network configuration..................................................................................................................35 6.2 Syslog (Network Logging) .............................................................................................................35 7 Data server ..................................................................................................................... 36 7.1 Network protocol...........................................................................................................................36 7.2 Blocking TCP/IP transfer ................................................................................................................37 7.3 Data caching ) ................................................................................................................................38 7.4 Action (Save and Restart) ..............................................................................................................40 www.addi-data.com 4 Contents 8 8.1 8.2 9 9.1 9.2 10 Web interface description Monitor ........................................................................................................................... 41 Data monitor (Data Query) ...........................................................................................................41 Configuration details (Configuration Query) ..............................................................................42 Appendix ........................................................................................................................ 43 Glossary...........................................................................................................................................43 Index ...............................................................................................................................................44 Contact and support ...................................................................................................... 45 Figures Fig. 1-1: Fig. 1-2: Fig. 2-1: Fig. 2-2: Fig. 2-3: Fig. 2-4: Fig. 2-5: Fig. 2-6: Fig. 2-7: Fig. 2-8: Login window ............................................................................................................................7 Web interface: System information .........................................................................................8 Acquisition/Autostart: Type of acquisition ............................................................................10 Acquisition/Autostart: Channels to acquire ...........................................................................10 Auto-Refresh Mode: Average setup.......................................................................................11 Average mode: Acquisition per sequence .............................................................................11 Average mode per channel.....................................................................................................12 Average mode: Acquisition per channel................................................................................12 Sequence Mode: Delay ............................................................................................................14 Sequence Mode: Number of sequences to acquire ...............................................................17 Tables Table 2-1: Comparison: Auto-Refresh and Sequence Mode...................................................................10 www.addi-data.com 5 Chapter overview Web interface description Chapter overview In this manual you will find the following information: Content Chapter 1 Overview of the menu on the web interface 2 Explanation of the acquisition modes, average value calculation, delay, etc. 3 Explanation of the trigger modes, filter, Autostart, etc. 4 Specific settings with the MSX-E370x module 5 Specific settings with the MSX-E3011 module 6 Information about changing the network configuration, and network logging 7 Description of the data server 8 Information about using the monitor 9 Appendix containing a glossary and an index 10 Contact and support address www.addi-data.com 6 Ethernet I/O Module MSX-Exxxx Web interface description 1 Ethernet I/O Module MSX-Exxxx 1.1 Introduction The MSX-Exxxx 1 module can be configured in such a way that the acquisition is automatically initialised. This configuration is reloaded when the module powers up. You can use the web interface to configure the module easily and without the need for any programming. 1.2 Accessing the Web Interface Open a web browser (such as Firefox or Internet Explorer) and enter the following address: http://IP address of the module. A login window is displayed. By default, the user name and password are both: mxadmin. Fig. 1-1: Login window 1 MSX-Exxxx = Common name for the Ethernet I/O modules www.addi-data.com 7 Ethernet I/O Module MSX-Exxxx 1.3 Web interface description Web Interface Overview The web interface for the MSX-E modules offers various setting options. Some parts are identical for all MSX-E modules, whereas others – especially those in the data acquisition area – are module-specific. The functions are not always available. When you start the web interface, the following window is displayed: Fig. 1-2: Web interface: System information The web interface (see Fig. 1-2) contains a menu on the left-hand side, its options are explained below. 1.3.1 System information You can use “System information” to display general information about the MSX-E module, such as its serial number, type, IP address, firmware revision, internal temperature, the status of the Ethernet connections, and so on. 1.3.2 Network On this page you can change the configuration of the network settings, such as the IP address and host name (the module’s name on the network). www.addi-data.com 8 Ethernet I/O Module MSX-Exxxx 1.3.3 Web interface description Transducers database (MSX-E37xx only) All transducers that are defined on the MSX-E37xx module are listed on this page. 1.3.4 Acquisition/Autostart The “Autostart” menu option configures the actual acquisition, that is, how the MSX-E module should behave when it is powered up. 1.3.5 Monitor In the “Monitor” area you can display the current measurement values or save them to a file (such as a *.csv file) and subsequently evaluate them (using MS Excel, for example). 1.3.6 Dataserver On this page you can change the settings for the data server that makes the connection to the PLC and sends the measurement values to the PLC. 1.3.7 Modbus server You can use this menu option to configure the Modbus server. 1.3.8 I/O diagnostic Use the “I/O diagnostic” menu option to recognise short circuits and line breaks to the transducer signals. 1.3.9 Security On this page you can configure the MSX-E module’s security settings, such as the password and encryption. 1.3.10 System diagnostic Diagnostic information for the module such as its current status, network status, resources and data traffic is displayed here. 1.3.11 NTP client If you have an NTP server in the network for setting the time, you can enter its IP address here. The MSX-E module will set the time automatically when it is powered up. 1.3.12 Contact us! Use the “Contact us!” menu option to display the ADDI-DATA contact data. www.addi-data.com 9 Acquisition modes Web interface description 2 Acquisition modes 2.1 Difference Between Auto-Refresh and Sequence Mode Table 2-1: Comparison: Auto-Refresh and Sequence Mode Auto refresh Sequence Trigger Yes Yes Average value Yes No Delay No Yes Value history No Yes Under conditions No Query asynchronous values 2.2 Auto-Refresh Mode Auto-Refresh mode enables you to acquire one or more channels. The acquisition can be started by a trigger. An average value can be calculated directly in the module. On the web interface, from the left-hand side menu, select the Acquisition/Autostart option. 2.2.1 Type of acquisition (Acquisition Mode Selection) Fig. 2-1: Acquisition/Autostart: Type of acquisition In the Type of acquisition section, select the Auto refresh acquisition mode. 2.2.2 Channels to acquire (Channel Selection) Fig. 2-2: Acquisition/Autostart: Channels to acquire In the Channels to acquire area, select the channels you want to acquire. www.addi-data.com 10 Acquisition modes 2.2.3 Web interface description Average setup (Calculation of the Average Value) The module can calculate an average value. You can select the calculation type in the Average mode list (see Fig. 2-3). This calculation can be carried out per sequence or per channel. With the per sequence calculation, all selected channels are acquired in one go for each sequence. Average value (see Fig. 2-3) is the value that is used to calculate the average values. Fig. 2-3: Auto-Refresh Mode: Average setup Example The module is parameterised with the average mode per sequence and acquires channels 1 to 8. Average value contains the value 10. This means that a sequence consists of eight channels and it is acquired ten times. (As such, each channel is also acquired ten times.) Fig. 2-4: Average mode: Acquisition per sequence A sequence consists of one or more channels, but for each acquisition it consists of the same number of channels. Here, for example, it consists of eight channels. Ch1 Ch2 Ch3 Ch4 Ch5 Ch6 Ch7 Ch8 Sequence 2 Sequence 1 Sequence 3 Sequence 4 Sequence 5 Sequence 6 Sequence 7 Sequence 8 Sequence 9 Sequence 10 After these ten sequences have been acquired, the module performs the following calculation: Average value of channel 1 = (sequence 1, value channel 1 + sequence 2, value channel 1 + … + sequence 10, value channel 1) / 10 Average value of channel 2 = (sequence 1, value channel 2 + sequence 2, value channel 2 + … + sequence 10, value channel 2) / 10 … Average value of channel 8 = (sequence 1, value channel 8 + sequence 2, value channel 8 + … + sequence10, value channel 8) / 10 www.addi-data.com 11 Acquisition modes Web interface description The network client will not receive ten sequences, but only one data packet with the average values from channels 1 to 8. With the per channel calculation, each selected channel is acquired as often as corresponds to the value of the Average value. Fig. 2-5: Average mode per channel Example The module is parameterised with per channel and acquires channels 1 to 8. Average value contains the value 10. This means that each channel is acquired ten times. Fig. 2-6: Average mode: Acquisition per channel A packet consists of one channel that is acquired ten times. A packet consists of one channel that is acquired ten times. Ch1 Ch1 Ch1 Ch1 Ch1 Ch1 Ch1 Ch1 Ch1 Ch1 Channel 2 10 x Channel 1 10 x Channel 3 10 x Channel 4 10 x Ch7 Ch7 Ch7 Ch7 Ch7 Ch7 Ch7 Ch7 Ch7 Ch7 Channel 5 10 x Channel 6 10 x Channel 7 10 x Channel 8 10 x After these eight packets have been acquired, the module performs the following calculation: Average value of channel 1 = (value channel 1 + value channel 1 + … + value channel 1) / 10 Average value of channel 2 = (value channel 2 + value channel 2 + … + value channel 2) / 10 … Average value of channel 8 = (value channel 8 + value channel 8 + … + value channel 8) / 10 www.addi-data.com 12 Acquisition modes Web interface description The network client will not receive eight packets, but only one data packet with the average values from channels 1 to 8. With Average mode, if the option none is selected, the average value calculation is deactivated. 2.3 Sequence (Sequence Mode) The Sequence mode enables you to acquire one or more channels. The acquisition can be started by a trigger. There is a definable delay between the individual sequences. On the web interface, from the left-hand side menu, select the Acquisition/Autostart option. 2.3.1 Type of acquisition (Acquisition Mode Selection) In the Type of acquisition section, select the Sequence acquisition mode. www.addi-data.com 13 Acquisition modes 2.3.2 Web interface description Channels to acquire (Channel Selection) In the Channels area, select the channels you want to acquire. You can define the sequence of the channels. A channel can be acquired several times per sequence. 2.4 Delay (Wait Time) In the Delay section you can define the wait time between the individual sequences. There are two modes, which are explained below. Fig. 2-7: Sequence Mode: Delay With time unit you can define the unit of the delay in milliseconds (ms) or seconds (second). Enter the value of the delay in the Delay value. The minimal delay value displays the minimal value of the delay. For mode, if you select option none, no delay is used. www.addi-data.com 14 Acquisition modes Web interface description Mode 1 The time between the start of two subsequent sequences is defined as the delay. Example After the start of the acquisition (see the “Start” button in the Start/stop acquisition section), the delay between the start of the individual sequences is 300 ms. Start enable Erfassung 300 ms www.addi-data.com 15 300 ms 300 ms Acquisition modes Web interface description Mode 2 The time between the end of a sequence and the start of the subsequent sequence is defined as the delay. Example After the start of the acquisition (see the “Start” button in the Start/stop acquisition section), the delay between the end and the start of the individual sequences is 2 s. Start enable Acquisition 2s www.addi-data.com 16 2s 2s Acquisition modes 2.5 Web interface description Number of sequences to acquire (Number of Sequences) Fig. 2-8: Sequence Mode: Number of sequences to acquire You enter the number of sequences to acquire in the sequences to acquire field. If this value is 0, the acquisition is continuous. If it is a value between 1 and 4294967295, the number of sequences is predefined. Example To acquire four sequences, the sequences to acquire field must contain the value 4. As a result, when you start (see the “Start” button in the Start/stop acquisition section), four sequences are acquired. Start enable Acquisition www.addi-data.com 17 Acquisition modes Web interface description In the sequences before sending field, you define the maximum number of sequences that have to be acquired before the measurement values are sent to the target system. If the module does not have sufficient memory to store the required number of sequences, the measurement values are sent earlier, that is, before the maximum number of sequences to be acquired is reached. sequences before sending is used to reduce the network traffic load and the CPU resources of the MSX-E modules. Example When you start (see the “Start” button in the Start/stop acquisition section), the acquisition begins. If two sequences are acquired, the measurement values are sent to the client. Start enable Acquisition Send 2 seq. www.addi-data.com 18 Send 2 seq. Acquisition Mode of Common Parameters Web interface description 3 Acquisition Mode of Common Parameters 3.1 Trigger configuration The acquisition can be started by an external signal. This can be a digital input signal or a synchronisation signal. For Trigger source, if the option disabled is selected, the trigger is not used. For Trigger source, if the option hardware is selected, the hardware trigger takes place using the module’s trigger input. The hardware trigger enables the start of the acquisition to be controlled with a digital signal (24 volt). The digital output of a PLC can start one or more acquisitions on the module. The hardware trigger input can also be used to synchronise the MSX-E module with another module. The hardware trigger signal can be passed from one module to another. www.addi-data.com 19 Acquisition Mode of Common Parameters Web interface description With Trigger mode, if the one-shot trigger mode is selected, only one acquisition starts. With Trigger mode, if the option sequence (= multi-shot) is selected, a defined number of acquisitions starts. Hardware trigger count defines the number of edges after which an acquisition is started. In the sequence trigger mode, Number of sequence(s) per trigger defines the number of sequences that are acquired after a trigger. The Hardware trigger active edge field defines the type of edge with which the module identifies a trigger. Examples of edges Rising: Rising edge Start enable Software / Hardware trigger Acquisition Falling: Falling edge Start enable Software / Hardware trigger Acquisition Both: Rising and falling edges Start enable Software / Hardware trigger Acquisition www.addi-data.com 20 Acquisition Mode of Common Parameters Web interface description Examples of hardware triggers with one-shot 1) To start the one-shot acquisition after three rising edges, you can use the following parameters: After the start (see the Start button in the Start/stop acquisition section), the module waits for three rising hardware edges. Once the three edges have been identified, the acquisition starts. Start enable Software / Hardware trigger Acquisition 2) With Hardware trigger active edge, rising is selected again, and the value 1 is entered for Hardware trigger count. The trigger starts only one acquisition, which begins with the first hardware edge after you start (see the Start button in the Start/stop acquisition section). Start enable Software / Hardware trigger Acquisition www.addi-data.com 21 Acquisition Mode of Common Parameters Web interface description 3) With Hardware trigger active edge, both is selected, and the value 3 is entered for Hardware trigger count. After you start (see the Start button in the Start/stop acquisition section), the module waits for three rising and falling hardware edges. Once the three edges have been identified, the acquisition starts. Start enable Software / Hardware trigger Acquisition 4) With Hardware trigger active edge, both is selected again, and the value 1 is entered for Hardware trigger count. If several edges occur after you start (see the Start button in the Start/stop acquisition section), the acquisition is started (triggered) with the first edge. The subsequent edges are ignored. Start enable Software / Hardware trigger Acquisition www.addi-data.com 22 Acquisition Mode of Common Parameters Web interface description Examples of hardware triggers with sequence 1) To start each acquisition after one rising edge, you can use the following parameters: Start enable Software / Hardware trigger Acquisition 2) For Hardware trigger active edge, both is selected and Hardware trigger count contains the value 3. After you start (see the Start button in the Start/stop acquisition section), the acquisition is started after three rising and falling edges. At the end of this sequence, the next sequence is started after three rising and falling edges, and so on. Start enable Software / Hardware trigger Acquisition www.addi-data.com 23 Acquisition Mode of Common Parameters i Web interface description IMPORTANT! Edges that occur during an acquisition are ignored. Only those edges are considered that occur after the end of an acquisition (see the previous and following examples). Start enable Software / Hardware trigger Acquisition 3) The settings correspond to example 2 with the exception of Number of sequence(s) per trigger, where value 2 is entered. Two sequences are acquired for each trigger. Start enable Software / Hardware trigger Acquisition www.addi-data.com 24 Acquisition Mode of Common Parameters Web interface description Synchro trigger In contrast to a hardware trigger, a synchro trigger is created from a different MSX-E module. As a result, several MSX-E modules can be acquired in parallel. You can select one-shot and sequence trigger modes, just like with the hardware trigger. 3.2 Digital trigger input filter (Digital Filter) To suppress interference from external trigger signals, you can use a digital filter which is configured via software. You can define filter times of 250 ns to 16.38 ms. If the filter is activated, each positive or negative impulse that is less than the defined filter time is suppressed. Value 1 corresponds to a filter time of 250 ns. no deactivates the filter; it is activated with yes. Example 1 Filter value contains the value 65535. The calculation is as follows: 65535 x 250 ns = 16.38 ms. This time corresponds to a frequency of approximately 30.5 Hz. If the trigger signal is faster than 30.5 Hz, it is suppressed. Example 2 The acquisition should be triggered after a rising edge. Trigger 15ms ~4ms Acquisitio n www.addi-data.com 25 ~4ms 15ms Acquisition Mode of Common Parameters Web interface description The trigger signal always lasts longer than 10 ms. However, as it is not clean and bounces, this creates short spikes of ~4 ms. So that these bouncing signals are no longer identified as triggers, a filter of 10 ms is configured. 3.3 Trigger signal duration > 10 ms: Trigger identified as a trigger Trigger signal duration < 10 ms: Trigger is ignored Autostart (Automatic Acquisition Start) As soon as the MSX-E modules are switched on, they can load a predefined configuration and execute it. In other words, the acquisition is started automatically when the module is powered up. Select yes to activate Autostart. You can also use the current configuration as the autostart configuration. Click on Save to save the current configuration. www.addi-data.com 26 Acquisition Mode of Common Parameters 3.4 Web interface description Action on current configuration (Save the Configuration) The Check button tests the current configuration. If a configuration parameter is not correct, an error message is displayed. Save saves the current configuration on the module. Reload saved loads the saved configuration. The Display running configuration button restores the module’s current configuration on the website. f i IMPORTANT! The configuration determined on the web interface is saved locally, that is, only on the module itself. However, it is possible to read the configuration from the module using a computer using the direct access sample MSX-E Common\ Direct Access Samples\Visual C++ 6.0\AutoConfig and to save it to a file on the computer or a different storage medium. The externally saved configuration can also be loaded back onto the module using the same sample. www.addi-data.com 27 Acquisition Mode of Common Parameters 3.5 Web interface description Other information in data packet / Data frame (Additional Data) By default, only the acquisition values are sent to the client. However, if you activate the following options, it can also receive additional information. In sequence mode, the sequence counter counts the number of sequences that were already acquired. If Send sequence counter is activated, the sequence counter’s value is sent in addition to the data. Send time stamp with data: A time stamp is sent that contains the date of the acquisition. Convert data in… or Data in analogue format: With this option, the module can convert the raw values immediately to the correct unit. The unit depends on the module type. For a MSX-E37xx module, the unit is millimetre (mm); for a MSX-E3011 module volts or amps. As the conversion affects the MSX-E CPU to a certain extent, this can result in slower send speed times. Invert value inverts the value signs, for example -5 is sent instead of 5. www.addi-data.com 28 Acquisition Mode of Common Parameters 3.6 Web interface description Binary data packet structure / Binary data frame packet structure (Packet Format) The module sends the data over the network to one or more clients. So that the client can interpret the values correctly, the values are formatted. This format is defined as Binary data packet structure or Binary data frame packet structure (the name depends on the module type). All measurement values and the additional data such as the time stamp form a group of values that are called a packet. The packet size is displayed in size of a packet in bytes. i IMPORTANT! The module sends the packets in the Intel format (Little Endian). Example A packet consists of a counter value and eight measurement values. The module always sends one or more of these packets. The data client should be programmed in such a way that it can receive a packet and interpret it correctly. www.addi-data.com 29 MSX-E370x: Specific Information Web interface description 4 MSX-E370x: Specific Information The following information can be found under the Acquisition/Autostart menu option. 4.1 Transducer type (Transducer Selection) From the list below, select the transducer type that is used. This is the same for all channels. 4.2 Division Factor (Switching Time) The division factor specifies the number of periods that are required by the A/D converter to switch from one channel to another, that is, to switch from the voltage level of the first channel to the voltage level of the second channel. The duration of a period is calculated from the transducer’s scanning frequency. The higher the division factor, the more precise the result, although this slows down the measurement. www.addi-data.com 30 MSX-E370x: Specific Information 4.3 Web interface description Acquisition time The duration of the measurement is calculated automatically. www.addi-data.com 31 MSX-E3011: Specific Information Web interface description 5 MSX-E3011: Specific Information The following information can be found under the Acquisition/Autostart menu option. 5.1 Conversion time Conversion time determines the switching time that is required from one to the other channel. The unit of this conversion time can be defined as microseconds, milliseconds or seconds. The range in which the conversion time can lie is based on the unit that is selected: Microseconds: 10 to 65535 Milliseconds: 1 to 65535 Seconds: 1 to 65535 If only one channel is selected, this parameter is insignificant. www.addi-data.com 32 MSX-E3011: Specific Information 5.2 Web interface description Configure polarity (Polarity Selection) For each channel that is selected, you can define the polarity. Unipolar and Bipolar are available options. With Unipolar, the module measures only the values in the positive range from 0 volts or amps. With Bipolar, the values in the negative range are also measured. The size of each relevant measurement area depends on the selected gain (see the following chapter 5.3). In the figure above, channels 11 to 16 are missing. 5.3 Configure gain (Gain Selection) The Gain enables the measurement to be adapted to the input voltage range or the input current range to achieve greater precision. Two gain types are available. The size of each measurement area depends on the gain and the polarity: Gain 1 Unipolar: 0 to +10 volts or 0 to 20 mA Gain 1 Bipolar: www.addi-data.com -10 to +10 volts or -20 mA to +20 mA Gain 2 Unipolar: 0 to +5 volts or 0 to 20 mA Gain 2 Bipolar: or -20 mA to +20 mA -5 to +5 volts 33 MSX-E3011: Specific Information Web interface description Example Gain 1 in Unipolar 16 Bit: (10 / 65535) = 1 Bit (corresponds to approx. 0.0001525 V) Gain 2 in Unipolar 16 Bit: (5 / 65535) = 1 Bit (corresponds to approx. 0.00007695 V) i IMPORTANT! We recommend using gain 2 for current measurements. www.addi-data.com 34 Network (Network Parameters) Weboberflächen-Beschreibung 6 Network (Network Parameters) Using this menu option on the web interface, you can change your module’s network configuration. 6.1 Network configuration In the Network address of the module field, enter an IP address in the form 127.0.0.1 and click on Save. The new value is used when the module is restarted. In the Network hostname field you can enter up to 64 characters. This change takes immediate effect when you click on Save. 6.2 Syslog (Network Logging) The module can send logging information to a system in the network by using the syslog protocol. In the Syslog Target field, enter the IP address of the system that receives the information and click on Save. If the Syslog Target field remains empty, this function is deactivated. The Syslog Port field contains the port number (UDP) that should be used. This is between 1 und 65535. 514 is defined as the default value. The new configuration takes effect when the module is restarted. www.addi-data.com 35 Data server Web interface description 7 Data server The data server is the network service that delivers the acquired data to clients via TCP/IP or UDP sockets. 7.1 Network protocol The data server supports both TCP/IP and UDP/IP protocols. TCP/IP mode This mode is based on the client/server programming model. Clients have to be first connected to the server and read data on the socket. This protocol guarantees the packet delivery; otherwise the connection will fail. In the TCP port number field, enter the port number that is used to create the connection with the module. The default port number is 8989. i IMPORTANT! A maximum of five clients can be connected to the server simultaneously. This applies to all MSX-E modules from firmware revision 3230. UDP/IP mode The UDP/IP mode is based on the programming model of separated data streams. The data server sends data packets to the defined network client(s). The client has to open a socket and read data. The delivery of data packets is not guaranteed, since the data server cannot check whether the delivery was successful. You have to specify UDP/IP clients precisely to the data server in the UDP/IP network targets field. In the UDP/IP network targets, enter a character string of the IP address and port number, separated by a blank space, as shown below: IP1:PORT1 IP2:PORT2 ... IPn:PORTn. Example: 192.168.99.2:8080 192.168.99.3:8888 www.addi-data.com 36 Data server 7.2 Web interface description Blocking TCP/IP transfer In this mode you can define a TCP/IP timeout in the form s.μs. With the value “1.0", the timeout is 1 second, that is, the server waits one second for a read confirmation from the data client. At the same time, it blocks the reading of the acquired data. If it does not receive the client’s confirmation after a second, the connection to this client is broken. If it does, then the data server continues with calling up the acquired data. With the value “0.0”, the server would permanently block the data as it would wait constantly for a read confirmation from the data client. If the option yes is selected for activate blocking TCP/IP transfer, although the data server’s throughput rate is reduced, this is an advantage if the connection with the client is unexpectedly blocked. If for activate blocking TCP/IP transfer the option no is selected, the actual TCP/IP timeout corresponds to the protocol’s permitted minimum. In this mode, network problems are easier to identify than with the yes mode; moreover, the server’s throughput rate is higher. www.addi-data.com 37 Data server 7.3 Web interface description Data caching ) i IMPORTANT! You can only use the cache in TCP mode. By default, the values that are acquired by the MSX-E module are lost unless at least one client is connected that reads them. The data server can cache the data so that no data is lost. If a client is connected, it first receives the cached data and only then does it receive the newly acquired data. Data caching mode The data server can work in either Volatile mode or in Persistent mode. Volatile: In this mode, the data is cached in the RAM buffer. However, this data is lost when the module is switched off. A high throughput rate is reached in Volatile mode. Persistent: The data is cached internally in a file. If the module is restarted, the previously acquired data is still available. i IMPORTANT! The storage method means that you achieve a lower throughput rate with the Persistent mode than with the Volatile mode. Read mode The data server can delete or keep data if a client is connected. Delete mode: The cache is not used in this mode. Newly acquired data is not cached, but sent via TCP/IP directly to the connected clients Keep mode: Data is systematically cached in the cache without being deleted there. www.addi-data.com 38 Data server Web interface description Write mode The data server can work in Simple mode or in Circular mode. These modes define the procedures in the event of a cache overrun. Simple mode: Newly acquired values are ignored if the cache is full. Circular mode (ring buffer): If the cache is full, the oldest values are overwritten by the newest ones. If a client is connected, it receives the older values first. This mode is recommended if you use a time stamp. Example with a ring buffer containing a maximum of 7 values: 1) Data 0 is the oldest measurement value and Data 6 the newest. The ring buffer is full. If a client is connected, then the data is sent from Data 0. The next value sent is Data 1. Data 0 Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 2) When new measurement values are saved, the oldest values are overwritten. Data 7 If a client is connected, the data is sent from Data 2. The next value sent is Data 3. Data 8 Data 2 Data 3 Data 4 Data 5 Data 6 www.addi-data.com 39 Data server Web interface description Cache size in bytes An additional parameter is the cache size. This is the number of bytes that the cache can handle. The maximum value depends on the number that is available to the storage medium. To avoid the risk of the system crashing, the server allocates at most 80% of available resources, that is, 20% of the memory remains free. Note that in persistent mode, 16 bytes are used for saving metadata. To maintain the actual memory size for data, this has to be deducted from the cache memory size. 7.4 Action (Save and Restart) If you click on Save, the module saves your new configuration. This is reused each time the system starts. The Reload button reloads the website with the saved configuration. Any changes that were not saved will be lost. Click on Restart to restart the data server. If you click on Restart & reset, the data server is restarted. If the data server was configured in Persistent mode, the content of the cache file is deleted. i IMPORTANT! If you have changed the configuration, you first have to save it by clicking on Save and then click on Restart & delete to restart the data server and to empty the cache. www.addi-data.com 40 Monitor Web interface description 8 Monitor During an acquisition, you can use this page to display the data that was acquired by the module and the current configuration. On the web interface, select the Monitor menu option. i IMPORTANT! Display the monitor as the acquisition is running. To stop the acquisition, you have to use the Acquisition/Autostart menu option to switch to the Start/stop acquisition area. 8.1 Data monitor (Data Query) You can display the data either directly on the web interface, or export it to a CSV file and open it using MS Excel. The number of packets to be acquired (max. 100,000) is defined in the Number of data packets to acquire field; the output format is defined in Output format of data field. Click on the Show data in this page button to display the data from the data server, or click on Retrieve data as CSV file if you want to call up the data in a CSV file. i IMPORTANT! If you have a high number of packets and low computer speed, it may take a lot of time before the data is displayed on the website. www.addi-data.com 41 Monitor 8.2 Web interface description Configuration details (Configuration Query) This section displays the configuration settings. www.addi-data.com 42 Appendix Web interface description 9 Appendix 9.1 Glossary Ethernet Ethernet is a system for connecting a number of computer systems to form a local area network, with protocols to control the passing of information and to avoid simultaneous transmission by two or more systems. Trigger A trigger is a pulse or signal for starting or stopping a special task. Triggers are often used for controlling data acquisition. Counter A counter is a circuit that counts pulses or measures pulse duration. IP address This is a unique string of numbers separated by full stops that identifies each computer attached to the Internet. Usually it also has a version containing words separated by full stops. PLC = programmable logic controller A PLC is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines. PLCs are used in many different industries and machines such as packaging and semiconductor machines. Unlike generalpurpose computers, the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. A PLC is an example of a real-time system. Socket A socket is a bidirectional software interface to interprocess (IPC) or network communication. Sockets are a standardised interface (API) between the network protocol implementation of the operating system and the actual application software. www.addi-data.com 43 Appendix 9.2 Web interface description Index acquisition mode Auto-Refresh Mode 10 average value calculation 11 Sequence Mode 13 autostart 26 data caching 38 data server 36 delay 14 glossary 43 monitor 41 MSX-E3011 32 conversion time 32 gain 33 polarity 33 MSX-E370x 30 acquisition time 31 switching time 30 network configuration 35 network logging 35 network parameters 35 network protocol 36 www.addi-data.com packet format 29 sequences 17 synchro trigger 25 time stamp 28 trigger configuration 19 filter 25 synchro trigger 25 Web interface access 7 Acquisition/Autostart 9 Contact us 9 Dataserver 9 I/O diagnostic 9 Modbus server 9 Monitor 9 Network 8 NTP client 9 Security 9 System diagnostic 9 System information 8 Transducers database 9 44 Contact and support 10 Web interface description Contact and support Do you have any questions? Write or phone us: Address: ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmünster E-Mail: [email protected] Phone: +49 7229 1847-0 Manual and software download on the Internet: www.addi-data.com www.addi-data.com 45