PCMusicGuy
Member
So a few years ago I jumped on the structured text bandwagon in ControlLogix as I wanted to structure some of our code in an easier-to-read fashion for some of the newer guys. It made sense when we would run loops on large sensor arrays and do different types of evaluations based upon the index to use the case statement; it sure makes it a lot easier to read than a bunch of ladder.
For a number of reasons, I've had to become concerned with making the code execute as fast as possible. I turned to the execution time document, 1756-RM087, ran some numbers and discovered that on paper the ladder would be most efficient for my needs.
I just finished testing some code on an L73 and it sure does run quicker on ladder. I have an array of 5000 sensor UDTs that I'm performing some simple alarming on (High High, High, Low, Low Low) and it takes into account a few BOOL statuses such as "out of service" or "I/O failure".
In ladder it executes at ~80 milliseconds while in structured text it is ~113 milliseconds. That probably wouldn't sound like a large difference to many of you but the way we use ControlLogix is a bit unorthodox here (i.e. no periodic tasks, tons of unconnected message transfers, etc.)
I just wanted to share my experience here in case some others run into execution time issues or just want to optimize as much as possible. The Rockwell document is a very good guide to use for this purpose.
For a number of reasons, I've had to become concerned with making the code execute as fast as possible. I turned to the execution time document, 1756-RM087, ran some numbers and discovered that on paper the ladder would be most efficient for my needs.
I just finished testing some code on an L73 and it sure does run quicker on ladder. I have an array of 5000 sensor UDTs that I'm performing some simple alarming on (High High, High, Low, Low Low) and it takes into account a few BOOL statuses such as "out of service" or "I/O failure".
In ladder it executes at ~80 milliseconds while in structured text it is ~113 milliseconds. That probably wouldn't sound like a large difference to many of you but the way we use ControlLogix is a bit unorthodox here (i.e. no periodic tasks, tons of unconnected message transfers, etc.)
I just wanted to share my experience here in case some others run into execution time issues or just want to optimize as much as possible. The Rockwell document is a very good guide to use for this purpose.