Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Garyhlucas on November 22, 2016, 02:56:46 PM

Title: End statement needed?
Post by: Garyhlucas 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.
Title: Re: End statement needed?
Post by: BobO 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.