Single Block Operation
To test a new NC program, the NCI can be switched to single block mode with the function block ItpSingleBlock. When single block mode is active, the NC program is stopped after each line. The user has to acknowledge execution of the next line. This can be done by pressing 'NC start (F5)' in the XAE under the Editor tab or by setting the input 'bTriggerNext' in the PLC function block ItpSingleBlock.
A distinction is made between two modes:
- Interpreter single block mode
- NC kernel single block mode
The selection of the single block mode is not reset by an ItpResetEx2. This means that if, for example, the NC kernel single block mode is active, it still remains active after a reset.
Interpreter single block mode
If interpreter single block mode is active, the NC program is stopped after each line in the interpreter. This remains true even if the line only contains calculations, and no physical movement is programmed.
This enables re-writing of R-parameters, for example.
Interpreter single block mode should be activated before the NC program is started. If this is not possible, an M-function can be reserved for the activation and combined with a decoder stop.
If interpreter single block mode is activated during processing of the NC program without M-function and decoder stop, it is impossible to predict when it will be active. Theoretically it is possible that the memories in the NC kernel (SVB & SAF) are filled and contain more than 100 geometry entries. The single block can only take effect once these memories have been fully processed.
NC kernel single block mode
Like in interpreter single block mode, in NC kernel single block mode the NC blocks are executed individually. The difference is that in NC kernel single block mode all entries (e.g., geometry entries) have already passed through the interpreter. It is therefore not possible to overwrite R-parameters retrospectively, for example.
This operating mode has the advantage that single block mode can be enabled during processing of the NC program. If a geometry entry is executed (i.e. the axes are moved) during the activation, the system stops at the next possible end of segment. This is usually the current segment. For activation after program startup no M-function with decoder stop is required. However, an M-function with program end identifier (M02, M30) is required at the end of the program.
If NC kernel single block mode is used in conjunction with blending, block relaying takes place in the blending sphere. The programmed blending continues to be executed (from TwinCAT V2.10 Build 1301).
Alternatives to activation
We recommend activating single block mode with ItpSingleBlock.
For reasons of compatibility with previous TwinCAT versions, single block mode can be activated via the cyclic channel interface.
Single block mode can be selected or deselected in the cyclic channel interface of the PLC. To this end the variable 'nItpMode' has to be masked correctly in the PLC/NC channel interface.
Set bit 14 (0x4000) to switch on interpreter single block mode. Resetting the bit turns single block mode off again.
It is also possible to trigger the single block from the PLC by means of this interface. Bit 15 must be set for this. The effect is the same as activating NC start in the XAE.