Allen Nelson
Member
Oneshots
In reading the file that MSinclair posted, I read the following:
And with that, I remembered how one-shots became "no-shots".
We had a Panelview with some buttons to set the mode ("Off", "Hand", and "Auto"). I think that each state wrote a value (0,1 or 2), thus setting/resetting a "Hand" and "Auto" bit.
We also had the following code:
Well, while the PLC was in program mode, someone went to the Panelview and changed the mode from AUTO to HAND. The Panelview still had communication, so it set the new bit pattern. When the PLC went back to RUN mode, the prescan SET the ONS bit (even though it was RESET when the PLC was last in RUN).
Since the HAND bit was SET, and the ONS bit was SET, the DO_SOMETHING never fired. So even through the PLC thought that the system was in HAND (and it was), the housekeeping that DO_SOMETHING did never took place, and, well, things weren't as they should have been.
So, one question I have for those who can experiment is, could the same thing happen with a physical, DI-type selector switch? There's alot that happens just as a PLC is getting powered up, and it takes a moment for the PLC to read the backplane to determine status of the inputs (or even for the DI module to detect the voltage and report it to the backplane)
MSinclair's attachment also contained the following
In reading the file that MSinclair posted, I read the following:
ONS - The programmed bit address of the instruction is set to inhibit false triggering when the first run-mode scan begins
And with that, I remembered how one-shots became "no-shots".
We had a Panelview with some buttons to set the mode ("Off", "Hand", and "Auto"). I think that each state wrote a value (0,1 or 2), thus setting/resetting a "Hand" and "Auto" bit.
We also had the following code:
HAND DO_SOMETHING
-----| |------[ONS}--------( )
Well, while the PLC was in program mode, someone went to the Panelview and changed the mode from AUTO to HAND. The Panelview still had communication, so it set the new bit pattern. When the PLC went back to RUN mode, the prescan SET the ONS bit (even though it was RESET when the PLC was last in RUN).
Since the HAND bit was SET, and the ONS bit was SET, the DO_SOMETHING never fired. So even through the PLC thought that the system was in HAND (and it was), the housekeeping that DO_SOMETHING did never took place, and, well, things weren't as they should have been.
So, one question I have for those who can experiment is, could the same thing happen with a physical, DI-type selector switch? There's alot that happens just as a PLC is getting powered up, and it takes a moment for the PLC to read the backplane to determine status of the inputs (or even for the DI module to detect the voltage and report it to the backplane)
MSinclair's attachment also contained the following
Again, this has the same properties as the one-shot; that a bit is unaturally set under the assumption that the data table didn't change while the PLC wasn't looking.CTU / CTD - The CU/CD bit is set to prevent a false count when the first run-mode scan begins