GT6Steve

Read Modbus holding registers with RSLogix?

19 posts in this topic

I have connected seven GE Multilin relays to a Multinet TCP/IP adapter with the intention of bringing data to an InTouch SCADA system. I can see and read when using GE's Enervista interface so I know my adapter is working. Can I read the slave devices with commands from RSLogix to present the data as tags to SCADA? I have a Prosoft module in a test stand but there is no room for another module or another rack in this control panel. Hence I'm looking for something I can program into the local PLC. I'm just learning Modbus so my head is spinning a bit, use small words if able to assist ) Regards, Steve Edited by GT6Steve
1 person likes this

Share this post


Link to post
Share on other sites
What model is your Control Logix PLC? You might be able to use this Modbus TCP sample code provided by Rockwell. You'll need to be using firmware V20 or later. http://bit.ly/1t5jX8r Edited by MrAutomation

Share this post


Link to post
Share on other sites
I'm using V19 on a 1756-L63 processor. I think I can look at the code on my laptop however. May give me some clues...Thank You

Share this post


Link to post
Share on other sites
I think you'll have to upgrade to V20. The code is basically a modbus driver written in PLC code, instead of baked in the the firmware. It uses the TCP Socket mode in the MSG instruction, which allows the program to control the data going out on a bit per bit basis. You'll also need the correct hardware: The socket interface lets you use a Logix5000 controller to communicate via an EtherNet/IP module with Ethernet devices, such as bar code scanners, RFID readers, or other standard Ethernet devices, that do not support the EtherNet/IP application protocol. Socket services are available with these modules:• 1756-EN2xx ControlLogix® EtherNet/IP communication modules, firmware version 5.007 or later• 1756-EWEB ControlLogix EtherNet/IP web server module, firmware version 4.006 or later• 1768-EWEB CompactLogix™ EtherNet/IP web server module, firmware version 1.002 or later• 1769-L30ER, 1769-L30ERM, 1769-L30ER-NSE, 1769-L33ER, 1769-L33ERM, and 1769-L36ERM CompactLogix controllers, firmware version 20.011 or later• 1769-L24ER-QB1B, 1769-L24ER-QBFC1B, 1769-L27ERM-QBFC1B CompactLogix controllers, firmware version 20.011 or later• 1769-L16ER, 1769-L18ER, 1769-L18ERM CompactLogix controllers, firmware version 20.011 or later Text quoted from this document. Edited by MrAutomation

Share this post


Link to post
Share on other sites
Hi GT6Steve, By using a simple EtherNet/IP to Modbus (RTU or TCP) Converter, you can configure/program your PLC to read/write Modbus Slave Registres directly Via EIP network. It reads the register data from the Modbus slaves and publishes these data to the input register data of the EtherNet/IP scanner. The output data transmitted by the EtherNet/IP scanner are updated to the register data of Modbus slaves via the converter. below you can find two EIP/Modbus converter as a sample ( for both RTU or TCP): http://www.icpdas-usa.com/gw_7472.html?r=mohsen http://www.icpdas-usa.com/gw_7473.html?r=mohsen Good Luck :)

Share this post


Link to post
Share on other sites
Say guys, I'm back on this project. Could someone open and print me a report on the Master.ACD code that's in the Rockwell sample noted in Mr. Automations message above? I only have up to version 19 and can't open it but I may learn from the example. Thanx in advance, Steve Edited by GT6Steve

Share this post


Link to post
Share on other sites
It needs to be V20. There's firmware changes that are required. Also, once you look at the code, you'll see it's not something you'll want to learn from and write on your own. It's a lot of code, and there's a lot going on in it. If you are going to use it, you basically just need to import it into your project and follow the instructions in the documentation.

Share this post


Link to post
Share on other sites
I'm an expert with both ControlLogix and Modbus, and I still would not use that code except as an absolute last resort. You're going to be far ahead on time, and therefore money, using a standalone EtherNet/IP to Modbus TCP converter like the ICPDAS or HMS Fieldbus or Prosoft standalone devices. Get one of these and don't look back: http://www.anybus.com/products/abxmtcp.shtml

Share this post


Link to post
Share on other sites
LOL! I went to a friends house this weekend and opened it up for a look. We saved it as a report to study and as noted above, it is BUSY! I guess I'll listen to my betters and go back to studying on the GE Multinet module conversion. It all works with the Enervista software GE supplies. I just need to strip that data out for my SCADA software to represent. In the end I'll probably surrender and simply imbed Enervista as a webpage in a SCADA window..... Thanx for the words of wisdom, Steve

