Logix 5000 - MSG sequence

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.
 

Similar Topics

Hello all, We have a 1756-L75 PLC with an EN2T module that we're using as a data concentrator. As a result we have many different MSG commands...
13
Replies
632
Views
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...
3
Replies
1,955
Views
I'm trying get information from another same PLC PLC1: CompactLogix 1769-L16ER-BB1B (192.168.0.133) PLC1: CompactLogix 1769-L16ER-BB1B...
17
Replies
4,505
Views
Hello everybody, I have a vendor system that has some remote monitoring (read only) and remote control (read/write) data that is available via...
7
Replies
4,005
Views
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...
10
Replies
8,427
Views
Top