Terry Woods
Member
- Join Date
- Apr 2002
- Posts
- 3,170
I forgot to tell you, although it shows in my posting...
Always hit "return" after the /LADDER thing AND put one character of any kind on the next line then hit "return" again. Otherwise, the text runs off into the sunset (somewhere to the right side of the screen) and disappears. It's some kinda bug in the control code handler.
Also, a very important thing to do is... "PREVIEW before SUBMIT!"
Now, my comments... (for what they are worth...)
The actual output code for the valves is good where it is at. However, your code for "State-X" and "Step-X" is layed out in a form I call "Advance to the Rear". That is, the PLC has to do an extra scan before it can respond to the "change-in-state".
I suggest that you place the "State-X" code before the SET/RST "Step-X" code. The outputs can then respond at the end of the same scan.
It's not a real big deal in this application, but, making the code respond as quickly as possible becomes more important in critical timing situations. "Advance to the Front" is more productive - it's simply a good habit to get into.
Your code is OK. It will work.
However, I would simplify the code thusly... (Now, bear in mind, there is no more powerful force in the universe than the urge to edit!)
Your code can be reduced from 12 lines to 7 lines without introducing any complexities.
BTW, your code, as written, translates directly into a flowchart. That is ALWAYS a sign of good organization! You should always try to develop your code using flowcharts. They will give you a visual of your process and clearly show where you might be starting to develop spaghetti-code!
Always hit "return" after the /LADDER thing AND put one character of any kind on the next line then hit "return" again. Otherwise, the text runs off into the sunset (somewhere to the right side of the screen) and disappears. It's some kinda bug in the control code handler.
Also, a very important thing to do is... "PREVIEW before SUBMIT!"
Now, my comments... (for what they are worth...)
The actual output code for the valves is good where it is at. However, your code for "State-X" and "Step-X" is layed out in a form I call "Advance to the Rear". That is, the PLC has to do an extra scan before it can respond to the "change-in-state".
I suggest that you place the "State-X" code before the SET/RST "Step-X" code. The outputs can then respond at the end of the same scan.
It's not a real big deal in this application, but, making the code respond as quickly as possible becomes more important in critical timing situations. "Advance to the Front" is more productive - it's simply a good habit to get into.
Your code is OK. It will work.
However, I would simplify the code thusly... (Now, bear in mind, there is no more powerful force in the universe than the urge to edit!)
- .
- .
- .
Minor Major
Step-2 is EXT is EXT
---| |------| |-------| |---+---( R ) RST Step-2
|
+---( R ) SET Step-3
Minor Major
Step-3 is RET is EXT
---| |------| |-------| |---+---( R ) RST Step-3
|
+---( R ) SET Step-4
- .
- .
- .
Your code can be reduced from 12 lines to 7 lines without introducing any complexities.
BTW, your code, as written, translates directly into a flowchart. That is ALWAYS a sign of good organization! You should always try to develop your code using flowcharts. They will give you a visual of your process and clearly show where you might be starting to develop spaghetti-code!