Linear movements
INCT_LinearMotionFormer - a CAM system interface that simplifies forming linear movements. The interface is returned by the function INCT_CLData.CreateLinearMotionFormer.
Purpose:
Linear movements are formed from a block of the NC program as follows. The NC program text is translated, that is, split into registers with values. The registers with values are added to the list of objects for interpretation. The objects of the list are interpreted. When the objects are interpreted, a multi-axis movement command (INCT_CLData.OpenMultiMotion, AddMotion, CloseMultiMotion) is added to the tool path (INCT_CLData) according to the changed values of the registers linked to the machine axes of the kinematic scheme.
In more detail, the process consists of the following actions.
Before the NC program is interpreted:
- Get the list of registers linked to the machine axes in the kinematic scheme.
- Store the list of registers with the axis indexes.
Before a block is interpreted:
- Get the current tool position coordinates for all axes linked to the machine axes in the kinematic scheme.
When registers are interpreted:
- Get the new values of the block registers linked to the machine axes in the kinematic scheme.
- Set the new values for all changed block registers linked to the machine axes in the kinematic scheme.
After the block is interpreted, or during the interpretation but after all registers are interpreted:
- Compare the new axis coordinates with the old ones to find changes.
- If there was a change:
- Call OpenMultiMotion.
- Check each axis value for a change and, if the tool position along the axis has changed, call AddMotion.
- Call CloseMultiMotion.
To execute commands that require movements in the physical machine coordinates, the movement type must also be switched to gtmPhysic.
The actions from the list above that are in italics are implemented in the linear movement generator (INCT_LinearMotionFormer). Using the generator makes writing an interpreter easier.
We recommend creating one linear movement generator for the whole cycle of interpreting the NC program. Create it when the interpreter is initialized (INCT_Interpreter.Initialize).
Description of the interface methods:
| Method | Method description | Description of use |
|---|---|---|
| SetGotoMode | The method sets the type of the formed movements. Input parameter: Mode (TNCGotoMode) - movement type, see the description of OpenMultiMotion. If the movement type is not set by the method, it is gtmTooltip. No output parameters. | The method can be used when interpreting G53 in ISO code (set the movement type to gtmPhysic, then return it to gtmTooltip). |
| Get_ClearGotoMode | The function returns the value of the ClearGotoMode parameter (boolean). No input parameters. | The ClearGotoMode parameter controls the automatic reset of the movement type (see SetGotoMode) to gtmTooltip. The movement type is reset in InitBlock. As a rule, the G53 command acts only in the current block, so it makes sense to set ClearGotoMode to True. Then, after a block with G53 is interpreted (where the movement type is set to gtmPhysic), the movement type returns to gtmTooltip by itself at the next InitBlock call. |
| Set_ClearGotoMode | The method sets the value of the ClearGotoMode parameter. Input parameter: Value (boolean) - value of the ClearGotoMode parameter. No output parameters. | |
| InitAxisIndex | The method adds an axis index to the list. Input parameters: Index (integer) - index of the axis added to the list. No output parameters. | Used to add the axes linked to the machine axes in the kinematic scheme. As a rule, it is called right after getting the interface (function INCT_CLData.CreateLinearMotionFormer) in the implementation of the interpreter method INCT_Interpreter.Initialize. The indexes of the registers linked to the machine axes can be obtained with the interfaces INCT_SysState, INCT_Equipment. |
| ClearAxesIndexes | The method clears the list of axis indexes. | Used when the tool is changed if the names of the axes controlling the tool coincide. |
| InitBlock | The method stores in the internal list the current tool coordinates for all axes from the list formed with InitAxisIndex. If the ClearGotoMode parameter is True, the movement type set in SetGotoMode is set to gtmTooltip. No input or output parameters. | Must be used before interpreting the objects linked to registers. It is recommended to use it in the implementation of the INCT_Interpreter.BeforeInterprete method. |
| SetAxisValue | The method stores in the internal list the new tool coordinate for the specified axis. Input parameters: Abs (boolean) - type of the new coordinate value, True - absolute value, False - relative value (relative to the current coordinate, see InitBlock); Index (integer) - axis index; Value (real number) - new value. No output parameters. | Used to store the new value in the internal list to form a multi-axis movement command later. Used when interpreting in INCT_Interpreter.Interprete. |
| MakeWorkpath | The method compares the list of current coordinates (stored in InitBlock) with the new tool coordinates (stored in SetAxisValue). If the coordinates have changed, a multi-axis movement command along the changed axis coordinates is formed in the tool path (INCT_CLData.OpenMultiMotion, AddMotion, CloseMultiMotion). | To form a multi-axis movement command. Used when interpreting in INCT_Interpreter.Interprete after all registers are interpreted (add it to the end of the list of objects for interpretation), or in INCT_Interpreter.AfterInterprete. |
INCT_GeomLinearMotionFormer - a CAM system interface that simplifies forming linear movements. The interface is returned by the function INCT_GeomCLData.CreateLinearMotionFormer.
Its purpose is the same as that of the INCT_LinearMotionFormer interface, but for movements in geometric axes. The movements are formed by the CutTo3d command. Therefore, to form the first movement, the coordinates of all three axes must be set.
Description of the interface methods:
| Method | Method description | Description of use |
|---|---|---|
| ClearSpecifiedAxes | The method clears the list of axes set for the first movement. No input or output parameters. |
Must be used at the beginning of each operation. It is recommended to use it in the implementation of the INCT_Interpreter.NextOperation method. |
| InitBlock | The method stores in the internal list the current values of the 3 tool coordinates. No input or output parameters. |
Must be used before interpreting the objects linked to registers. It is recommended to use it in the implementation of the INCT_Interpreter.BeforeInterprete method. |
| SetAxisValue | The method stores in the internal list the new tool coordinate for the specified axis. Input parameters: Abs (boolean) - type of the new coordinate value, True - absolute value, False - relative value (relative to the current coordinate, see InitBlock); Index (integer) - axis index (1-3); Value (real number) - new value. No output parameters. |
Used to store the new value in the internal list to form a movement command later. Used when interpreting in INCT_Interpreter.Interprete. |
| MakeWorkpath | The method compares the list of current coordinates (stored in InitBlock) with the new tool coordinates (stored in SetAxisValue). If the coordinates have changed and the coordinates of all 3 axes are set, a movement command (INCT_GeomCLData.CutTo3d) is formed in the tool path. | To form a movement command. Used when interpreting in INCT_Interpreter.Interprete after all registers are interpreted (add it to the end of the list of objects for interpretation), or in INCT_Interpreter.AfterInterprete. |