News:

  • June 27, 2026, 04:42:05 PM

Login with username, password and session length

Author Topic: End statement needed?  (Read 5687 times)

Garyhlucas

  • Hero Member
  • *****
  • Posts: 421
End statement needed?
« on: November 22, 2016, 02:56:46 PM »
So programs with no end statement appear to work just fine. There are always a bunch of NOPs at the end of a program. Does the PLC just waste time scanning those, decides there isn't any more to do and just give up?  Should we always use an END statement? Some PLCS refuse to run without the end statement.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: End statement needed?
« Reply #1 on: November 22, 2016, 03:16:26 PM »
The PLC is intimately aware of the actual last instruction of each program block. END statements are not required, and there is no penalty for leaving them out.

They are supported though, and are useful for bypassing code. It's great to be able to stick one at the top of a block when debugging.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO