Skip to main content
Skip table of contents

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 NameData TypeDefault ValueDescription

axis

int

-

axis

  • DR_AXIS_X: x-axis
  • DR_AXIS_Y: y-axis
  • DR_AXIS_Z: z-axis

min

float

DR_COND_NONE

Minimum value

max

float

DR_COND_NONE

Maximum value

ref

int

None

reference coordinate

  • DR_BASE : base coordinate
  • DR_WORLD : world coordinate
  • DR_TOOL : tool coordinate
  • user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis

  • DR_MV_MOD_ABS: Absolute
  • DR_MV_MOD_REL: Relative

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

ValueDescription

True

The condition is True.

False

The condition is False.

Exception

ExceptionDescription

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

PY
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

Related commands

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.