Data Bulletin. Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network



Similar documents
How to Mimic the PanelMate Readout Template with Vijeo Designer

Ethernet/IP Explicit Messaging Using Unity Software

SCADAPack E ISaGRAF 3 User Manual

Siemens AG. SIMATIC S7 Ethernet 04/

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

Historian SQL Server 2012 Installation Guide

Modicon M580 Change Configuration On The Fly User Guide

StruxureWare Power Monitoring 7.0.1

Configuring PCAN-Explorer to Monitor Data Traffic on a CANopen Network

The Answer to the 14 Most Frequently Asked Modbus Questions

Variable speed drives for synchronous and asynchronous motors

SLC 5/05 Processors Firmware/Operating System ControlFLASH Upgrade

ethernet connection For more information about the printer's ethernet feature, click the topic below: ethernet lights network configuration page

How To Configure An Iec (Runtu) For A Testnet (Rntu)

Configuring security in ION devices using ION Setup

PLC training panel (Twido version)

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

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

Micro800 Programmable Controllers: Getting Started with CIP Client Messaging

SIMATIC. S Getting started with S Preface. Quick review 1. Installation 2. Create a simple latch circuit 3. Complete the user program 4

User Manual Revision English

Modbus and ION Technology

MicroLogix 1400 Embedded Web Server

User Manual Revision English

BASLER ACE QUICK INSTALLATION GUIDE

User Manual Revision English

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

Logix5000 Controllers Import/Export Project Components

Section 5: Installing the Print Driver

CMP-102U. Quick Installation Guide

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

HP ProLiant DL380 G5 High Availability Storage Server

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

Lifecycle Service Tool. Operator's manual

Modicon M340 Peripheral Remote I/O Adapter BMX PRA 0100 User Manual

Using KEPServerEX OPC Server (Kepware)with the iologik E2210

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

Square D Clipsal Two-Channel DIN-Rail DALI Gateway

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

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

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

Easy Setup Guide for the Sony Network Camera

Modbus and ION Technology

Safety Function: Door Monitoring

Unity Pro. Unity Loader User Manual 07/2008 eng

Installation and Operation Guide

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

User Manual. DeviceNet Network Configuration

User Manual Revision English

User Manual Revision English

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

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

WinCC Runtime Professional Readme SIMATIC HMI. WinCC V11 SP1. Readme WinCC Runtime Professional. Special considerations for Windows 7.

Work with Arduino Hardware

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

SOHO 6 Wireless Installation Procedure Windows 95/98/ME with Internet Explorer 5.x & 6.0

Quick Guide: Troubleshooting Info from SNAP PAC Systems

Pulse Redundancy. User Guide

Power Monitoring Expert 7.2

Windows Vista / Windows 7 Installation Guide

AC 800M. EtherNet/IP DeviceNet Linking Device LD 800DN. Power and productivity for a better world TM SP1134

PROFINET IRT: Getting Started with The Siemens CPU 315 PLC

User Manual Revision English

Wireless LAN g USB Adapter

Profinet to EDV111 Series LED Signs Siemens Function Block Software Manual

Stratix 5700 Switch Configuration

EDGE FX Network configuration

Section 5: Connecting the Laser to Your Computer

User Manual Gigabit Ethernet Vision Quick Start Guide

TECHNICAL NOTE TNOI34

MicroLogix 1100 Embedded Web Server

MBP_MSTR: Modbus Plus Master 12

Modbus ASCII Driver Kepware, Inc.

Back-up Server DOC-OEMSPP-S/2014-BUS-EN-10/12/13

Event Notification Module TM

CONTROL MICROSYSTEMS DNP3. User and Reference Manual

Fiery E100 Color Server. Welcome

User Manual Revision English

Setup Manual and Programming Reference. RGA Ethernet Adapter. Stanford Research Systems. Revision 1.05 (11/2010)

FactoryTalk ViewPoint Quick Start Guide

