Sign in to follow this  
Followers 0
Fircombehall

MSG Read or Write?

8 posts in this topic

Hi, i need to MSG some integers to another SLC 5/05 via Ch1 TCP/IP. 
 

The CPU that i am sending to already has other SLC’s messaging it. Maybe 2/3 others. 
 

Let’s say the PLC with the integer i need to send is PLC “A” and the destination PLC is PLC “B”. 
 

1) Do i setup Read MSG from PLC B and extract data from PLC A. This way i can time the MSG function to make sure it doesn’t coincide with other MSG blocks. 
2) Do i setup write MSG from PLC A and write my integer to PLC B. 
3) Do i write to PLC C (one that is already messaging PLC B) and jump onto an existing MSG block between the two meaning i don’t have to add to the traffic queue going to PLC B?

Any advice greatly appreciated. 

Share this post


Link to post
Share on other sites

In general, I prefer to use MSG Read instructions. That way the destination registers show up being written in the program cross-reference. I think I remember seeing somewhere that reads take slightly lower resources as well, but I could be mis-remembering that. I wouldn't think that the data traffic would be too much, but it all depends on how much data is flowing back and forth and how often the MSG instructions are executing. I like having things simple and easy to understand, and I think having a read MSG straight from the source PLC is simpler. There's also less to go wrong, like if PLC C is shut down for some reason PLC B would lose the data from PLC A.

About the only time I deviated from using read instructions is when I went between a PLC5 and a CompactLogix. I found the routing and MSG path to be far easier to manage in the Logix 5000 PLC than in the PLC5, especially since it was hopping from DH+ to Ethernet via a ControlLogix backplane. In that case, I made sure to scrupulously document it and put info in the destination register's description as to its source. I know, that violates "simple and easy to understand", but I didn't have a lot of options at the time. We had about zero budget and the PLC 5 didn't have Ethernet. We had the ControlLogix hardware sitting around so it was cheap to install.

1 person likes this

Share this post


Link to post
Share on other sites

For anything that needs to be sent regularly, I agree with Joe that it should be reads initiated at the destination.  If the data transfer represents an unscheduled or semi-randomly occurring event on the source PLC, I would use a write from the source.

Share this post


Link to post
Share on other sites

Thank you both for your replies, much appreciated. Read it is!

Share this post


Link to post
Share on other sites

Oh… one more thing. When setting up a new MSG block would setup a new integer file and dedicate it to the control block?

For example if all my program integers are in N7, then setup a new N8 for the control block?

Share this post


Link to post
Share on other sites
1 hour ago, Fircombehall said:

setup a new N8 for the control

Not a bad idea.  I'd make it big enough for multiple control blocks--future use.

1 person likes this

Share this post


Link to post
Share on other sites
4 minutes ago, pturmel said:

Not a bad idea.  I'd make it big enough for multiple control blocks--future use.

I agree. Make it a lot bigger than you need. You can edit code online but you can't add/remove LAD files or add/resize data files without a download.

Share this post


Link to post
Share on other sites

Here is one reason why "old timers" prefer all reads.

MSG READ TO PLC A FROM PLC B N7:0

Step 1 - PLC A sends to PLC B  - "I need your N7:0 data please send it"

Step 2 - PLC B sends to PLC A - "Here is the N7:0 data you asked for and it's checksum"

Step 3 - PLC A validates checksum, if OK Read Done , Else Repeat at Step 1.

 

MSG WRITE TO PLC A FROM PLC B N7:0

Step 1 - PLC B sends to PLC A - "I wish to write my N7:0 data to you, are you ready?"

Step 2 - PLC A sends to PLC B - "I am ready to recive your N7:0 data, please sned it"

Step 3 - PLC B sends to PLC A - "Here it the N7:0 data I said I'd send and it's checksum"

Step 4 - PLC A sends to PLC B - "I have received the data and the checksum and the status is GOOD/BAD"

Step 5 - If PLC B recevies BAD CHecksum Status thenr epeat WRTIE, else END Write.

 

As you can see the READ needs only two set data packets per data message while the write requires 4 data packets per data set message.

 

ANECDOTAL DATA

I had an SLC 5/04 network using DH-485 to exchange data between four SLC 5/04 the DH-485 speed was 19,200 baud

To send an integer from A to B, increment by one in B and send it back to A took anywhere from 5-15 seconds using MSG WRITES.

Covnerted to MSG READS the timing went down to 1-3 seconds.

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
Sign in to follow this  
Followers 0