Skip to main content

Using Block Search

A block search allows for interpolation to continue after an interruption. The stop position is traveled first and the path is traveled unchanged from this position. For this, the program that performs the interpolation and the program that performs the path preprocessing has to be extended.

Example 51. Example

An interrupted milling head stops the travel. After being repaired, the path can be continued with block search.



Extend the application by

  • Function block instance in the interpolation task that saves the preprocessing position

  • Function block instance in the path task that shortens a path element

For more information, see: SMC_BlockSearchSavePos, SMC_BlockSearchPos, and SMC_BlockSearch

Saving the preprocessing position

You can use the SMC_BlockSearchSavePos function block for saving the current position on command. At this time, the instance of the function block has to run in the task of the interpolator. The interpolator program in the example is named "CNC".

  1. Declare an instance of the SMC_BlockSearchSavePos function block in the program that the interpolation performs.

    bssp: SMC_BlockSearchSavePos;

  2. Connect the ipo input of the SMC_BlockSearchSavePos instance to the interpolator instance.

  3. Connect the bExecute input to a control variable that is set in the application when the CNC program is canceled (for example if the bAbort input of the SMC_Interpolator instance was set). The position stored at the ePos output is used as follows for the block search by means of SMC_BlockSearc. After interruption, bExecute has to be reset with a rising edge.

Example 52. Example

Part of the program that performs the interpolation with the instance of the SMC_BlockSearchSavePos function block in CFC.

_sm_img_interpolation_with_block_search.png


Using block search

An instance of the SMC_BlockSearch function block has to be called in the same task as the remaining path preprocessing, typically directly before the SMC_CheckVelocities function block. If a rising edge exists at bExecute, then a block search is performed. After starting, the saved position is traveled and the path is traveled unchanged from this position.

  1. Declare an instance of the SMC_BlockSearch function block in the program that the path preprocessing performs.

    bs: SMC_BlockSearch;

  2. Implement the triggering of the bExecute input of the SMC_BlockSearch instance.

  3. The position saved previously with the SMC_BlockSearchSavePos function block has to be passed as the epos input of the SMC_BlockSearch function block.

Example 53. Example: Block search in path preprocessing
PROGRAM CNC_PreparePath
...
VAR
        bs: SMC_BlockSearch;
END_VAR
...
bs(
                ePos:=CNC.bssp.ePos ,
                bExecute:=rncf.bExecuteDecoder ,
                bAbort:= ,
                bAppend:= ,
                poqDataIn:=ncd.poqDataOut ,
                bStartFromSavedPos:=CNC.bssp.bPositionStored ,
                nSizeOutQueue:=SIZEOF(agiBufBlockSearch) ,
                pbyBufferOutQueue:=ADR(agiBufBlockSearch) ,
                bDone=> ,
                bBusy=> ,
                bError=> ,
                wErrorID=> ,
                poqDataOut=> );

The bStartFromSavedPos input can also be activated with a control variable. The control variable can be activated after a cancellation in order to continue again at the last saved position.