2.9
Stop Programs (Break)
This section describes how to stop the program in execution.
CS+ can stop the program in execution at the arbitrary position by using the following functions.
Stops the program forcibly.
(2) | Hardware break function |
The debug tool consecutively checks the break condition while the program is in execution and stops the program when the condition is met. This function is implemented using the debug tool resources.
There are two types of Hardware Break event: "execution type" which stops the program at the arbitrary position; and "access type" which stops the program when an arbitrary variable and so on is accessed with the specified type.
Remark 1. | [IECUBE]
There are two types of Hardware Break event (execution type): "before execution break" which breaks before the instruction at the specified address is executed; and "after execution break" which breaks after the instruction at the specified address is executed. CS+ starts by using "before execution break" resource to set Hardware Break events, and as soon as that resource becomes unavailable, uses "after execution break" resource (see "2.16.7.1 Maximum number of enabled events"). For this reason, you cannot select between before and after execution. |
Remark 2. | [E1][E20][EZ Emulator][COM Port]
Hardware Break events (execution type) break the program after the instruction at the specified address is executed. |
Remark 3. | [Simulator]
For a Hardware Break event (execution type), you can select between "before execution break" which breaks before the instruction at the specified address is executed and "after execution break" which breaks after the instruction at the specified address is executed (see "2.9.1.3 [Simulator]"). |
(3) | Software break function (except for [Simulator]) |
Temporarily replaces the instruction code for a specified address with a break instruction and stops the program when this instruction is executed.
Caution 1. | If a forced break is performed while in standby mode (HALT/STOP), the current PC position will indicate the address of the next instruction after the standby mode instruction.
This behavior differs depending on the debug tool used. |
- | For other than [Simulator]
The forced break will release standby mode. |
- | [Simulator]
The forced break will not release standby mode.
It will appear that standby mode has been released. Check the CPU status on the Main window's statusbar to see if standby mode has been released. |
Caution 2. | [E1][E20][EZ Emulator][COM Port]
Do not decrease the voltage of the target system during a break. A reset that is generated by the low-voltage detector (LVI) or by power-on-clear (POC) during a break causes an incorrect operation of CS+ or communication errors.
A break during emulation of power supply off also causes communication errors. |
Remark | When the program in execution is stopped, a statement of the cause of the break appears on the Statusbar in the Main window. |