You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 24th, 2015, 02:29 PM   #1
defcon.klaxon
Lifetime Supporting Member
United States

defcon.klaxon is offline
 
Join Date: Feb 2015
Location: Far NorCal
Posts: 386
[Logix] Trying to understand MSG vs Produce/Consume communications

Hey guys,

So I've got my AB PLCs up and running, and now I'm trying to work out how to pass information between them. I've been reading about MSG vs produce/consume tags, but still have some questions about how I should set up my project and how these Logix PLCs work. In this project we're using a mix of ControlLogix and CompactLogix PLCs, though at the moment I only have ControlLogix spares at my desk.

We have several remote sites so we will poll them one at a time; I should mention here that we're using Ethernet/IP modules (1756-ENBT) and the remote sites will go through an Ethernet/IP radio (Xetawave 4x4E that I believe act as a router for all intents and purposes). Because we want to control the polling, I believe that requires me to use the MSG instruction since produce/consume tags seem to communicate automatically and there isn't a way to "schedule" reads/writes, is that correct? But when I read about MSG, according to this literature from Rockwell (page 13), MSG instructions can only access Controller Tags:
http://literature.rockwellautomation...m012_-en-p.pdf
So doesn't that really limit what I can send with MSG? Aren't controller tags just whatever I/O modules you have in the backplane? What if I want to do some scaling to 4-20mA inputs before sending the data, or I'm making decisions/alarm statuses that I need to communicate? EDIT: So I figured out I can create tags in the Controller Tags section, but if I'm writing ladder logic and want to define a tag there, it's Local Tags only. So that's annoying, but at least I can apparently create tags there and send them via MSG.

I'm also trying to figure out how to send boolean values; I've seen mentions of creating UDTs to do this, but I'm somewhat confused; all of my PLC experience has been simply addressing registers when passing values, and the way Logix does it seems much more convoluted.

I guess a large part of my confusion comes from the fact that we're using Ethernet/IP connectivity and all the tutorials I've found focus on easy connections all on a local network. That seems pretty easily understood, but when I then add in the discrete polling of remote sites it seems much more complicated. Any help you guys can provided is as always very appreciated.

Last edited by defcon.klaxon; September 24th, 2015 at 03:00 PM.
  Reply With Quote
Old September 24th, 2015, 03:02 PM   #2
danatomega
Lifetime Supporting Member
United States

danatomega is offline
 
Join Date: Mar 2011
Location: Dayton OH
Posts: 789
Quote:
Aren't controller tags just whatever I/O modules you have in the backplane?
Controller tags are most definitely NOT just the I/O. CompactLogix and ControlLogix are all tag based - all Booleans, DINT's, heck timers, counters - everything is tag based.
  Reply With Quote
Old September 24th, 2015, 03:19 PM   #3
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,832
You can definitely create tags in both the Controller and any of the Program scope databases.

The simple way is to open a Tag Database window, either the Controller one or any of the Program scope ones.

Sometimes you're creating tags in context by typing in a new tagname and allowing the software to prompt you to create it. You can definitely select either a Program or a Controller scope for that tag.

The MSG instruction only allows you to read and write tags that are part of the Controller scope database. It's just simpler.

BOOL tags can't be the source or target of a MSG or of a Produced/Consumed tag connection because it would be wasteful and inefficient, and A-B decided that instead of arguing with people about why they'd reached a resource limit by wasting resources sending BOOLs, they would simply not allow them to be used.

I always just select a bit inside a DINT when I need to send a true/false value and nothing else.
  Reply With Quote
Old September 24th, 2015, 04:12 PM   #4
defcon.klaxon
Lifetime Supporting Member
United States

defcon.klaxon is offline
 
Join Date: Feb 2015
Location: Far NorCal
Posts: 386
Quote:
Originally Posted by danatomega View Post
Controller tags are most definitely NOT just the I/O. CompactLogix and ControlLogix are all tag based - all Booleans, DINT's, heck timers, counters - everything is tag based.
Yeah I can see that now, my mistake. Thanks!
  Reply With Quote
Old September 24th, 2015, 04:16 PM   #5
defcon.klaxon
Lifetime Supporting Member
United States

defcon.klaxon is offline
 
Join Date: Feb 2015
Location: Far NorCal
Posts: 386
Quote:
Originally Posted by Ken Roach View Post
You can definitely create tags in both the Controller and any of the Program scope databases.

The simple way is to open a Tag Database window, either the Controller one or any of the Program scope ones.

