Editing SimpleMotion parameter valid value range
Your changes will be displayed to readers once an authorized user accepts them. (help) |
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 9: | Line 9: | ||
//read the actual value, minimum valid value and maximum valid value of SMP_TRAJ_PLANNER_VEL parameter | //read the actual value, minimum valid value and maximum valid value of SMP_TRAJ_PLANNER_VEL parameter | ||
smint32 value, min, max; | smint32 value, min, max; | ||
− | smRead3Parameters( busHandle, deviceAddress, | + | smRead3Parameters( busHandle, deviceAddress, SMP_TRAJ_PLANNER_VEL ,&value, SMP_TRAJ_PLANNER_VEL|SMP_MIN_VALUE_MASK,&min, SMP_TRAJ_PLANNER_VEL|SMP_MAX_VALUE_MASK, &max); |
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight>The technique here is to read parameter value where address of parameter has been masked with SMP_MIN_VALUE_MASK or SMP_MAX_VALUE_MASK. Masked parameter addresses will return the minimum or maximum value that the parameter accepts. | </syntaxhighlight>The technique here is to read parameter value where address of parameter has been masked with SMP_MIN_VALUE_MASK or SMP_MAX_VALUE_MASK. Masked parameter addresses will return the minimum or maximum value that the parameter accepts. | ||
==Complex value range== | ==Complex value range== | ||
Some parameters, such as SMP_SERIAL_ENC_BITS accepts a special binary format as value thus the valid range can't be defined with min-max method. In these cases, refer to simplemotion_defs.h for valid input values. | Some parameters, such as SMP_SERIAL_ENC_BITS accepts a special binary format as value thus the valid range can't be defined with min-max method. In these cases, refer to simplemotion_defs.h for valid input values. | ||
− | |||
− |