Logix 5000 - MSG sequence

kochelm

Member
Join Date
Feb 2021
Location
PA
Posts
1
To sequence through multiple MSG instructions with a Studio 5k program what are some preferred methods?
 
I build a state machine in structured text where the state machine moves one step forward and backwards by setting a tag to 1. I use a large case and switch to do this, that way I can idle on a step until a message completes. I usually have 2 steps per message. The first step to prep the message and send it, and the second step to wait for the message to complete or error, if it completes then I parse the result if there is one.
Then I can build the case and switch with as many steps as I need to sequence the messages. I will also add a done output bit, and a reset input bit. I also have an error bit to indicate a failure, and use the step number as the error code. On more complex systems that have multiple possible errors per step I will use the step number * 100, then use 0 to 99 within the step number as the error code for that step.
 
I use the AB suggested programming for sequencing multiple messages, it works very well in my experience. I've attached the generic program that I received from my contact at my local AB distributor.
 
I use the AB suggested programming for sequencing multiple messages, it works very well in my experience. I've attached the generic program that I received from my contact at my local AB distributor.

The .ER bit seems to be redundant, since setting .TO will set .ER bit and also move to the next state.
 
The .ER bit seems to be redundant, since setting .TO will set .ER bit and also move to the next state.

Not if the MSG errors for some other reason within the Timeout period.

The method I use is functionally equivalent to that example, but I don't mess with the TO bit or roll my own custom timeout for each message, I just set the MSG element *.UnconnectedTimeout values to the number of microseconds I want so that the sequence isn't sitting there for minutes waiting on a response from some device that's powered down.

I adopted my method for Micrologix and SLC mainly for use with radio modems talking to multiple RTUs where I knew I needed 2 or 3 seconds max per station for a response as well as the ability to skip stations that might be offline for maintenance. The Micrologix and SLC used whole seconds for the "MTO" element, and in studio, they jumped to microseconds. Took me a bit to figure that out.
 
Last edited:

Similar Topics

hi , I need to sorry for my bad English first. I'm newbie at plc programming ,I had been asked about E/IP protocol information for some system...
Replies
3
Views
385
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,590
Hello everybody, I have a vendor system that has some remote monitoring (read only) and remote control (read/write) data that is available via...
Replies
7
Views
2,876
What's the best way to use lots of MSG instructions in the same program? Both multiple messages with the same device, and other devices. I've read...
Replies
10
Views
1,177
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,459
Back
Top Bottom