Sometimes you're creating tags in context by typing in a new tagname and allowing the software to prompt you to create it. You can definitely select either a Program or a Controller scope for that tag.
Yeah I see what you mean. Apparently I need to change the "scope" of the tag I'm creating, and trying that was successful.

Quote:
The MSG instruction only allows you to read and write tags that are part of the Controller scope database. It's just simpler.
Gotcha. Now I get the gist, it seems akin to global vs local variables in C++ and if your local tags are separate, my guess is that copying and pasting is much simpler.

Quote:
BOOL tags can't be the source or target of a MSG or of a Produced/Consumed tag connection because it would be wasteful and inefficient, and A-B decided that instead of arguing with people about why they'd reached a resource limit by wasting resources sending BOOLs, they would simply not allow them to be used.
Thanks for the explanation.

Quote:
I always just select a bit inside a DINT when I need to send a true/false value and nothing else.
Sounds like a good way to do it; do you have to convert the booleans you want to send into DINTs with add'l ladder logic? Would you package multiple boolean bits into a single DINT and then break it out on the receiving end?
  Reply With Quote
Old September 24th, 2015, 04:22 PM   #6
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,384
Quote:
Originally Posted by defcon.klaxon View Post
Sounds like a good way to do it; do you have to convert the booleans you want to send into DINTs with add'l ladder logic? Would you package multiple boolean bits into a single DINT and then break it out on the receiving end?

It's more efficient to simply create a DINT array to use for bit references within your program, rather than creating individual BOOLs.

Each BOOL that you create consumes 32 bits of memory anyway.
__________________
  Reply With Quote
Old September 24th, 2015, 04:38 PM   #7
ChristianNondorf
Member
United States

ChristianNondorf is offline
 
Join Date: Jun 2010
Location: Beaver Dam,WI
Posts: 6
"Because we want to control the polling, I believe that requires me to use the MSG instruction since produce/consume tags seem to communicate automatically and there isn't a way to "schedule" reads/writes, is that correct?"

Actually, when you set up the connection properties for a produced/consumed tag, you can specify the polling rate (RPI). So you are not limited to MSG instructions in this regard.
  Reply With Quote
Old September 24th, 2015, 04:46 PM   #8
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,384
One important advantage of using the MSG instruction is the capability to modify messaging in online mode. You may also write logic to trigger data transfers only on exception, rather than unconditionally.
__________________
  Reply With Quote
Old September 24th, 2015, 05:01 PM   #9
ChristianNondorf
Member
United States

ChristianNondorf is offline
 
Join Date: Jun 2010
Location: Beaver Dam,WI
Posts: 6
Quote:
Originally Posted by Bit_Bucket_07 View Post
One important advantage of using the MSG instruction is the capability to modify messaging in online mode. You may also write logic to trigger data transfers only on exception, rather than unconditionally.
This is a great point. Using a MSG also does not count towards the limitation on active connections. Produce/Consume connections have quantity limitations. The only limitation on the quantity of MSG instructions is the messaging buffer.
  Reply With Quote
Old September 24th, 2015, 05:57 PM   #10
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,832
Quote:
[...] convert the booleans you want to send into DINTs with add'l ladder logic? Would you package multiple boolean bits into a single DINT and then break it out on the receiving end?
Exactly.

A typical command set for a pump drive would be something like:

CommandWord.0 Start
CommandWord.1 Stop
CommandWord.2 Reset Faults
CommandWord.3 Speed Select 1
CommandWord.4 Speed Select 2
(and so on)

All those bits get sent in a message, packed into CommandWord. Maybe I even copy CommandWord into an array like "Station1Outputs[x]" and send that whole array.

And on the other end, you just unpack them with simple sets of XIC/OTE rungs. Clarity counts for a lot... brute force logic to encode things might look inelegant, but when it has to be troubleshot a decade later it's wonderful.
  Reply With Quote
Old September 24th, 2015, 06:21 PM   #11
defcon.klaxon
Lifetime Supporting Member
United States

defcon.klaxon is offline
 
Join Date: Feb 2015
Location: Far NorCal
Posts: 386
Quote:
Originally Posted by ChristianNondorf View Post
"Because we want to control the polling, I believe that requires me to use the MSG instruction since produce/consume tags seem to communicate automatically and there isn't a way to "schedule" reads/writes, is that correct?"

