MSG instruction

tgaljar

Member
Join Date
Apr 2006
Location
Virovitica
Posts
69
Hi everyone, I have one question for all AB PLC experts,



I am using msg instruction on SLC 5/03 and as I noticed that it uses too much memory locations exactly 14 memory locations per msg. I need to turn on and off 6 pumping stations by sending msg instructions to 6 micrologix 1500. So I need 12 msg instruction 6 for ON and 6 for OFF. And that uses almost whole 5/03 memory. So my question is: is there some clever way of using msg instruction and save memory???



Thanks for your answer!
 
Twelve message control blocks might use the majority of a single Data File (they can be up to 255 words in length each), but that's not nearly the full size of the memory in the SLC-5/03.

Create another data file specifically for your message instruction control blocks, and use different data files for the source and destination data, and still more data files for other functions in the SLC controller program.

Only the first nine or so data files are predefined; any data file number higher than 10 can be created as any data type.
 
I am not an AB expert, so cannot comment on the best way to this, but I think that you need a read & a write msg instruction in each remote PLC, the read for controlling the pumps, and the write for reporting back to the master PLC.

Then as you stated, you would need 2 msg instructions for each pump station, which would equal 12 msg instructions, which you say is to many.

I would also think that you could use indirect addressing, and only have 1 read & write instruction in the master PLC, and then poll each PLC seperately through the one instruction.

Unless of course there is another way to do this, and i am sure that when america wakes up, there will be plenty of responses that will provide more wisdom than me.
 
Thanks people for your quick answers!





OK I've created data file called MG11 with address N9. My first message instruction has control block N9:0 to N9:14. To start a pump I am sending N7:151 filled with all ones. In a message setup screen I am using this N7:151 for “data table address” on master PLC. As a target word I am using N7:4. Remote Micrologix1500 is testing first bit in N7:4 and if it is one it starts pump. Master waits for message done bit but doesn’t need another acknowledge message from Micrologix that pump is working. That is because Remote PLC is sending his status word every 20 sec to inform master that it is alive.



To stop pump I am using another message instruction on master PLC with control block N9:15 to N9:25 and sending the same word N7:151 but target word on Micrologix is N7:5. When Micrologix detects that N7:5/0 is one it stops pump.

Two messages are “write” and will never appear in the same time because process is slow and there is 5 min delay between every action.



What are your opinions about this kind of pump control?
 
I think that I am reading that you use 2 messages blocks going to one 1500. If I am correct, you can use just 1 message block.The way you are doing it, you would just set the length to 2. This way start pumps using N7:4 and the stop pumps use n7:5.


This way then you would only need a total of 6 message blocks total.

You could also look at change of state logic to trigger the message blocks so they are only triggered when needed.
 
I think you are making this too tough.

I don't think you are going to run out of memory. We have used SLCs to control six remote blowers, with run commands and flow setpoints to each and reading all performance data and all local setpoints. It came to 18 blocks, no problem.

We just use one bit in one word for run and stop for each. If the bit is one, the remote unit starts, if it is off the remote stops. We use separte integer files for each set of reads and each set of writes.

Ken is right - you can make the size of the file anything you want. I can't see you running out of memory. We use the following technique to sequence each message block in turn. Each block controls the next one, and the last controls the first.
 
Greetings tgaljar,



My first message instruction has control block N9:0 to N9:14.



more likely this should be N9:0 through (and including) N9:13 ...



To stop pump I am using another message instruction on master PLC with control block N9:15 to N9:25



more likely this should be N9:14 through (and including) N9:27 ...



the point of bringing this discrepancy up is that you must be very careful with how you assign these addresses ... if you try to overlap the control blocks, the software will NOT warn you that you’re about to make a mistake ... things will become very confusing ... the assignments that you've mentioned do not overlap ... but if you keep using the same pattern, the next assignment probably would ...



if you don’t already know about the “Usage” feature, then this trick might help by showing which addresses have been used - and which ones are still available ...



msgmem.JPG





the 14 addresses marked with X’s have already been assigned to the first MSG instruction ... leave these alone ... the next available “free” location is N9:14 ...



going further ... most programmers would not use two separate MSG instructions to control each pump ... a much more common approach would be the following arrangement:



suppose that N7:151 is the “transfer” word ...



to turn the pump ON, the program would MOV a 1 (or some such “code”) into N7:151 - and then trigger the MSG to write the word to the remote controller ...



