Modbus over RS-485 for SLC 5/05

Has anyone worked with the SGW-MB1512-T modbus gateway from automation direct? The ethernet interface protocol is modbus TCP/IP...will this work for SLC 5/05? What is the difference between TCP/IP and Ethernet/IP, this is all very confusing...
 
Update: I may give writing a MSG program a try since I have recently upgraded my RSLogix500 software and if I can get it to work all the better! Does anyone have any advice on how to approach this? I am using the SLC 500 Instruction Set Reference as a basepoint for the program (image attached). My goal is to continuously read holding registers from my RTU modbus slaves and I assume it will store that data in the "data table address"?

One thing that is really stumping me is how I will continue to program my SLC processor? I will set CH 0 as RTU master (from DF1 Full Duplex). So how will I program the processor if the channel is not full duplex, is there an alternative? Maybe CH 1? If anyone has any advice, it would be greatly appreciated!

test.PNG
 
Last edited:
I recommend setting aside that MSG instruction example code. It's a "self-retriggering" rung that has persisted in SLC-500 instruction manuals since the 1980's.

Ideally, you should be connecting to your SLC-5/05 over the Channel 1 Ethernet port, using an Ethernet switch and ordinary RSLogix and RSLinx.

Get that connection working first, then we'll move to the Channel 0 serial port configuration.

What wiring devices did you settle on ?
 
I recommend setting aside that MSG instruction example code. It's a "self-retriggering" rung that has persisted in SLC-500 instruction manuals since the 1980's.

I wish they'd never published that example. I recently worked on water plant where the message logic is done that way to a small handful of other SLCs that only need to exchange data every few seconds or slower to perform just fine. Not only does it tie up Ethernet resources unnecessarily, but it makes it hard to tell when there is an error if you don't properly trap the error bits (and they didn't) but it is hard to biotch a guy out for doing it "exactly like the book said..."

Another question for the OP:

How frequently do you realistically need fresh data?
 
Thank you very much this all seems good! So I can just plug in my RS-485 devices and use the tag map to copy/create the tags in my SLC 5/05? However, there is one slight issue...you see I have my SLC 5/05 already on LAN via its ethernet port. How can I use this while also keeping my SLC 5/05 on my LAN??

Sorry I didn't respond earlier (I didn't see that you posted a reply). Yes you can have your SLC5/05 connected to two (or more) EtherNet/IP compatible devices at the same time and the Spectrum Gateway will communicate with multiple EtherNet/IP and Modbus TCP devices at the same time. That's one of the nice thing about Ethernet, many devices can share the same network. Simply connect the Gateway to the same network switch that the SLC5/05 is connected to and make sure the Gateway's IP address matches the SLC5/05's subnet mask (the first three sets of numbers match). If it's a company wide network you'll want to get IT involved so you don't duplicate an address that already exists. If you want to see an IT guy give birth to a brick, put a duplicate IP address on his network (and take the next few days off :mad: )
 
A better way to run MSG instructions is by triggering them with the /DN bit of a self-resetting Timer, and prevent them from re-executing on the timer if they are still Enabled from the previous execution.

If such a MSG fails immediately because the destination device replies with an error code (bad address, full buffers, etc) you will see the .ER bit and can look at the error code value.

And it won't fill up the SLC's buffers if the remote device is disconnected and the built-in Timeout has not expired by the time the next cyclic Timer pulse is sent.

Modbus_MSG.PNG
 
A better way to run MSG instructions is by triggering them with the /DN bit of a self-resetting Timer, and prevent them from re-executing on the timer if they are still Enabled from the previous execution.

If such a MSG fails immediately because the destination device replies with an error code (bad address, full buffers, etc) you will see the .ER bit and can look at the error code value.

And it won't fill up the SLC's buffers if the remote device is disconnected and the built-in Timeout has not expired by the time the next cyclic Timer pulse is sent.

Ok thank you very much! How might I set up multiple msgs for reading multiple modbus registers? They can't all be executed at the same time can they?
 
What is the Modbus data that you need to read ? In general the most efficient thing to do is use just one message to read a block of Modbus registers.

I think the SLC implementation might limit you to 255 holding registers at a time, since that's the maximum SLC data table size to use as the destination.

If you have to read multiple blocks of registers, or different types of data using different Modbus commands, I typically write a simple state machine to increment an index register, and use "Index Register equals X" to trigger an MSG instruction. Some folks prefer to "chain" together their MSG instructions so that each /DN bit triggers the next /EN bit, but that sort of logic takes more work to revise when you want to change the order of the messages.
 
Ok thank you very much! How might I set up multiple msgs for reading multiple modbus registers? They can't all be executed at the same time can they?

Are we using Ethernet or Serial for this?

Technically, the messages can't happen at the same time on either channel, but I have seen programs that fire off multiple messages on the Ethernet CH1 all at once and let the CPU take care of the details under the hood. I have not seen that done, nor would I recommend doing that with the serial channel 0.

What exact Modbus addresses do you need to read?

If there are small gaps between some data points, it often makes sense to read a block of them and just ignore the stuff you don't care about. There can be limits to how many addresses can be accessed in a single message by the device on the other end, and in the SLC there is a limit (different limits depending on channel and data type). I think you can read 103 16 bit integers in a SLC over Ethernet using A/B protocols, and I am not sure if that changes when you use Modbus TCP protocol. That number is slightly different in a Micrologix.

For example, If I needed HR40001, HR40004 and HR40013, I would read them all in one message. If that last one was HR40047, I would most likely use a separate MSG instruction rather than waste 40 words of memory for stuff I don't care about.
 
Last edited:
Are we using Ethernet or Serial for this?

Technically, the messages can't happen at the same time on either channel, but I have seen programs that fire off multiple messages on the Ethernet CH1 all at once and let the CPU take care of the details under the hood. I have not seen that done, nor would I recommend doing that with the serial channel 0.

What exact modbus addresses do you need to read?

If there are small gaps between some data points, it often makes sense to read a block of them and just ignore the stuff you don't care about. There can be limits to how many addresses can be accessed in a single message by the device on the other end, and in the SLC there is a limit (different limits depending on channel and data type).

For example, If I needed HR40001, HR40004 and HR40013, I would read them all in one message. If that last one was HR40047, I would most likely use a separate MSG instruction rather than waste 40 words of memory for stuff I don't care about.

I am using serial to setup my messaging. In my case the registers I wish to read are HR40001-HR40004, HR40007, HR40008, HR40021, HR40027, and HR40028.

This is what I have so far for HR40001-HR40004, HR40007, HR40008 (see image). Would this work?

Capture2.PNG
 

Similar Topics

Hey all. Ive a SLC 505 FRN 11, that I am trying to get to talk to a controller. The controller runs modbus slave on rs485 (2 wire). The SLC...
Replies
0
Views
3,331
I've been stuck on an issue for a few hours now and the in-house expert is out at the hospital so I have to solve this on my own this time: On...
Replies
11
Views
6,042
Hello, I need to access the bits from the fire system control panel through RS-485. So, I used Read Var block to read from the panel...
Replies
0
Views
27
I am trying to figure out some communication specifics for a Modbus RTU network that I will be integrating with and could use some help to make...
Replies
9
Views
1,925
Good day all. I have an RS-485 topology question. I am hoping for some guidance so that I can make a confident calculation/decision that this will...
Replies
4
Views
1,412
Back
Top Bottom