Midweek PLC Musings
Truth And Fake News
Those of us still using Ladder Logic during some part of our day have a great advantage over the rest of the poor sods traversing this vail of tears: We have access to a resource only precious few have. Right there on the left rail of our ladder logic, is a pool of ultimate truth. Never to be soiled by conditions, opinions, tweets or other social postings. So far, not even the Russians have been able to dilute it. There is real truth there on the left!
Ok, and then you place an instruction there, on a new rung, say a Compare If Equal instruction. Now the ultimate truth moving into the instruction from the left is conditioned, diluted somewhat, made subject to something. It’s not nice what’s happening to our ultimate truth there. It can only squeeze through, if the two variables that the instruction is instructed to seek out, are equal. And I mean equal, real equal! Not in some approximate sense like North and South Vietnam, or the two Dakotas. No, our truth is particular, right down to the last bit. It will for instance not allow 5.00001 to be seen equal to 5. Nobody would be that fussy, but our truth processors, the PLCs we are privileged to work with are. Most of us have learned not to compare a floating point number to another (or to even an integer for that matter) to detect an equal state. Well, that is a lot more than can be said for a lot of public representatives. But things do not stop there, we are only mid-rung, even if it is a simple one. Once we have a state that we can trust to be either true - or not - we find a good use for it in applying it to do our bidding. We can feed this switching state into an output instruction that will turn on a dime (unlike your typical north american pickup). One instant the output, when fed the truth, turns on and like I said runs your bidding - a motor contactor say (and thereby a motor). And a mere ten milliseconds later when it is discovered that truth no longer matters, the output turns off (turning the contactor and thereby the motor off). Better be prepared for this. Truth is a sharp task master. When an output rapidly turns on and off what is the effect on the real world? The consequences of truth and its opposite should have been evaluated by you. Because the question is - can you and your logic handle he truth?
But, consider this: Some will call this fake news! Because by the time you try to prove that it happened, it’s long gone. If you are real crafty, you can set a trap to prove to yourself and others that it did happen. Some will use a latching instruction, but I have found that applying a counter instruction in parallel with the output provides more information. Now you not only find out if the rung ever turns true (if only for the few microseconds while it is being executed), but you also get an appreciation about how often it happens. But keep in mind that a counter instruction requires a transition from false to true in the rung condition feeding it. So you will only count half of the actual rung-output-true occurrences. You need to set up a counter enable unlatch instruction right after the counter instruction has been executed to count correctly every time the rung is true.
Do you have any experiences with truth or fake news?
Automation Team Lead | Process Industry | O&G Upstream and Midstream | Extroverted Nerd
5 年Yes sir, I have experience with fake news...try not having your JSRs, that happens when you sometimes troubleshoot someone's code and you expect proper things to be done.