ssweber (Customer) asked a question.

Catching common ladder logic bugs

I probably program a new click project once or twice a year. It's not my every day job. And every time I do, I can't believe all the simple ways I write bad code.

 

"Why isn't this working?"

  1. |--[ Mode < 1 ]--[ Mode > 3 ]--------( InvalidMode )--| accidental AND
  2.  
  3. fixed (OR):
  4. |--+--[ Mode < 1 ]--+----------------( InvalidMode )--|
  5. | | |
  6. | +--[ Mode > 3 ]--+
  7.  
  8. |--[ Setpoint > TD1 ]-----( Done )--| "setpoint is greater than... wait"
  9.  
  10. fixed:
  11. |--[ TD1 > Setpoint ]-----( Done )--|

If you're like me, these actually cost you time finding & fixing. I've found some in my machines that have been running for years!

 

The new version of ClickNick has a new 'Check Program' button that catches a bunch of common issues like this. Hope it helps someone here. see https://pyrung.com/clicknick/tour/checks/

 

ClickNick checking program for common ladder bugs