pplication Examples ppendix In this ppendix... Example 1: Using Modbus Poll to M-GTEWY with L0 Slave... - Items needed for this example:... - Step 1: onnect the M-GTEWY serial port to the L0 secondary communications port.... - Step : onfigure the L0 PL serial port and M-GTEWY serial port.... - Step : onnect to the M-GTEWY using the Modbus Poll simulator software.... - Example : Using Modbus Poll to M-GTEWY with LIK Slave... - Items needed for this example:... - Step 1: onnect the M-GTEWY serial port to Port of the LIK PL.... - Step : onfigure the LIK serial port and M-GTEWY serial port.... -1 Step : onnect to the M-GTEWY using the Modbus Poll simulator software.... -1 Example : Using P000 as Master (lient) to M-GTEWY with LIK Slave.... - Step 1: onnect LIK to the M-GTEWY as shown in example.... - Step : onnect P000 PU (P-0) to M-GTEWY via Ethernet Switch and Two Ethernet ables.... - Step : onfigure the MRX instruction to read data from the M-GTEWY.... - Example : irectlogic 0 (H0-EOM0) as Master (lient) to M-GTEWY with Mulitple GS rives as Slaves.... - Step 1: Set up Peer to Peer onfiguration... -0 Step : Set the Serial Port onfiguration... -1 Step : Set the ommunication Parameters... -1 Step : Using utomatic Reads... - Step : ccess the utomatic Read ata... - Step : Read and Write from the L0... -
ppendix : pplication Examples Example 1: Using Modbus Poll to M-GTEWY with L0 Slave This example will illustrate how to use Modbus Poll, which is a P based Modbus Master simulator tool, to connect through the M-GTEWY to a L0 PL via wire RS-. Internally onnected Items needed for this example: M-GTEWY irectlogic 0 PL (any model) P with Modbus Poll installed (free demo is available at www.modbustools.com) Small length of elden or equivalent cable ZL-M1 ZipLink communication port adapter, 1-pin high density female to terminal block Ethernet switch and cables to connect from the P to M-GTEWY Step 1: onnect the M-GTEWY serial port to the L0 secondary communications port. Using the short length of elden, connect the M-GTEWY to the L0 Port as shown: GN RX+ RX- TX- TX+ GN Gateway (Gateway contains a 10Ω Termination Resistor between RX+ and RX-) RS-/RS- RX+ TS+ TS- ZL-M1 to L0 Port TX+ RX+ TX- RX- GN NOTE: If using a connector other than ZL-M1 or ZL-M1L, jumpers must be installed on the PL side: Pin to 1 Pin 1 to 1 1 1 1 1 1 1 1 1-pin Female onnector L0 Port Pin escriptions V TX RX RTS TS RX 0V 0V TX+ TX- RTS+ RTS- Power (+) connection Transmit data (RS-) Receive data (RS-) Ready to send (RS-) lear to send (RS-) Recieve data (-) (RS-/) Power (-) connection (GN) Power (-) connection (GN) Transmit data (+) (RS-/) Transmit data (-) (RS-/) Ready to send (+) (RS-/) Ready to send (-) (RS-/) Recieve data (+) (RS-/) lear to send (+) (RS-/) lear to send (-) (RS-/) 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Step : onfigure the L0 PL serial port and M-GTEWY serial port. onnect to the L0 PL with irectsoft. Go to the PL pulldown and select Setup > Setup Secondary omm. Port as shown: M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1 1 1
ppendix : pplication Examples Setup the port as shown for Modbus protocol, 00 baud rate, Odd parity, 1 Stop bit and Station Number 1. Match everything else as shown. Note the Station Number configured in the PL. Once this has been done, click on the icon on the upper right hand side with the arrow pointing to the PL to save the settings in the PL. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples In order to match the serial port settings of the L0 to the M-GTEWY open up a web browser, such as Internet Explorer, and enter in the IP address of the M-GTEWY to access the main screen as shown: For instructions on connecting with a web browser see NetEdit onfiguration section in hapter. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples lick on the link to the right of Serial Port onfiguration and set up the window to match the L0 PL port and then click on the Send button to save the settings: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Step : onnect to the M-GTEWY using the Modbus Poll simulator software. Once the software has been obtained from www.modbustools.com and installed according to the directions provided from their website, open up the Modbus Poll software. lick on the Setup pulldown menu and select Read/Write efinition as shown: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples onfigure the Read/Write definition for a simple read of the register 00001, which equates to V0 in the irectlogic PLs. (see http://support.automationdirect.com/docs/modbus_xref.pdf for more information on Modbus addressing to irectlogic PL addressing equivalents). Enter in 1 for the Slave I. This matches the Unit I in the protocol that will determine which Modbus Serial Slave will be targeted on the serial side of the M-GTEWY. Entering 1 here will match up to the Station Number configured above in irectsoft for the L0 PL. hoosing Function sets up the read for xxxxx registers. hecking the PL ddresses (ase 1) in the lower right corner matches the addressing to the cross reference chart mentioned above. Once this windows has been configured as shown above, click on OK. Now click on the onnection pulldown menu and select onnect: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples In the onnection Setup window, choose the Modbus TP/IP connection type. Enter the IP address of your M-GTEWY module in the lower left hand corner. Match everything else as shown: lick on OK to connect to the M-GTEWY. If everything has been configured correctly, the counter next to TX = will increment rapidly and the counter next to Err = will not increment. If the Error counter is incrementing, go back and verify that all the steps prior to this one have been followed. If you get an error that says, Modbus TP connection failed, verify that the IP address of the P and the IP address of the GTEWY are in compatible subnets and can communicate. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Once Modbus Poll is communicating to the PL, go into irectsoft, open up a ata View window and enter in V0 and change the display type to ecimal to match the Modbus Poll software: hange the value in data view for V0 to various values and watch the value change in Modbus Poll to match. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Example : Using Modbus Poll to M-GTEWY with LIK Slave This example will illustrate how to use Modbus Poll, which is a P based Modbus Master simulator tool, to connect through the M-GTEWY to a LIK PL via wire RS-. Items needed for this example: M-GTEWY LIK PL (any 0-01xx-x or 0-0xx-x PL with pin terminal RS- port) P with Modbus Poll installed (free demo is available at www.modbustools.com) Small length of elden or equivalent cable Ethernet switch and cables to connect from the P to M-GTEWY Step 1: onnect the M-GTEWY serial port to Port of the LIK PL. Using the short length of elden, connect the M-GTEWY to LIK s Port as shown: RS- Internally onnected GN RX+ RX- TX- TX+ GN Gateway (Gateway contains a 10Ω Termination Resistor between RX+ and RX-) Port Pin Terminal lock + - LG Port Pin escriptions + 1 (plus) Signal (RS-) - (minus) Signal (RS-) LG Logic Ground (0V) 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Step : onfigure the LIK serial port and M-GTEWY serial port. onnect to the LIK PL with LIK programming software. Go to the Setup pulldown and select om Port Setup... as shown: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples lick the Port : Setup... button to configure Port of the PL. onfigure the port for 00 baud rate, Odd parity, 1 Stop it and Node ddress 1. Leave the other settings as shown below. Note the Node ddress number configured here. Once the settings are configured, lick on the Ok button. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples Next, transfer the project to the PL for the Port settings to take effect. Select the PL pulldown menu and choose Write Project into PL... 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples hoose Ok and follow the steps when prompted to transfer the project to the PL. M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 1 1 1-1
ppendix : pplication Examples Now go into the M-GTEWY configuration and match the serial port settings to the PL Port settings. Open up a web browser, such as Internet Explorer, and enter in the IP address of the M-GTEWY to access the main screen as shown. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples lick on the link to the right of Serial Port onfiguration and set up the window to match the LIK PL port and then click on the Send button to save the settings: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples Step : onnect to the M-GTEWY using the Modbus Poll simulator software. Once the software has been obtained from www.modbustools.com and installed according to the directions provided from their website, open up the Modbus Poll software. lick on the Setup pulldown menu and select Read/Write efinition as shown: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples onfigure the Read/Write definition for a simple read of the register 00001, which equates to S1 in the LIK PL as shown. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-0
ppendix : pplication Examples Enter in 1 for the Slave I. This matches the Unit I in the protocol that will determine which Modbus Serial Slave will be targeted on the serial side of the M-GTEWY. Entering 1 here will match up to the Node ddress configured above in the LIK programming software for Port. Enter in 1 for the Slave I. This matches the Unit I in the protocol that will determine which Modbus Serial Slave will be targeted on the serial side of the M-GTEWY. Entering 1 here will match up to the Station Number configured above in the LIK software. hoosing Function sets up the read for xxxxx registers. hecking the PL ddresses (ase 1) in the lower right corner matches the addressing to the cross reference chart mentioned above. Once this windows has been configured as shown above, click on OK. Now click on the onnection pulldown menu and select onnect: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples In the onnection Setup window, choose the Modbus TP/IP connection type. Enter the IP address of your M-GTEWY module in the lower left hand corner. Match everything else as shown: lick on OK to connect to the M-GTEWY. If everything has been configured correctly, the counter next to TX = will increment rapidly and the counter next to Err = will not increment. If the Error counter is incrementing, go back and verify that all the steps prior to this one have been followed. If you get an error that says, Modbus TP connection failed, verify that the IP address of the P and the IP address of the GTEWY are in compatible subnets and can communicate. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Once Modbus Poll is communicating to the PL, go into the LIK programming software, open up a ata View window and enter in S1 as shown. hange the value in data view for S1 to various values and watch the value change in Modbus Poll to match. M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 1 1 1 -
ppendix : pplication Examples Example : Using P000 as Master (lient) to M-GTEWY with LIK Slave. Step 1: onnect LIK to the M-GTEWY as shown in example. Step : onnect P000 PU (P-0) to M-GTEWY via Ethernet Switch and Two Ethernet ables. onfigure the IP address of the P PU and the M-GTEWY to be compatible subnets. Steps to configure the IP address of the P-0 PU areas follows: lick on Setup on the top menu bar and choose Hardware onfiguration. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples ouble click on the image of the P-0 in the center of the hardware configuration. M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 1 1 1 -
ppendix : pplication Examples lick on the Ethernet Ports tab and configure the IP address in the Use the Following: IP address field. Once the correct IP address and Subnet Mask is entered, click on the OK button and close the hardware configuration window. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Transfer the project to the P in order to have the new settings take effect. To do this, select File from the pulldown menu and then Transfer Project >To P 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Step : onfigure the MRX instruction to read data from the M-GTEWY. ouble click on the instruction MRX Read to configure the MRX instruction as shown. IP ddress: address of the GTEWY. TP Port Number: Leave at default 0. Slave Node Number: This should match the Node address of Port of the LIK PL. Leave at 1 in this case. Slave Modbus Starting ddress: Set to 1 to read address S1 in the LIK PL. Tag Name Mapping: reate a Tag called LIK_S1 as an Signed Int 1 Tag to read in S1 from the LIK PL. Use the status bits and Exception Response String to verify whether communications were successful or not. If the Error bit comes on, look at the Exception Response String to see which error occurred. If the Timeout it comes on, check the IP address settings of the P-0 and the GTEWY and make sure that they are in compatible subnets. If the Successful Status bit comes on, add the LIK_S1 tag to the ata View at the bottom of the Productivity Suite Programming Software and check the values. hange the values in the LIK data view for S1 and verify that the LIK_S1 tag matches. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Example : irectlogic 0 (H0-EOM0) as Master (lient) to M-GTEWY with Mulitple GS rives as Slaves. irectlogi L0 PL w/ EOM0..0.1 Ethernet ate Stride Ethernet Switch P..0. Ethernet ate M-GTEWY..0. Unit I 1 M-GTEWY -Pin GN RX+ RX TX TX+ GN RS- able shield able end marked rive Side ZL-M-RJ1X ZL-M-RJ1X -Pin 1 able end marked rive Side GS rive Node I RS- GS-RJ1-L-* *aution - Wire ONLY the pins connected by the cable. The drives power available at the RJ1 pins will affect other drives if other pins are connected. GS rive Node I 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Step 1: Set up Peer to Peer onfiguration In NetEdit, Scan Network to find your H0-EOM0. Set the Module I, IP address and Subnet Mask as appropriate for your network. In our example, we use,..0.1 and...0 respectively. In the EOM Settings tab, click the Peer to Peer onfig button. dd the evices appropriate for your project. In our example we have added three devices that are the M-GTEWY: evice 1 is the utomatic Reads table that resides in the M-GTEWY, so it is configured with the M-GTEWY IP address and the M-GEWY Unit I. evice is the first drive. It is configured with the M-GTEWY IP address and the first drive Unit I. evice is the second drive. It is configured with the M-GTEWY IP address and the second drive Unit I. 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-0
ppendix : pplication Examples Step : Set the Serial Port onfiguration In the NetEdit Module List, select your M-GTEWY. Set the IP address and subnet mask as appropriate for your network. In our example, we use..0. and...0. lick Start Web ased onfig... To set the Gateway Modbus I as appropriate for your network. In our example, we use 1. Set the Serial Port onfiguration as appropriate for your network. For our example, we use: aud rate = 100 Parity = Odd Stop bit = 1 Step : Set the ommunication Parameters Set the communication parameters in the drives as appropriate for your network. In our example: Parameter Number Parameter escription First rive Second rive P.00 rive I 0 0 P.01 aud Rate 0 0 P.0 Modbus RTU, -Odd-1 0 0 P.00 RS- interface, Keypad STOP disabled 0 0 P.00 Frequency determined by RS- interface 0 0 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1-1
ppendix : pplication Examples Step : Using utomatic Reads In the M-GTEWY browser configuration utility, click the utomatic Reads link. Slave number is the first drive and Slave number is the second drive in our example. onfigure the lines as appropriate. For our example, we will read the status registers for each drive: 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Step : ccess the utomatic Read ata The ERX iox is used since the data will be read by the EOM0, rather than a serial connection 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples EOM0# = defined for this L program in the EOM0 iox in our Rung 1 Workspace = an internal, private register used by this iox and MUST E UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. Slave I = The M-GTEWY Modbus Gateway I, 1, since we are reading the utomatic Read data stored in the M-GTEWY From Slave Element (Src) = the Gateway Memory ddress identified on the M-GTEWY Setup utomatic Reads config page. Note that the address in the M-GTEWY, 0 should be entered here as V0 and irectsoft software will change the name to T0. This is a naming convention for addresses internal to the PL and will not 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples affect either the targeted address or the use of Timer 0 in the L program. Number of ytes = 0. Since our addresses for both example drives are contiguous, we can read all elements with one iox. Each element is a word, bytes, so we want to read 0 bytes to get all elements. To Master Element (est) = the location where the slave data will be placed in the master EOM0 PL Success = a bit that will turn on once the request is completed successfully Error = a bit that will turn on if the instruction is not successfully completed 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Step : Read and Write from the L0 To Read data from a drive instead of using of the utomatic Read feature of the M-GTEWY, and to Write data to the drive, the Slave I in the ERX and/or EWX ioxes will be the rive I. The From Slave Element and/or To Slave Element values will be the addresses in the drive continued 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples In our example ERX boxes: EOM0# = defined for this L program in the EOM0 iox in our Rung 1. Workspace = an internal, private register used by this iox and MUST E UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. Slave I = The GS rive Node I, or, depending on which drive we target From Slave Element (Src) = V000 equates to Status Monitor 1 in the GS rive (Hex 0 and Modbus ecimal ). See GS rive manual for details. Number of ytes = Each Modbus register (element) that we want to read is a word, bytes; in our example we will read status registers. To Master Element (est) = the location where the slave data will be placed in the master EOM0 PL Success = a bit that will turn on once the request is completed successfully Error = a bit that will turn on if the instruction is not successfully completed In our example EWX boxes: EOM0# = Module I, set in NetEdit and defined for the L program in the EOM0 iox in our Rung 1 Workspace = an internal, private register used by this iox and MUST E UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. Slave I = The GS rive Node I, or, depending on which drive we target From Master Element (Src) = the location of data in the Master PL that will be written to the drive 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -
ppendix : pplication Examples Number of ytes =. In our example, we will write the speed ( bytes) to the omm Speed Reference register and set the next register to RUN ( bytes) To Slave Element (est) = the Modbus register where the data will be written in the drive. In this case, V equates to P. omm Speed Reference. See GS rive manual for more details. Success = a bit that will turn on once the instruction is completed successfully Error = a bit that will turn on if the instruction is not successfully completed 1 1 1 M-GTEWY-USER-M Hardware User Manual, 1st Ed. Rev. E 0/1 -