check_force_condition(axis, min, max, ref)
Features
This function checks the status of the given force. It disregards the force direction and only compares the sizes. This condition can be repeated with the while or if statement. Measuring the force and 1)moment, axis is based on the ref coordinate.
1)Before V2.8 software version, measuring the moment, axis is based on the tool coordinate.
Parameters
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
axis | int | - | axis
|
min | float | DR_COND_NONE | Minimum value (min ≥ 0) |
max | float | DR_COND_NONE | Maximum value (max ≥ 0) |
ref | int | None | reference coordinate
|
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
fcon1 = check_force_condition(DR_AXIS_Z, min=5, max=10, ref=DR_WORLD) # 5 ≤f_z≤10
while (fcon1):
fcon2 = check_force_condition(DR_AXIS_C, min=30) # 30≤m_z
pcon1 = check_position_condition(DR_AXIS_X, min=0, max=0.1) # 0≤x≤0.1
if (fcon2 and pcon1):
break