Actually, when you set up the connection properties for a produced/consumed tag, you can specify the polling rate (RPI). So you are not limited to MSG instructions in this regard.
Yes you can adjust the RPI, but can you control the polling process from site to site? It seemed to me that RPI can adjust how fast the cycle is, but doesn't control each step. The customer wants to be able to take a site out of the radio loop entirely (seasonal wells for example, or maintenance of wastewater lift stations) and also wants to be able to "fast poll" a site where the radio link stops at a certain site for a temporary period and only focuses there (like if a lift station was close to overflowing, they want to not have to wait for the whole polling cycle to get an update on the level). Our radios are estimated to be about 20kbps bandwidth so I believe the idea was that we would rather poll each site separately instead of waiting for the data to trickle in and having the radio deal with the incoming connections.
  Reply With Quote
Old September 24th, 2015, 06:30 PM   #12
defcon.klaxon
Lifetime Supporting Member
United States

defcon.klaxon is offline
 
Join Date: Feb 2015
Location: Far NorCal
Posts: 386
Quote:
Originally Posted by Ken Roach View Post
Exactly.

A typical command set for a pump drive would be something like:

CommandWord.0 Start
CommandWord.1 Stop
CommandWord.2 Reset Faults
CommandWord.3 Speed Select 1
CommandWord.4 Speed Select 2
(and so on)

All those bits get sent in a message, packed into CommandWord. Maybe I even copy CommandWord into an array like "Station1Outputs[x]" and send that whole array.

And on the other end, you just unpack them with simple sets of XIC/OTE rungs. Clarity counts for a lot... brute force logic to encode things might look inelegant, but when it has to be troubleshot a decade later it's wonderful.
OK, thanks for describing this!
  Reply With Quote
Old September 24th, 2015, 07:37 PM   #13
defcon.klaxon
Lifetime Supporting Member
United States

defcon.klaxon is offline
 
Join Date: Feb 2015
Location: Far NorCal
Posts: 386
OK, I have been able to get the MSG command to pass data from one PLC to another, so I've been able to figure out the basic MSG functionality.

But what if I have a lot of data to pass back and forth? Do I have to create a MSG block for each tag, or can I do it in batches? I did mess around with creating arrays and passing multiple values, so I understand that functionality. But if I don't want to create a MSG for each individual tag, do I have to wrap them up into an array? And then manually alias every tag into the array? I sure hope I'm missing something here because I'm not seeing any easy way to do this.
  Reply With Quote
Old September 24th, 2015, 07:54 PM   #14
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,832
Quote:
[If] I don't want to create a MSG for each individual tag, do I have to wrap them up into an array?
Yes.

I suppose that an "easy way" would be to have an MSG where you create a little table of tags you want to transmit, and then export that table to the project that's receiving them. Logix doesn't have that sort of function.

But it's not a whole lot harder to just write a subroutine that copies tag values into each element of an array of DINTs and an array of REALs.

I do this all the time when I'm sending a variety of data through a low-bandwidth link like a radio. There's a routine called 'PACK_Data' and another one called 'UNPACK_Data'. I trigger them just once prior to and immediately after the MSG instruction handshaking.
  Reply With Quote
Old September 25th, 2015, 11:13 AM   #15
defcon.klaxon
Lifetime Supporting Member
United States

defcon.klaxon is offline
 
Join Date: Feb 2015
Location: Far NorCal
Posts: 386
Quote:
Originally Posted by Ken Roach View Post
Yes.

I suppose that an "easy way" would be to have an MSG where you create a little table of tags you want to transmit, and then export that table to the project that's receiving them. Logix doesn't have that sort of function.
That's what I would expect, yeah.

Quote:
But it's not a whole lot harder to just write a subroutine that copies tag values into each element of an array of DINTs and an array of REALs.

I do this all the time when I'm sending a variety of data through a low-bandwidth link like a radio. There's a routine called 'PACK_Data' and another one called 'UNPACK_Data'. I trigger them just once prior to and immediately after the MSG instruction handshaking.
I am assuming you are naming your subroutine PACK_Data and UNPACK_Data and that those aren't functions native to Logix, right? As in, I need to create those rather than grabbing them as a Functional Block.

Last edited by defcon.klaxon; September 25th, 2015 at 11:16 AM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
losing communications MAC P. LIVE PLC Questions And Answers 19 December 3rd, 2014 11:27 AM
Ethernet Communications between 2 x S7 315 2PN/DP PLCS MorphuisOGrady LIVE PLC Questions And Answers 6 January 16th, 2014 02:57 AM
ML 1100 ethernet communications gouch LIVE PLC Questions And Answers 2 May 23rd, 2011 06:27 AM
Siemens S7-200 communications fredjohns LIVE PLC Questions And Answers 3 July 8th, 2009 12:09 PM
Direct communications with AB PLC's jrpisci LIVE PLC Questions And Answers 5 September 19th, 2006 03:46 PM


All times are GMT -5. The time now is 06:38 AM.


.