How To Use Mview On A Powerline 2.2 (Powerline) On A Pc Or Macbook 2 (Powerplst) On An Iphone Or Ipa 2 (Aldo) On Your Iphon 2 (

SIMATIC S Getting Started for First Time Users. Order No.: 6ZB5310-0NC02-0BA0 04/2007 A5E

Modbus RTU (RS-485) TCP/IP (Ethernet)

Ethernet Radio Configuration Guide

RouteFinder SOHO. Quick Start Guide. SOHO Security Appliance. EDGE Models RF825-E, RF825-E-AP CDMA Models RF825-C-Nx, RF825-C-Nx-AP

CompactLogix 5370 L1 Controllers

Enabling Internet Connection Sharing on Windows Enabling ICS On Windows XP As The Host 4 Enabling ICS On Windows XP As The Client 11

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

SCADAPack E DNP3 Technical Reference

M-series Virtual I/O Module 2

SIMATIC HMI. WinCC flexible 2008 Getting Started - First-Time Users Getting Started. Printout of the Online Help 06/2008 A5E

Sharpdesk V3.5. Push Installation Guide for system administrator Version

Windows Vista Installation Guide

UPS System Capacity Management Configuration Utility

Configuring the WT-4 for ftp (Infrastructure Mode)

Additional Requirements for ARES-G2 / RSA-G2. One Ethernet 10 Base T/100 Base TX network card required for communication with the instrument.

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

User Manual Revision English Converter / Adapter Ethernet to RS232 / RS485 (Order Code: HD HD M HD HD M)

2 Setting Up the Hardware for a Wired Ethernet Network Setting Up the Software for an Ethernet Network... 21

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

Transcription:

Data Bulletin 8000DB0705 10/2009 Raleigh, NC, USA Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network Retain for future use. Overview This bulletin describes how to connect a Magelis XBTGT HMI to an ELAU PacDrive controller via a Modbus TCP/IP network. Modbus open communication protocol is used to send data between devices. Modbus architecture consists of a Modbus master, responsible for requesting the data, and a Modbus slave, responsible for supplying the data. A standard Modbus network has one Modbus master and up to 247 Modbus slaves. Presumption Requirements CANopen This bulletin is written for an Ethernet user and assumes familiarity with Ethernet networks. If you are not familiar with Ethernet, please consult your system administrator before connecting this module to your network. The following hardware and software is required. Hardware Magelis XBTGT, Ethernet version ELAU PacDrive controller CAT5 Ethernet cable with RJ-45 connectors on both ends Crossover cable (used to directly connect to the PacDrive controller) Straight-through cable (used for connection to the PacDrive controller via a switch or hub) Switch or hub (optional but recommended) Software Vijeo Designer V4.5.1 or higher EPAS-4 version V00.22.02 or higher Safety Information Notice Read these instructions carefully, and look at the equipment to become familiar with the device before trying to install, operate, or maintain it. The following special messages may appear throughout this documentation or on the equipment to warn of potential hazards, or to call attention to information that clarifies or simplifies a procedure.

Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 8000DB0705 Safety Information 10/2009 A lightning bolt or ANSI man symbol in a Danger or Warning safety label on the equipment indicates an electrical hazard which, as indicated below, can or will result in personal injury if the instructions are not followed. The exclamation point symbol in a safety message in a bulletin indicates potential personal injury hazards. Obey all safety messages introduced by this symbol to avoid possible injury or death. Symbol Name Lightning Bolt ANSI Man Exclamation Point DANGER DANGER indicates an imminently hazardous situation which, if not avoided, will result in death or serious injury. Qualified Personnel WARNING WARNING indicates a potentially hazardous situation which, if not avoided, can result in death or serious injury. CAUTION CAUTION indicates a potentially hazardous situation which, if not avoided, can result in minor or moderate injury. CAUTION CAUTION, used without the safety alert symbol, indicates a potentially hazardous situation which, if not avoided, can result in property damage. For the protection of personnel and equipment, a qualified person must perform the procedures detailed in this bulletin. A qualified person is one who has skills and knowledge related to the construction and operation of this electrical equipment and the installation, and has received safety training to recognize and avoid the hazards involved. Refer to the most current release of NFPA 70E, Standard for Electrical Safety in the Workplace, for safety training requirements. In addition, the person must be: Able to read, interpret, and follow the instructions and precautions in this data bulletin and the other documentation referenced. Able to use the required tools listed in this data bulletin in a safe and correct manner. 2

8000DB0705 Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 10/2009 Safety Information Before You Begin Do not use this product on machinery lacking effective point-of-operation guarding. Lack of effective point-of-operation guards on a machine can result in serious injury to the operator of that machine.. WARNING UNGUARDED MACHINERY CAN CAUSE SERIOUS INJURY Do not use this software and related automation equipment on equipment which does not have point-of-operation protection. Do not reach into machinery during operation. Failure to follow these instructions can result in death, serious injury, or equipment damage. This automation equipment and related software is used to control a variety of industrial processes. The type or model of automation equipment suitable for each application will vary depending on factors such as the control function required, degree of protection required, production methods, unusual conditions, and government regulations. In some applications, more than one processor may be required, as when backup redundancy is needed. Only the user can be aware of all the conditions and factors present during setup, operation, and maintenance of the machine; therefore, only the user can determine the automation equipment and the related safeties and interlocks which can be properly used. When selecting automation and control equipment and related software for a particular application, the user should refer to the applicable local and national standards and regulations. The National Safety Council s Accident Prevention Manual (nationally recognized in the United States of America) also provides much useful information. In some applications, such as packaging machinery, additional operator protection such as point-of-operation guarding must be provided. This is necessary if the operator s hands and other parts of the body are free to enter the pinch points or other hazardous areas and serious injury can occur. Software products alone cannot protect an operator from injury. For this reason, the software cannot be substituted for or take the place of point-of-operation protection. Ensure that the appropriate safeties and mechanical/electrical interlocks related to point-of-operation protection have been installed and are operational before placing the equipment into service. All interlocks and safeties related to point-of-operation protection must be coordinated with the related automation equipment and software programming. NOTE: Coordination of safeties and mechanical/electrical interlocks for point-of-operation protection is outside the scope of the Function Block Library, System User Guide, or other implementation referenced in this documentation. Start-up and Test Before using electrical control and automation equipment for regular operation after installation, the system should be given a start-up test by qualified personnel to verify correct operation of the equipment. It is important that arrangements for such a check be made and that enough time is allowed to perform complete and satisfactory testing. 3

Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 8000DB0705 Safety Information 10/2009 CAUTION EQUIPMENT OPERATION HAZARD Verify that all installation and set up procedures have been completed. Before operational tests are performed, remove all blocks or other temporary holding means used for shipment from all component devices. Remove tools, meters, and debris from equipment. Failure to follow these instructions can result in injury, or equipment damage. Follow all start-up tests recommended in the equipment documentation. Store all equipment documentation for future references. Software testing must be done in both simulated and real environments. Verify that the completed system is free from all short circuits and grounds, except those grounds installed according to local regulations (according to the National Electrical Code in the USA, for instance). If high-potential voltage testing is necessary, follow recommendations in the equipment documentation to prevent accidental equipment damage. Before energizing equipment: Remove tools, meters, and debris from equipment. Close the equipment enclosure door. Remove ground from incoming power lines. Perform all start-up tests recommended by the manufacturer. Operation and Adjustments The following precautions are from the NEMA Standards Publication ICS 7.1-1995 (English version prevails): Regardless of the care exercised in the design and manufacture of equipment or in the selection and rating of components, there are hazards that can be encountered if such equipment is improperly operated. It is sometimes possible to misadjust the equipment and thus produce unsatisfactory or unsafe operation. Always use the manufacturer s instructions as a guide for functional adjustments. Personnel who have access to these adjustments should be familiar with the equipment manufacturer s instructions and the machinery used with the electrical equipment. Only those operational adjustments actually required by the operator should be accessible to the operator. Access to other controls should be restricted to prevent unauthorized changes in operating characteristics. 4

8000DB0705 Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 10/2009 Safety Information Product Related Information DANGER HAZARD OF ELECTRIC SHOCK, EXPLOSION, OR ARC FLASH Apply appropriate personal protective equipment (PPE) and follow safe electrical work practices. See NFPA 70E. This equipment must be installed and serviced only by qualified electrical personnel. Turn off all power supplying this equipment before working on or inside equipment. Disconnect the power at the processor and at the power source. Always use a properly rated voltage sensing device to confirm power is off. Replace all devices, doors and covers before turning on power to this equipment. Confirm that a proper ground connection exists before applying power to the unit. Use only the specified voltage when operating this equipment and any associated products. Failure to follow these instructions will result in death or serious injury. WARNING LOSS OF CONTROL The designer of any control scheme must consider the potential failure modes of control paths and, for certain critical control functions, provide a means to achieve a safe state during and after a path failure. Examples of critical control functions are emergency stop and overtravel stop. Separate or redundant control paths must be provided for critical control functions. System control paths may include communication links. Consideration must be given to the implications of unanticipated transmission delays or failures of the link. 1 Each implementation of an Altivar 31C drive must be individually and thoroughly tested for proper operation before being placed into service. Failure to follow these instructions can result in death, serious injury, or equipment damage. 1. For additional information refer to NEMA ICS 1.1 (latest edition), Safety Guidelines for the Application, Installation, and Maintenance of Solid State Control and to NEMA ICS 7.1 (latest edition), Safety Standards for Construction and Guide for Selection, Installation and Operation of Adjustable- Speed Drive Systems. User Comments We welcome your comments about this bulletin. You can reach us by e-mail at oem.solutions@schneider-electric.com. 5

Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 8000DB0705 Configuration 10/2009 Configuration Selecting the Driver in the HMI (HMI TCP/IP Master) To configure the devices for communication, launch Vijeo Designer and load the application. (This example uses Vijeo Designer 4.5.1.) Follow the procedure below to select the communication driver to communicate with the PacDrive controller. Refer to Figure 1. 1. In the navigation pane on the left side of the screen, right-click IO Manager. Select New Driver > Insert. 2. In the New Driver dialog box: a. Under Manufacturer at the top of the window, select Schneider Electric Industries SAS. b. Under Driver on the right side of the window, select Modbus TCP/IP. c. Under Equipment on the left side of the window, select Modbus Equipment. d. Click OK. Figure 1: Vijeo Designer Data Files Ressource Library Recipes 1: TankSetting IO Manager Modbus TCPIP01 Modbus Equipment01 Vijeo.Manager De Vi Project Variables Configuring the PacDrive Controller Follow the procedure below to configure the PacDrive controller. Refer to Figure 1. 1. In the navigation pane on the left side of the screen, expand IO Manager. Right click ModbusTCPIP01, then select Configuration. The Driver Configuration dialog box appears. 2. Enter the IP address, subnet mask, and default gateway (if one exists for the HMI). When selecting the IP address, ensure that both the Magelis HMI and the PacDrive controller belong to the same subnet class. NOTE: If, in the Target application, you elected to download the TCP/IP values, then the fields described in Step 2 above will be grayed out. In that case, configure these settings as follows, referring to Figure 2: a. In the property inspector pane on the lower left side of the screen, under ToConfiguration, expand the Download section b. Click to enter the IP address, subnet mask, and default gateway, as described in Step 2 above. Figure 2: Property Inspector Pane 6

8000DB0705 Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 10/2009 Configuration Configuring the Modbus Slave (HMI TCP/IP Slave Settings) Figure 3: Equipment Configuration Window PacDrive Controller Figure 4: Edit Communication Parameters To configure the Modbus slave settings, follow the steps below. 1. In the navigation pane on the left side of the screen, expand IO Manager > ModbusTCPIP01. Refer to Figure 1 on page 6. 2. Click ModbusEquipment01. The Equipment Configuration dialog box appears. Refer to Figure 3. 3. Configure the settings for the following fields. Figure 3 provides example settings. The settings required for your application may vary somewhat, but these settings are a good starting point. For a detailed description of each setting, click the Help button located in the lower right corner of this dialog box. a. IP Address (for PacDrive controller) The IP address shown is for example purposes only. The IP address you assign must belong to the same subnet class as the HMI configured in Selecting the Driver in the HMI (HMI TCP/IP Master) on page 6. If you are unfamiliar with the subnet class, consult you network administrator. b. Unit ID Set the Unit ID to 255. c. Preferred Frame Length Set the Preferred Frame Length to Maximum Possible. d. IEC61131 Syntax To conform to the naming convention used in the PacDrive controller, deselect the IEC61131 Syntax. This nomenclature is described in Data Storage on page 8. e. Double Word word order Set the Double Word word order to Low word first. f. ASCII Display byte order Set the ASCII Display byte order to Low byte first. NOTE: Ensure that the fields in the Variables section are set as described in Steps e and f above. Otherwise, it will be difficult to interpret the results of the communication between the HMI and the controller. 4. Click OK. 5. In the property inspector pane on the lower left side of the screen, under Configuration, ensure that the Scan Rate is set to Fast. Ensure that the PacDrive controller is configured to the same subnet network as the HMI. Follow the steps below: 1. From the main menu, select Start > ELAU \ Epas-4. 2. Double-click the subfolder Tools, then double-click NetManage. The Edit Communication Parameter dialog box appears. See Figure 4. If required, edit the IP address so that the controller uses the same subnet network as the HMI. 7

Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 8000DB0705 Configuring the Function Blocks 10/2009 Configuring the Function Blocks Data Storage Data is stored in four different tables, as shown in Table 1. Two tables store on/off discrete values (Boolean), and another two tables store numerical values (Integer/Float). Table 1: Data Storage Data Addresses Coil/Register Numbers Type Table Name 0000 to 270E 1-9999 Read-Write Discrete Output Coils 0000 to 270E 10001-19999 Read-Only Discrete Input Contacts 0000 to 270E 30001-39999 Read-Only Analog Input Registers 0000 to 270E 40001-49999 Read-Write Analog Output Holding When creating tags, reference Table 1 to determine the appropriate register assignment. For example: input boolean tags can be assigned register values 10001 through 19999. Tag Creation This section describes how to create the Boolean, Integer, and Float tags typical to any application. Follow the procedure below to create Discrete (Boolean) tags. For Integer or Float tags, follow the same procedure, but set the Data Type to either Integer or Float. Figure 5: Variable Properties 1. From the Main menu, select Variable > New Variable. The Variable Properties dialog box appears. See Figure 5. 2. In the Data Type field, select Discrete. In this example, we are setting the data type for a jog push-button. 3. Ensure that the External radio button is selected. 4. Assign a variable name, which will be referenced throughout the program. In this example, the variable name is Machine_Mode_Jog_PB. 5. Under Scan Group, select the ModbusEquipment01 device driver that was configured under Configuring the Modbus Slave (HMI TCP/IP Slave Settings) on page 7. 6. Under Device Address, assign the appropriate device address that will be referenced in the PacDrive controller. Function Blocks Launch the EPAS-4 V22 software. To set up the PacDrive controller to exchange data with the HMI via Modbus TCP/IP, you must set up and configure three function blocks in your program: F_MBTCP_CreateRule FB_Modbus_TCPServer F_MBTCP_GetRuleInfo All values are runtime configurable; therefore, the arguments can be passed via code. See Figure 6 on page 9. 8

8000DB0705 Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 10/2009 Configuring the Function Blocks Figure 6: Communication Modbus Memory Area Sample Code 1 contains sample code for creating the Modbus memory areas. This code creates two Boolean arrays and two Word arrays. You can change the size of the arrays as needed. In the example, each Boolean array is set to 3000 and each Word array to 2500. The array size may range from 0 65536. NOTE: In this example, the Word arrays will be initialized to zero and the Boolean arrays to false. While it would be good programming technique to initialize these values yourself, this is unnecessary. Sample Code 1: Modbus Memory Area VAR CONSTANT s_isizeofb0000 : INT:=3000; s_isizeofb1000 : INT:=3000; s_isizeofw3000 : INT:=2500; s_isizeofw4000 : INT:=2500;... END_VAR VAR (* the Modbus data areas *) a_barrb0000 :ARRAY[1..s_iSizeofB0000] OF BOOL := s_isizeofb0000(false); a_barrb1000 :ARRAY[1..s_iSizeofB1000] OF BOOL := s_isizeofb1000(false); a_barrw3000 :ARRAY[1..s_iSizeofW3000] OF WORD := s_isizeofw3000(0); a_barrw4000 :ARRAY[1..s_iSizeofW4000] OF WORD := s_isizeofw4000(0);... END_VAR 9

Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 8000DB0705 Configuring the Function Blocks 10/2009 FB_Modbus_TCPserver Sample Code 2 contains sample code for configuring the function block FB_Modbus_TCPserver, along with the variables used to control and read status information. Sample Code 2: FB_Modbus_TCPserver VAR... (* the communication FB *) fbmodbusserver: FB_ModBus_TCPServer; bmbenable: BOOL := TRUE; bmbactive: BOOL := FALSE; bmberror: BOOL := FALSE; bmbinit: BOOL := FALSE; iruleforpanel1: INT; (* for reading status information *) iconactive: INT; ulrejectedcounter: UDINT; ulacceptcounter: UDINT; ulrejectedunknown: UDINT; idummy1: INT; uldummy2: UDINT; END_VAR Cycle Time The cycle time affects the response time of the Modbus TCP/IP server. We recommend setting the cycle time of the task that services the code to 20 ms, although the value may be lower and higher. If experiencing problems because your client requires a response time less than 20 ms, experiment with cycle times lower than 20 ms If the server is creating too much load on the system experiment with cycle times higher than 20 ms. 10

8000DB0705 Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 10/2009 Configuring the Function Blocks F_MBTCP_GetRuleInfo Sample Code 3 contains sample code for configuring the function block F_MBTCP_GetRuleInfo. Sample Code 3: F_MBTCP_GetRuleInfo VAR CONSTANT... lmbtask_overruntime: DINT := 200; (* 200ms for cycle check overrun time *) lmbtask_wdogtime: DINT := 1000; (* 1s for cycle watch dog time *) END_VAR (* write your data to the Modbus arrays here *) IF(NOT bmbinit) THEN bmbinit := TRUE; (* only the panel is allowed to connect, only one connection *) iruleforpanel1 := F_MBTCP_CreateRule( pmodbus_tcp := ADR(fbModbusServer), sip:='192.168.1.11', (* the panel *) smask := '255.255.255.255', (* sip is a single host => all bits are processed *) icountok := 1, (* 1 connection *) lwadrb0000:=adr(a_barrb0000),sizeofb0000:=s_isizeofb0000, lwadrb1000:=adr(a_barrb1000),sizeofb1000:=s_isizeofb1000, lwadrw3000:=adr(a_barrw3000),sizeofw3000:=s_isizeofw3000, lwadrw4000:=adr(a_barrw4000),sizeofw4000:=s_isizeofw4000); IF(iRuleForPanel1 <= 0) THEN (* bad configuration, parse error in IP e.g. or to many rules *) ; END_IF (* increase the cycle check time to avoid problems with cycle check *) CycleCheckTimeSet( loverruntime := lmbtask_overruntime, lwdogtime := lmbtask_wdogtime); END_IF fbmodbusserver( benable:=bmbenable, uiport:= 502, bactive=>bmbactive, berror=>bmberror); Continued on next page 11

Connecting the Magelis XBTGT HMI to the ELAU PacDrive Controller Via a Modbus TCP/IP Network 8000DB0705 Data Bulletin 10/2009 Sample Code 3: F_MBTCP_GetRuleInfo (continued) (* if you are interested in how many clients are connected, or how many connections were rejected *) IF(TRUE) THEN (* get the status info for the rule of panel1*) F_MBTCP_GetRuleInfo( pmodbus_tcp := ADR(fbModbusServer), iruleindex := iruleforpanel1, inout_iconactive := iconactive, inout_ulrejectedcounter := ulrejectedcounter, inout_ulacceptcounter := ulacceptcounter); (* get the info of the catch-all-deny rule *) F_MBTCP_GetRuleInfo( pmodbus_tcp := ADR(fbModbusServer), iruleindex := iruleforpanel1 + 1, inout_iconactive := idummy1, inout_ulrejectedcounter := ulrejectedunknown, inout_ulacceptcounter := uldummy2); (* the catch-all-deny rule is automatically created at the end of the rule set the index of the catch-all-deny rule is (1 + greatest index returned by F_MBTCP_CreateRule) *) END_IF Schneider Electric 8001 Knightdale Blvd. Knightdale, NC 27545 (oem.solutions@us.schneider-electric.com) www.us.schneider-electric.com Magelis and Vijeo are a registered trademarks of Schneider Electric. Other trademarks used herein are the property of their respective owners. Electrical equipment should be installed, operated, serviced, and maintained only by qualified personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of the use of this material. 12