Share this post


Link to post
Share on other sites
Hi guys, I'm having some trouble with this myself! I'm using a ControlLogix5572 processor, and 1756-EN2TR Ethernet/IP module. I've been trying to connect to a Socomec Diris A40 power meter, and I've been using the code mentioned above. I've followed the guidelines in the documentation, with no luck. Attempted a few changes to other parameters to see what effect they'd have, still very little progress. Anyone familiar with the code might be able to help me. I have changed the the MBTU_Connections parameters, and when I run it the MBTU_Connections[0].MBTI_Connected parameter reads a 1, meaning the device is connected correctly. For the MBTU_Transactions parameters, I have set all my parameters as follows Enabled = 1 PollInterval = 10 Transtype = 3 (Read Hold Registers) UID = 0 BeginAddress = (Tried various) Count = (Tried Various) Local Offset = 1 When I put it into run mode, the TransID increases, so it is attempting transactions, but the TransStat parameter displays -1, meaning there is an error. TransLastError displays 2, which is a Network Write Error Any ideas on what I'm doing wrong? Thanks!! --------EDIT------- TransLastError=2 means a Modbus exception of Illegal Data Address This is a different problem altogether, I'll work on it, and if I'm still stuck I 'll start a new thread :) Edited by eamonc

Share this post


Link to post
Share on other sites
The fact that you're getting an "illegal address" exception suggests that the various addresses you have tried are not supported by the target device. Whenever I do Modbus work with a PLC, I always set up a software tool that's known to work first, and carefully document (and sometimes analyze) the traffic so that I can compare that to what the PLC is doing. Do you have a Modbus/TCP client on a PC that does work with your power meter ? I like the Chipkin Automation free Modbus querying tool very much.

Share this post


Link to post
Share on other sites
Yeah I got it working in no time. The Diris A40 does have kind of strange data addressing, but it was easily fixed. Had to modify the sample code so the BeginAddress was DINT rather than INT to get the appropriate range of addresses. I had just been working thinking the error was something else.

Share this post


Link to post
Share on other sites
Thanks very much for the followup ! I happen to be working on a system where the communications protocol was written in with the main code, rather than buying a $400 interface board. So far it's cost me about three months of engineering time, so I'm sort of sensitive about the topic.

Share this post


Link to post
Share on other sites
Sound like the proverbial, "We spend $25,000 saving the $8 in clean up costs" scenario.

Share this post


Link to post
Share on other sites
On 20/2/2015 at 3:52 AM, eamonc said:

Yeah I got it working in no time. The Diris A40 does have kind of strange data addressing, but it was easily fixed. Had to modify the sample code so the BeginAddress was DINT rather than INT to get the appropriate range of addresses. I had just been working thinking the error was something else.

Hi guys, im new to the forum, im trying to get the sample code from rockwell to work, since this has already worked for others (quote), i tried what is suggested (changing begginaddress type to DINT) but i get the same results.

Im trying to connect to a diris A60 with a compaclogix L2(1769-L24ER-QBFC1B), RsLogix 5000 r20.4.

Any suggestions??

PD: keep getting the LastTranError=2.

Edited by Vcubas
Added detail.

Share this post


Link to post
Share on other sites

I have 64 loadcell Ethernet Modbus. Using Control Logix L75. any suggestions how to  connect? using sample code or using  prosoft? How many maximum sample code and prosoft can handle ethernet modbus?

Share this post


Link to post
Share on other sites

Hi Yosep.

I have yet to test te capabilities of a control logix for modbus, as far personal experience I have only used compact to connect to modbus networks, on your question "how to connect?, using sample code or prosoft?" that depends whether you want to spend some money or not, if money is not an issue i'd say go for prosoft, but if you are trying some shortcuts on budget and want to go for coding (much harderd to configure a troubleshoot, but i guess its more like a personal challenge ^^) you can use the sample code on the rockwell automation sample code library (I have used it and works just fine, but took me about 2 weeks to get it to properly work), BUT it will consume a lot of controller memory (my proyect only has 12 connections, it requires 500kbytes for the connection program only), hope I was of some help.

good luck.

Share this post


Link to post
Share on other sites

Micrologix 1400 rev B can talk to ModbusTCP and and Compactlogix can talk to the Micrologix 

Cheaper and easier

Share this post


Link to post
Share on other sites

I'd use a Red Lion DSPGT and write the Modbus registers to / from PLC tags. Cheap and easy plus you can talk to numerous Modbus devices

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now