I am wondering when the FirstScan bit is set by the program if it causes the PLC to do a Pre-Scan before the first scan that resets the bits, timers, counters, etc.
No it doesn't, you can't force a PreScan.
And the FirstScan does not reset timers, turn off bits etc., that is what the PreScan does except Counters, they are retentive, so are Retentive Timer On's
The FirstScan is a totally normal scan of the logic, it is just informing you that it is the first scan of the user program, so that you can action some initialisation of your own.
You could easily make your own "first scan" bit, and not mess about with the PLCs "FirstScan" status bit (to be honest I don't know why it isn't Read-Only). As the first rung of file 2 just put a ONS driving your "first scan" or "initialisation" bit, logically OR it with your HMI "Re-Initialise" button and you'd be good to go. I would also unlatch the HMI button input, effectively one-shotting it, because that will surely be ON for multiple scans of the logic, which would make it a "First Few Scans" bit. And then what would happen if the HMI went down at that moment just after the operator had hit the "Re_Start" button ? You definitely want to one-shot HMI button commands like that, for many reasons.
Last edited: