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 controlling valves in one moving motor in another so it is easier to debug.
However my question is what is a good programming style to control the sequence of events that occur?
What I currently do is do everything sequencily in steps, like step 1 is move Valve A, if valve A is forward go to step 2, then step 2 is to move Valve B, etc.
This works great for troubleshooting and messages to WinCC as you know exactly in what step it is in and what has to happen next.
But the problem is if the sequence is broken, then the entire sequence has to be resetted, parts have to be taken out if they are in inappropriate places, etc.
So what I would like to find out is is this the best structure of doing things as I can't find any standard?
Any advice would be appreciated
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 controlling valves in one moving motor in another so it is easier to debug.
However my question is what is a good programming style to control the sequence of events that occur?
What I currently do is do everything sequencily in steps, like step 1 is move Valve A, if valve A is forward go to step 2, then step 2 is to move Valve B, etc.
This works great for troubleshooting and messages to WinCC as you know exactly in what step it is in and what has to happen next.
But the problem is if the sequence is broken, then the entire sequence has to be resetted, parts have to be taken out if they are in inappropriate places, etc.
So what I would like to find out is is this the best structure of doing things as I can't find any standard?
Any advice would be appreciated