ygolohcysp
Member
Hello,
I was just reading about Double Coil Syndrome on an old post from here. It's something that I dealt with and figured out for the program I just finished with. I get why it works the way it does, although in my mind since this is programming, it should work the way I want it to.
Anyway, in my last program, I just got around it by setting up bool variables as output coils, and then used those in OR contacts going to the actual output coil.
But I'm wondering if there is a better practice. Sometimes I need timed sequences where there is a bunch of AND contacts, and Timer On's, and other portions for sequencing off and timers in those, all for Auto function. And I need a manual function, but still with protection parameters in place, and it doesn't always make sense to try to design the program around having each coil with an array of different inputs.
So is there a best practice for program design from the start? Rely on internal variables, so I can reference as many as I want, and then have all those variables point to one coil? Subroutines? Should I really try to layout the program around coils, and just make the inputs as scrambled and messy as they need to be to only have one coil reference?
Just trying to wrap my head around this as a function of design intent rather than problem solving later. I think it would make for more efficient code.
I was just reading about Double Coil Syndrome on an old post from here. It's something that I dealt with and figured out for the program I just finished with. I get why it works the way it does, although in my mind since this is programming, it should work the way I want it to.
Anyway, in my last program, I just got around it by setting up bool variables as output coils, and then used those in OR contacts going to the actual output coil.
But I'm wondering if there is a better practice. Sometimes I need timed sequences where there is a bunch of AND contacts, and Timer On's, and other portions for sequencing off and timers in those, all for Auto function. And I need a manual function, but still with protection parameters in place, and it doesn't always make sense to try to design the program around having each coil with an array of different inputs.
So is there a best practice for program design from the start? Rely on internal variables, so I can reference as many as I want, and then have all those variables point to one coil? Subroutines? Should I really try to layout the program around coils, and just make the inputs as scrambled and messy as they need to be to only have one coil reference?
Just trying to wrap my head around this as a function of design intent rather than problem solving later. I think it would make for more efficient code.