defcon.klaxon
Lifetime Supporting Member
Hey guys,
I'm working on an existing system where the old programmer (from like 25 years ago) used a bunch of conditional scripts in Wonderware to execute said scripts once a minute. Programmer did this by using "$Second MOD 59 == 0" as the condition. Seems like it would work, but doesn't this condition become true twice a minute (when $Second == 59, but also when $Second == 0)?
The problem is, the operators aren't aware of what is new and what is old, so when they notice something not working, they assume it's because of my new work, and not something that has literally been around for 25 years (and I've already fixed a few bugs they've been complaining about for literally 25 years!).
I'm going to remove the conditional scripts and create the same code in LD (flow totalizers and ETM) but for future reference, was wondering if the $Second MOD xx == 0 code is valid, or if it should be avoided.
I'm working on an existing system where the old programmer (from like 25 years ago) used a bunch of conditional scripts in Wonderware to execute said scripts once a minute. Programmer did this by using "$Second MOD 59 == 0" as the condition. Seems like it would work, but doesn't this condition become true twice a minute (when $Second == 59, but also when $Second == 0)?
The problem is, the operators aren't aware of what is new and what is old, so when they notice something not working, they assume it's because of my new work, and not something that has literally been around for 25 years (and I've already fixed a few bugs they've been complaining about for literally 25 years!).
I'm going to remove the conditional scripts and create the same code in LD (flow totalizers and ETM) but for future reference, was wondering if the $Second MOD xx == 0 code is valid, or if it should be avoided.