check_position_condition(axis, min, max, ref, mod, pos)
Features
This function checks the status of the given position. This condition can be repeated with the while or if statement. Axis and pos of input paramets are based on the ref coordinate.
In case of ref=DR_TOOL, pos should be defined in BASE coordinate.
Parameters
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
axis | int | - | axis
|
min | float | DR_COND_NONE | Minimum value |
max | float | DR_COND_NONE | Maximum value |
ref | int | None | reference coordinate
|
mod | int | DR_MV_MOD_ABS | Movement basis
|
pos | posx list (float[6]) | - | posx or position list |
Note
- The absolution position is used if the mod is DR_MV_MOD_ABS.
- The pos position is used if the mod is DR_MV_MOD_REL.
- Pos is meaningful only if the mod is DR_MV_MOD_REL.
Return
Value | Description |
---|---|
True | The condition is True. |
False | The condition is False. |
Exception
Exception | Description |
---|---|
DR_Error (DR_ERROR_TYPE) | Parameter data type error occurred |
DR_Error (DR_ERROR_VALUE) | Parameter value is invalid |
DR_Error (DR_ERROR_RUNTIME) | C extension module error occurred |
DR_Error (DR_ERROR_STOP) | Program terminated forcefully |
Example
CON1= check_position_condition(DR_AXIS_X, min=-5, max=0, ref=DR_WORLD)
CON2= check_position_condition(DR_AXIS_Y, max=700)
CON3= check_position_condition(DR_AXIS_Z, min=-10, max=-5) # -10≤z≤-5
CON4= check_position_condition(DR_AXIS_Z, min=30) # 30≤z
CON5= check_position_condition(DR_AXIS_Z,min=-10,max=-5, ref=DR_BASE) # -10≤z≤-5
CON6= check_position_condition(DR_AXIS_Z,min=-10,max=-5, mod=DR_MV_MOD_ABS) # -10≤z≤-5
posx1 = posx(400, 500, 800, 0, 180,0)
CON7= check_position_condition(DR_AXIS_Z,min=-10,max=-5,mod = DR_MV_MOD_REL, pos=posx1) # posx1_(z)-10≤z≤ posx1_(z)-5