to turn the pump OFF, the program would MOV a 0 (or some such “code”) into N7:151 - and then trigger the MSG to write the word to the remote controller ...



the remote controller would be programmed to properly interpret the various “codes” and turn the pump either ON or OFF as appropriate ...



basic idea: this way you have only one “mailman” (MSG) instruction ... he carries a “letter” (N7:151 = 1) which says “turn-the-pump-on” ... or he carries a “letter” (N7:151 = 0) which says “turn-the-pump-off” ... specifically, most programmers would not use two separate “mailmen” (MSG) instructions for this particular job ...



going further ... if your system becomes more complicated in the future, this approach will also allow you to send many additional commands (besides just ON and OFF) to the remote controller without having to add another memory-consuming MSG instruction for each and every type of command ... just use a different “bit-pattern-code” for each type of command ... the same “mailman” carries different contents in the “letters” ...



finally, if none of this makes sense to your problem, then I might have misinterpreted what you have been posting ... if so, I apologize ... I hope this helps ... good luck with your project ...
 
Last edited:
Thanks Ken Ron and Tom,



Till now I've worked only with Siemens PLCs so I didn't know that I can make another data file for my MSG instructions, but now I can see that I can’t run out of memory. AB has somehow another memory division than Siemnes and I need some time to get use to it.





Tom you posted nice way of triggering MSG instruction and I’ll keep that idea on my mind.



Yes Ron I’ve noticed that I don’t need so many MSGs so I made first bit in word for pump start and second for pump stop. But I will never trigger an action with logical zero, even if it is shut down action. My way is that only “ones” are making changes.





Other thing, I am using Rslogix 6.0 and it is reporting overlapping errors for MSG instruction. I tried to verify program with two MSGs on a distance less than 14 words, and Rslogix reported an error.



Thanks again!

 
Greetings tgaljar,



in an earlier post I said:



if you try to overlap the control blocks, the software will NOT warn you that you’re about to make a mistake ... things will become very confusing



in your latest post, you said:



I am using Rslogix 6.0 and it is reporting overlapping errors for MSG instruction. I tried to verify program with two MSGs on a distance less than 14 words, and Rslogix reported an error.



some of our more attentive readers might be wondering: “who’s right? - who’s wrong?” ... let me try to clear up some of the confusion ...



preview: actually we’re BOTH right ...



suppose that I’m using version 6.0 of RSLogix500 (the same as tgaljar’s) ... suppose that I’m offline and writing a program for an SLC-5/03 (same as tgaljar’s) ...



I enter a new rung ... I place an MSG instruction on the rung ... I use N9:0 as the first word of my control block ... I fill out the MSG Setup Screen as shown below ...



overlap1.JPG




then I right-click the new rung number ... I select “Verify Rung” from the popup menu ... the rung is verified with no errors or warnings ... and the rung looks like this ...



overlap2.JPG




so far, so good ... but just to make sure, I reopen the MSG Setup Screen ... it looks just like before ... the sun is shining ... the birds are singing ... life is lovely ...



now the stage is set ... here comes the tricky part ...



I enter another new rung ... I place an MSG instruction on this new rung ... I use N9:1 as the first word of my control block ... oops! ... that’s a mistake! ... let’s nail this idea down ...



specifically, the control block of the first MSG started at N9:0 ... the control block is 14 words long ... that means that the control block of the first MSG instruction uses words N9:0 through (and including) N9:13 ... by starting the control block for my second MSG at word N9:1, I have blundered and overlapped my PLC’s memory ... but suppose that I don’t notice the error ... at this point, I’m still fat, dumb, and happy ...



quick question: did the software warn me of my “overlap” error? ... nope ... no warning ...



oblivious to the impending doom, I continue by filling out the new MSG Setup Screen as shown below ...



overlap3.JPG





then I right-click the new rung number ... I select “Verify Rung” from the popup menu ... once again, my MSG rung is verified with no errors or warnings ... even though I have indeed overlapped the memory assignments ... and now my program looks like this ...



overlap4.JPG





so there they are folks ... two MSG rungs ... both verified ... no error messages ... but clearly the memory is overlapped ...



now let’s go back and reopen the Setup Screen from the first MSG instruction ...



warning! ... the following figure contains frightening images which might be too intense for young programmers! ...



