programming style

javmen99

Member
Join Date
May 2003
Posts
6
I have a basic understanding of the ladder logic programming structure. I understand that its possible to program subsets that enclose certain rungs. I’m confused as to how a “if-then” structure of programming would work. As an example: if x0 = 170 degrees F then turn on y0, y02, y22 (This would be a subset, one input to control various outputs). That subset would run until the next input became true (i.e. x1 = 180 degrees F and then turn on some other outputs.) This subset would run until a timer kicked the program to the next subset. Is this the best way to program the PLC? Am I correct in assuming that once the program has ran a subset it won’t go back and try to run it again?
 
PLCS programs run in a continuous loop.
Generally when you call a subroutine, the subroutine runs, and then returns back to the next rung in the main program.

scan.jpg
 
If I wanted the program to just run once is there a way I can trick the PLC into doing one loop? I would want the PLC to complete each subroutine in order and then when it starts the loop again the program would not run or search for inputs that aren't true. Perhaps nestling the an entire program including the subroutines and have two outputs; one being the first program w/ subroutines and the second being empty. Once the program is run a counter would trip the routing to the second program, which would be empty. end program.
 

Similar Topics

Dear Engineers, I think you can help me with understanding old style PLC code from ABB Prokontik. (DIN 19239) Please see attached photo from...
Replies
2
Views
1,559
Dear all, I was told by my new boss that I need to use state type programming style in the RSLogix5000. I was not have any experience with any...
Replies
20
Views
7,392
Hi I have a question about programming style. What I know is it is better to have a few sub routines grouping the functions together, like...
Replies
19
Views
6,711
Good Evening, All, Let me first apologize for this becoming something of a rant. I have a sort of a style-related question running around in my...
Replies
18
Views
9,177
Hi all, I've been reading up on latches vs seals. I am working with SLC500's. From what I understand, the only thing to be aware of regarding...
Replies
11
Views
5,581
Back
Top Bottom