SLC Messaging Question

gmarowski

Member
Join Date
Apr 2011
Location
California
Posts
11
I ran across the following lines of code and I had a couple of questions. Keep in mind I'm fairly new and trying to understand the hows and why's of messaging. Here's the two rungs in question


See attached jpg:


My first question is: Wouldn't it be more appropriate to put the N14:0/13 branch around the N14:0/12 instruction then unlatch the message and start again?


Second: Why use the message bits at all? other then for error tracking, and to make sure the same message doesn't get sent repeatedly?


Thanks for the help in advance.

SLC Message.jpg
 
Generally MSG commands are used in pairs - READ & WRITE. The screenshot posted looks like that PLC is only writing to another.

There may be an issue having the error check on the same line as the enable since on an error the enable would drop and make the line false and not reset itself.

Plus there's the better-looking side of it - easier to read and follow.
 
Is it important to investigate/explain exactly how those particular two rungs work, or would you prefer a better message logic example ?

In general, that looks like a variation of a common self-retriggering logic, which was written in an SLC-5/02 programming manual in the 1980s and has survived.

That logic will trigger the MSG instruction on the first logic scan, then re-trigger it each time it completes successfully or unsuccessfully.

The second rung is not necessary. If the /ER bit (bit 12) is true, then the /EN (bit 15) and /DN (bit 13) status bits are false anyhow.
 
The common method for executing a repeating MSG instruction as fast as possible is to unconditionally execute the MSG instruction on its own rung, then set the Enable bit false every time the MSG completes.

Since the only two possible outcomes of an MSG are Done and Error, those are the two bits used as conditions to set the Enable bit false. This allows the unconditional rung to re-execute the MSG instruction on the next scan.

While this method has the advantage of getting data to its destination as fast as possible, it has the disadvantage of making it difficult to tell the difference between Errors and successful completions of the MSG, as well as using up as much of the controller's comms bandwidth as the user program can.

Classic_MSG_Logic.PNG
 
In general, I prefer to use a timer to trigger message instructions repeatedly, so that I can control how much impact they have on the PLC's buffers and network bandwidth.

I use the /EN bit as a condition for triggering the MSG so that if the MSG is waiting for a response or timeout, I don't execute another false->true transition and add another message to the channel buffer.

This also has the benefit of preserving the actual status of the /ER and /DN bits, as well as the error codes, for downstream diagnostic logic.

Classic_MSG_Timed_Logic.PNG
 
Thanks for the info and the example Ken. I was really curious about this because most of the other message instructions I've seen have been alone on a rung, or in conjunction with a timer as your last example depicted. Which makes a whole lot more sense to me than the example I posted. I also like the idea of being a little more in control of the timing, as I can't see bombarding the CPU with message requests every single scan cycle. (These are pretty small programs, I think the average scan time is 2-3ms). Thanks for your help and my education.
 

Similar Topics

I have a redundant ControlLogix being set up. This program reads a value from a remote site which happens to be SLC PLC. Rockwell mentions SLC...
Replies
2
Views
96
Hello, I have a ControlLogix redundant controller being set up. The program reads a value from a remote site which hosts a SLC PLC. Rockwell...
Replies
0
Views
80
A new Forum member resurrected an old post with a variation that I think should be done in a new thread to get the best attention and advice...
Replies
11
Views
2,365
Good morning, I’m looking for assistance on what hardware is needed to message from a CompactLogix L3 controller to a SLC 5/03 or 5/04 via serial...
Replies
2
Views
1,318
Good Evening , I'm sorry. so many PLC concepts I still struggle with. I need to move some 8 digit numbers from a SLC 500 5/05 processor to a...
Replies
12
Views
3,720
Back
Top Bottom