theColonel26
Lifetime Supporting Member
I am re-writing a mess the last guy left me. And a question came up on MSG execution logic.
So this code is Reading and Writing to a MicroLogix 1400 from a 5570 series processor. (Testing locally on a 5370 though)
Normally I use UDTs with messaging and I use 1 UDT for Reading and 1 UDT for Writing for each set of logic.
Further, I normally will have a timer Trigger All of my messages at once, and then use an XIO msg.EN to make sure that it doesn't trigger if the message is still active, otherwise with certain slow networks some messages would never get a reply.
However what this guy was doing with chaining each message together so that the next message would only execute if the last was done and had completed without error.
What are the pros and cons?
First con of mine is that you could in theory overwhelm the target PLCs Network buffer but I am kind of skeptical of that happening under normal circumstances.
First cons I see with his are, messages can take a really lone time. Depending on scan time. Like he had this running in a 500mS process (timer was kinda useless).
The second con is that if one of the MSGs fail then the rest will never be called.
His Code
My Code
So this code is Reading and Writing to a MicroLogix 1400 from a 5570 series processor. (Testing locally on a 5370 though)
Normally I use UDTs with messaging and I use 1 UDT for Reading and 1 UDT for Writing for each set of logic.
Further, I normally will have a timer Trigger All of my messages at once, and then use an XIO msg.EN to make sure that it doesn't trigger if the message is still active, otherwise with certain slow networks some messages would never get a reply.
However what this guy was doing with chaining each message together so that the next message would only execute if the last was done and had completed without error.
What are the pros and cons?
First con of mine is that you could in theory overwhelm the target PLCs Network buffer but I am kind of skeptical of that happening under normal circumstances.
First cons I see with his are, messages can take a really lone time. Depending on scan time. Like he had this running in a 500mS process (timer was kinda useless).
The second con is that if one of the MSGs fail then the rest will never be called.
His Code
My Code