The compiler enables you to write your own exception programs for handling particular system events. The following exceptions can be handled:
Exception handling is supported for both Normal and Optimized PLC code generation.
In the sub-program that handles the exception you can perform any safety or trace operation. You then have the selection between the following possibilities:
Handlers can also be used in DEBUG mode for tracking the bad operation. Just put a breakpoint in your handler. When stopped, the call stack will show you the location of the division in the source code of the program.
You can write your own exception program to be executed before the first application cycle is executed:
#OnStartup ProgramName
Warning: The program is executed before all other programs within the fisrt cycle. This implies that the cycle timing can be longer during the first cycle. You cannot put breakpoints in the Startup program.
You can write your own exception program to be executed after the last application cycle when the runtime system is cleanly stopped:
#OnShutdown ProgramName
Warning: You cannot put breakpoints in the Shutdown program.
You can write your own exception program for handling the "Division by zero" exception. Below is the procedure you must follow for setting an exception handler:
#OnDivZero SubProgramName
|
Copyright © 2015 Kollmorgen™ |
|