Sequence Question

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!)


  • .
  • .
  • .
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!
 
Terry,

Thanks again for your help. So are you saying as far as setting a state bit it should only be done when some other part of the progam needs to know what state that subroutine is in. In other words if it is only internal to that subroutine juse use the logic as you pointed out in your suggestion to shorten the code. Thanks again for the help and suggestions.

John
 

Similar Topics

This should be a pretty easy question, would just like to have it explained a bit so I can understand it. In the attached program, why does the...
Replies
15
Views
4,749
Hi, I wrote a sequence loop using EQU and MOV instructions and would like to validate that i'm doing this properly. i attached a picture of the...
Replies
15
Views
614
Hello, I need to write the following program in Ladder language, but I could not integrate the Fibonacci sequence into the ladder. Can you help...
Replies
23
Views
659
To sequence through multiple MSG instructions with a Studio 5k program what are some preferred methods?
Replies
6
Views
588
Hi everyone, I am a newbie and I have trouble in the control sequence. I have a system with 4 pumps. The required: Ex: Push a button to start in...
Replies
21
Views
2,867
Back
Top Bottom