overlap5.JPG





whoa! this is indeed an ugly situation ... what happened to the “Size in Elements” entry? ... it was supposed to be “1” ... but now it’s “4” ... what happened to the “Message Timeout” entry? ... it was supposed to be “5” ... but now it’s “0” ... what happened to the Target Device’s “Data Table Address” entry? ... it was supposed to be “N7:0” ... but now it’s just “1” ... what happened to the “Local Node Address” entry? ... it was supposed to be “2” ... but now it’s “0” ...



these entries were all correct before ... but something has changed them “behind-our-back” ... the culprit is the control block of the new MSG instruction ... when I overlapped the memory, the values which were encoded into the new MSG control block OVERWROTE some of the values which had previously been encoded into the control block of the first MSG ...



quick question: did the software warn me before these changes were made? ... nope ... no warning ...



and so ... this is EXACTLY what I meant in that earlier post when I said:



if you try to overlap the control blocks, the software will NOT warn you that you’re about to make a mistake ... things will become very confusing



I think that I’ve proven my point ... so it looks like I was correct ... but remember, tgaljar said that the software DID indeed provide a warning ... well, it turns out that tgaljar is correct also ... stay tuned ...



suppose that now that I’ve made my blunders, I decide to “Verify” one more time ... (and actually/luckily this “extra” verification will be done automatically before I can download my offline program to the processor) ... but this time when I verify, I’m not going to right-click the rung number and select “Verify Rung” ... instead I’m going to click on the “Verify File” icon ... watch what happens ...



overlap6.JPG




this time I do indeed get an error message ... but notice that it says nothing about the underlying problem ... specifically, the message doesn’t say anything about the overlapped memory ... at this point, it’s only concerned about one of the entries in my first MSG ... so let’s say that I go back into that Setup Screen and fix the problem ...



remember that at this point I still haven’t realized that I’ve overlapped my memory ... and specifically, the software hasn’t mentioned it to me either ... so as I open the first MSG Setup Screen I think to myself: “hmmm? ... I wonder how the heck THIS stuff got changed?” ... (must have been a “power surge” or something) ... anyway, I fix the entries so that now the first MSG is back just like it was in my first figure of this post ...



ok ... now let’s try that “Verify File” operation again ...



overlap6a.JPG





another error message ... but this time it’s complaining about the entries in the SECOND MSG ... so back and forth we go ... are we having fun yet? ...



ok, folks ... enough of this silliness ... the point is that depending on HOW MUCH of an overlap you make ... and depending on what VALUES you enter inside the Setup Screens ... and depending on whether you right-click and “Verify the Rung” ... or depending whether you click the “Verify File” icon ... you MAY (or you may NOT) get an error message from the software when you overlap the memory with your MSG control blocks ... and this is just some of the “confusion” that I was warning about in my earlier post ...



but let’s do just one more ... remember that tgaljar saw a message that was “reporting overlapping errors for MSG instruction” ...



suppose that I start my program over from scratch ... I use the same settings for my two MSG instructions ... except that this time I space my two control blocks further apart ... now they are still OVERLAPPED - but this time just barely ...



my MSG rungs have already been verified using the right-click “Verify Rung” technique - with NO error messages reported ... and now I click the “Verify File” icon ...



overlap7.JPG





and yes, the software does indeed correctly report the overlap ... at least it does THIS time ... so it looks like tgaljar and I were BOTH correct ... as with so many things in life, it all depends ...
 
OK no problem Ron, probably I have misinterpreted your answer. I just noticed that you can’t download program to PLC with overlapped MSG addresses so you can’t make any harm, just need to think more to figure out what caused the error.
 

Similar Topics

I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
87
Hello all, I am currently trying to establish a message instruction to pass data from a 1756-L73 to a 1756-L71. My communication path from the...
Replies
8
Views
352
Hello Friends I am trying to connect to a Zebra printer. I can print the label with hyperterminal both by RS232 and TCP/IP. Now, I am trying to...
Replies
7
Views
276
Can Anyone tell that How Msg Instruction comes under Unscheduled communication and How System Overhead time slice(SOTS) function connected to it...
Replies
1
Views
968
Studio5000, V31 I'm Messaging a MassFlow Meter, specifically to pull the Engineering Units (units of measure) for 6 instances. Basically, do I...
Replies
2
Views
1,204
Back
Top Bottom