Are RsLogix MSG elements atomic?

quadPLC

Member
Join Date
Feb 2010
Location
Milwuakee
Posts
51
Hi guys, quick question

I am programming a SLC5/03 (DH485) MSG block to pass some data (some bits). In the help file for this command it says that the MSG block messaging occurs during the end of the scan. Is it safe to assume all data will make it into the registers of the target PLC before they can be evaluated?

The reason I ask is because I want to pass over some configuration bits and an "enable" bit. However, I want to make sure all my configuration bits are in place before the target PLC starts executing anything with those configuration bits (I worry about only half the bits being in place).

Thoughts?
 
You can't MSG individual bits. The minimum is a word, i.e. N7:1, F8:2, B3:0, etc.

Yes. To clarify, I would be sending B9:0 -> B9:5, though I would actually parse out individual bits (ex: B9:0/5) to set certain configuration settings on the target device. I just need to make sure all the data is there before executing the logic.
 
I suggest you send two messages then. First the data. Then one word that contains the enable bit.

Alternatively, Each word carries the enable bit (if you have enough spares), when all six are set then execute the logic.
 
Alternatively, Each word carries the enable bit (if you have enough spares), when all six are set then execute the logic.

That's a very cool idea.

I had originally envisioned the target device setting all the config bits and then turning off the execution bit (this way, these settings would not prevent a user from changing them later on an HMI attached to the target device).

However, I think what I will do is read back the configuration bits from the target (already grabbing most of this data anyway) and, upon detecting that all the configuration has be set exactly to how I sent it, I will turn the execution bit off on the sending device.

*shrug* Per usual, there are 100+ ways to skin a rabbit.
 
Another thing you can do, is COPy the words on a branch right above your MSG. Then the MSG will be enabled and queued, and (as long as you only do the COP once), those bits won't change during the time between enabling the MSG and the time it actually executes.

But, I think that when the MSG is enabled, the data inside it is stored away anyhow. I would have to research that, or wait for an expert to confirm it (Oh, Ken, are you watching?).
 
Paranoia perhaps ...

If you have the room, I would suggest this method - it has worked for me.

It uses a message counter at the beginning and at the end of the message. When they are the same, the data is valid and is not changing.

COPy B9:0 to N10:1 for a length of 6 (0 - 5)
Add 1 to N10:0 (message counter)
Mov N10:0 to N10:7
Do your message

On the receiving side, assuming a destination of B11, when B11:0 = B11:7 you have valid data and it is not changing in the middle of your scan.

I would personally copy it to another location for use

EQU B11:0 B11:7 cop B11:1 to B12:0 for a length of 6

Then access the data from B11:0/5 (I think that was your address example)

I chew up a lot of datatable this way, but in my experience it's easier to troubleshoot.
 

Similar Topics

I'm trying get information from another same PLC PLC1: CompactLogix 1769-L16ER-BB1B (192.168.0.133) PLC1: CompactLogix 1769-L16ER-BB1B...
Replies
17
Views
1,606
I'm getting an Error code on my MSG instruction that I can't clear. The Error Code Number is d0. Description "No IP configured for the Network"...
Replies
0
Views
869
Hello everyone, it is the first time that I need to exchange messages between 2 PLCs, a L16ER-BB1B and an L61. The first has 192.168.1.1 as its...
Replies
15
Views
4,472
Hello, I was curious if any one could shed some light on setting up a MSG statement between two PLC's on different networks. I'm trying to read...
Replies
1
Views
1,331
If you click help and then click Vendor Sample Projects while in RSLogix 5000, a PDF will pop up with some neat examples. One example shows how to...
Replies
5
Views
3,869
Back
Top Bottom