PLC 5 MSG instruction help

sparkytex

Lifetime Supporting Member
Join Date
Jun 2013
Location
Port Hardy B.C.
Posts
354
Hello every one. Here's what im trying to do. I need to use 6 Message instructions to send values from one ethernet processor to another, both PLC 5/40E processors. I have 4 inputs to binary to send, one output to binary, and one binary to binary. Here are the Local and target (dest.) address's;

Local I:025/14 (e-stop) node 180d dest. b3:3/1 node 50d
Local I:025/15 (CL2 sensor 1)node 180d Dest. b3:3/2 node 50d
Local I:025/16 (CL2 sensor 2)node 180d Dest. b3:3/3 node 50d
Local I:025/17 (CL2 sensor 3)node 180d Dest. b3:3/4 node 50d
Local O:013/16 (CL2 SSV) node 180d Dest. b3:3/5 node 50d
Local B3:3/6 (HMI stop) node 50d Dest. b3:0/5 node 180d

I tried to make it happen but im not exactly sure how to set it up. Is it even possible to send an input address into a binary address through a MSG instruction. I need the values from the 180d processor "sludge" onto the 50d processor "BPMCC1" so i can put the CL2 sensors, e-stop, and SSV as feedback icons onto my wonderware HMI program. The wonderware cannot talk to the sluge PLC directly. The WW is however set up to talk to the BPMCC1. They are all reads except the B3:3/6 which is an "e-stop" from the WW HMI to the sludge PLC as a write. Please let me know if this is possible and or how to set this up in the MSG instruction setup screen.

thanks!!
 
You do not need 6 message instructions.....

Do your self a huge favour and set up a message of, say, 10 words of data (can be integer file or binary file, it doesn't matter). 10 words will give you lots of "spares" without impacting on system performance.

Write a bit of code to "map" your inputs into the message data file.

On the destination PLCs, also write a bit of code to "map" the bits received to their destinations.

Then use your MSG instructions to write (or read) the data block using a cyclic timer.... do not re-enable the MSG as soon as it is "done", this will only be troublesome.

I always prefer messages to "Read" the source data from the other PLC, rather than have the other PLC "Write" data. If you are reading it, and the message succeeds, at least you know the other PLC is still there. If your data is written, and the other PLC is not there anymore, the data will just be static (last written) data.

It is also a good idea to set-up some form of handshaking to confirm the message data is being transferred successfully.

There a many ways to do this, but my preference is a simple "bit flip" method, but it does require a "two-way" data transfer.
 
What you didn't mention is how these messages are triggered. I will assume that it will be periodic and that they are all triggered together. If not, you may need more messages.

You will need two messages total. They can both be reads or one read and one write. I prefer all messages to be reads if they can.

On node 50d you create a read message targeting node 180d. Pick an unused address on both PLCs, make it the same address on both if possible. For example B3:100.

Add the following rungs right after the message:
XIC B3:100/1 OTE B3:3/1
XIC B3:100/2 OTE B3:3/2
XIC B3:100/3 OTE B3:3/3
XIC B3:100/4 OTE B3:3/4
XIC B3:100/5 OTE B3:3/5

On node 180d you need the following rungs:
XIC I:025/14 OTE B3:100/1
XIC I:025/15 OTE B3:100/2
XIC I:025/16 OTE B3:100/3
XIC I:025/17 OTE B3:100/4
XIC O:013/16 OTE B3:100/5

The key thing here is a message sends whole words. You can map anything you want into/out of those words on either end.

Just repeat the process for the read message on node 180d.

edit: I agree with everything Daba posted while I was writing.
 
Last edited:
The reson that most prefer MSG "reads" is that they involve much less processor 'overhead' than MSG writes. A Read simply goes and gets the data from another processor. A Write must alert the other processor, send the data, then ACK receipt.

Writes are better when the processor being written to must have the updated data ASAP. For example, a piece of equipment starts or stops, and the distant processor must make some "immediate" adjustment. In this case, you trigger the MSG write using the occurance of the time-sensitive event. If the distant processor is doing periodic Reads, it may be some unacceptable time before it learns of the change. Constant MSG reads can eat-up processor time unnecessarily. Communication, unfortunately, is not a strong suit of most PLC's. Hopefully that will change in the not-too-distant future.

My favorite way of "handshake" (so one processor knows the other is working) is to send the .ACC value of a continuously running counter. In the destination processor, simple logic checks to see that the value received does not remain static greater than xx seconds.
 
How do i choose how many words i want to send in the message. All i see is the size of message in elements?. What Port Number do i use if im using ethernet comms. thanks for the help!!
 
How do i choose how many words i want to send in the message. All I see is the size of message in elements?

It appears that you only need 1 binary element.
...the size of each element depends on the data table section you specify and the type of message command you use. For example, one binary element contains one 16-bit word and one floating-point element contains two 16-bit words. © 1997 Rockwell Software Inc.
 

Similar Topics

I have a weird problem. HMI response to operator input gets extremely slow under a certain condition: Vendors pallet wrapping machine consists of...
Replies
3
Views
1,911
Hello, confusion on the msg instruction configuration. We cannot find the target PLC-s in the communication path setup; however, we have made...
Replies
3
Views
2,716
Hi, I am trying to communicate between two plc-5's. I have programmed an MSG read instruction in PLC #2 to pull data from an R6: file from PLC#1...
Replies
3
Views
2,331
Hi all, I'm venturing into new territory, programming MSG instructions for the first time :eek: What I'm wanting to do is send an alarm bit from...
Replies
15
Views
14,201
I am currently having problems with MSG instruction taking up to 2 minutes on occasion transmitting 10 words of data between PLC-5s. The data...
Replies
1
Views
3,753
Back
Top Bottom