INOS
|
Move one axis towards a certain direction to search for a sensor. The axis stops when either the sensor is found or a predefined stop position has been reached. More...
#include <cinosmcrobot.h>
Public Member Functions | |
CINOSMcRobotCmdMoveToDigitalSensor (CINOSTaskExMsg *apMsg, tMcAxisName apAxis, const char *apName, real64 arPosition, bool abSet, const char *apParam, void *apCallBack=NULL, void *apCallBackObject=NULL) | |
Default constructor. | |
CINOSMcRobotCmdMoveToDigitalSensor (CINOSTaskExMsg *apMsg, tMcAxisName apAxis, const char *apName, real64 arPosition, bool abSet, real64 &arResult, const char *apParam, void *apCallBack=NULL, void *apCallBackObject=NULL) | |
Use this overloaded version if you're interested in the position at which the sensor has been found, see arResult . | |
CINOSMcRobotCmdMoveToDigitalSensor (CINOSTaskExMsg *apMsg, tMcAxisName apAxis, const char *apName, real64 arPosition, bool abSet, real64 &arResult, uint32 auFlags, const char *apParam, void *apCallBack=NULL, void *apCallBackObject=NULL) | |
Use this overloaded version if you're interested in the position at which the sensor has been found, see arResult and if you additionally want to specify custom axis MoveEx flags. | |
CINOSMcRobotCmdMoveToDigitalSensor (CINOSTaskExMsg *apMsg, tMcAxisName apAxis, real64 arPositionVel, real64 arVelocity, const char *apName, real64 arPosition, bool abSet, real64 &arResult, uint32 auFlags, const char *apParam, void *apCallBack=NULL, void *apCallBackObject=NULL) | |
virtual | ~CINOSMcRobotCmdMoveToDigitalSensor () |
destructor | |
virtual void | AddEvent (const char *apName, real64 arValue, eEventType aeEventType, bool abFireEvent=true, uint32 auFlags=0) |
add event to command | |
virtual bool | GetEventTicks (const char *apName, uint64 &auBusTicks, uint8 &auBusId) |
get event ticks | |
virtual uint32 | Check () |
check command | |
virtual uint32 | Trigger () |
prepare command | |
virtual uint32 | Run () |
run command | |
virtual uint32 | Stop (uint32 auReply) |
stop command | |
virtual uint32 | EmgStop () |
emergency stop command | |
virtual void | Done (uintid auPartId) |
done command | |
virtual void | SetSlowMotion (real64 arSlowMotion) |
set slowmotion | |
virtual void | GetCmdPosition (real64 &arPosition) |
get cmd position | |
virtual void | GetActPosition (real64 &arPosition) |
get act position | |
virtual void | GetActVelocity (real64 &arVelocity) |
get act velocity | |
![]() | |
CINOSMcRobotCmd (CINOSTaskExMsg *apMsg, void *apCallBack=NULL, void *apCallBackObject=NULL) | |
constructor | |
virtual | ~CINOSMcRobotCmd () |
destructor | |
virtual uint32 | Break () |
break command | |
virtual uint32 | Continue () |
continue command | |
eCmdState | GetState () const |
get command state | |
const char * | GetName () |
get command name | |
CINOSMcRobot * | GetModule () |
get pointer to module this command belongs to | |
uint32 | GetReply () const |
get command reply | |
uint32 | SetReply (uint32 auReply) |
set command reply | |
uint32 | GetResult () const |
get command result | |
uint32 | SetResult (uint32 auResult) |
set command result | |
CINOSTaskExMsg * | GetMsg () |
get command message | |
CINOSTask * | GetSender () |
get command sender | |
void | SetId (tMsgId auId) |
set command id | |
tMsgId | GetId () |
get command id | |
void | SetCallBack (void *apCallBack) |
set callback | |
Public Attributes | |
real64 | m_rPositionVel {} |
real64 | m_rVelocity {} |
Additional Inherited Members | |
![]() | |
enum | eCmdState { eStaIdle , eStaReady , eStaRunning , eStaDone , eStaError } |
command states More... | |
enum | eMoveType { eTypAbsolute , eTypRelative } |
move types | |
enum | eEventType { eEvtBgnUnit =0 , eEvtEndUnit =1 , eEvtBgnMs =2 , eEvtEndMs =3 , eEvtBgnCmd =4 , eEvtEndCmd =5 , eEvtBrkUnit =6 , eEvtBrkMs =7 , eEvtBgnMsFix =8 , eEvtEndMsFix =9 } |
event types | |
![]() | |
enum | eFlags { eFlgBegin = 0x00000001 , eFlgEnd = 0x00000002 , eFlgMoveTime = 0x00000004 , eFlgSlowMotion = 0x00000008 , eFlgFireEvent = 0x00000010 , eFlgLength = 0x00000020 , eFlgDepart = 0x00000040 , eFlgMultipleEvent = 0x00000080 , eFlgEmgStop = 0x40000000 , eFlgDone = 0x80000000 } |
validity | |
![]() | |
void * | GetCallBack () |
get callback | |
void * | GetCallBackObject () |
int32 | GetBusTicks (uint8 auBusId, real64 arMs) |
get bus ticks | |
void | InstallHandler () |
install cyclic handler | |
void | RemoveHandler () |
remove cyclic handler | |
virtual void | Handle () |
command handler | |
DECLARE_DYNAMIC (CINOSMcRobotCmd) | |
dynamic object handling | |
![]() | |
eCmdState | m_eState |
command state | |
uint32 | m_uReply |
command reply | |
uint32 | m_uReplySave |
saved command reply | |
uint32 | m_uResult |
command result | |
tMsgId | m_uId |
command id overwrite | |
bool | m_bEndEvent |
command has 'eEvtEndCmd' event | |
bool | m_bCyclicHandling |
command needs cyclic handling | |
char | m_cEndEvent [32] |
end event name | |
void * | m_pCallBack |
pointer to callback method if any | |
void * | m_pCallBackObject |
pointer to callback object if any | |
CINOSTaskExMsg * | m_pMsg |
pointer to according message | |
CINOSMcRobot * | m_pModule |
pointer to my module | |
CINOSMcRobotCmd * | m_pNext |
pointer to next command in list | |
Move one axis towards a certain direction to search for a sensor. The axis stops when either the sensor is found or a predefined stop position has been reached.
Internally, this function uses CINOSPhysicalAxis::MoveEx. If that MoveEx completes, this class's iCmdDone() is called. This function then checks for an axis error. By default (i.e. when not using the overloaded CTOR which allows to specify custom 'MoveEx flags'), the axis has 'no error' if the sensor has been found. Otherwise, if the sensor was not found, the axis is on error ("Axis failed"). If the axis is "OK", then the iCmdDone function adds the following named results to the CINOSTaskExMsg:
Otherwise, if the axis is on failure, the sensor has not been found and the function doesn't add any results.
CINOSMcRobotCmdMoveToDigitalSensor::CINOSMcRobotCmdMoveToDigitalSensor | ( | CINOSTaskExMsg * | apMsg, |
tMcAxisName | apAxis, | ||
const char * | apName, | ||
real64 | arPosition, | ||
bool | abSet, | ||
const char * | apParam, | ||
void * | apCallBack = NULL , |
||
void * | apCallBackObject = NULL |
||
) |
Default constructor.
apAxis | The McRobot axis name |
apName | Name of the sensor to search |
arPosition | The position to where the axis will stop if no sensor will be found. |
abSet | If true, the axis will move until the sensor changes to "Set state" (value 1). If false, the negative edge will be searched for. |
apParam | Speedset with which the axis shall be moved |
apCallBack | Optional call back function, which gets called when the move completed. |
apCallBackObject | Optional call back object, used for calling apCallBack. If it's NULL, the CINOSMcModule instance pointer will be used |
CINOSMcRobotCmdMoveToDigitalSensor::CINOSMcRobotCmdMoveToDigitalSensor | ( | CINOSTaskExMsg * | apMsg, |
tMcAxisName | apAxis, | ||
const char * | apName, | ||
real64 | arPosition, | ||
bool | abSet, | ||
real64 & | arResult, | ||
const char * | apParam, | ||
void * | apCallBack = NULL , |
||
void * | apCallBackObject = NULL |
||
) |
Use this overloaded version if you're interested in the position at which the sensor has been found, see arResult
.
apAxis | The McRobot axis name |
apName | Name of the sensor to search |
arPosition | The position to where the axis will stop if no sensor will be found. |
abSet | If true, the axis will move until the sensor changes to "Set state" (value 1). If false, the negative edge will be searched for. |
arResult | Output parameter which will contain the position of the sensor, if the move successfully completed. That variable's memory must keep begin valid throughout the whole move. Internally, the pointer to it will be passed to the axis. I.e. do NOT pass stack variables here! |
apParam | Speedset with which the axis shall be moved |
apCallBack | Optional call back function, which gets called when the move completed. |
apCallBackObject | Optional call back object, used for calling apCallBack. If it's NULL, the CINOSMcModule instance pointer will be used |
CINOSMcRobotCmdMoveToDigitalSensor::CINOSMcRobotCmdMoveToDigitalSensor | ( | CINOSTaskExMsg * | apMsg, |
tMcAxisName | apAxis, | ||
const char * | apName, | ||
real64 | arPosition, | ||
bool | abSet, | ||
real64 & | arResult, | ||
uint32 | auFlags, | ||
const char * | apParam, | ||
void * | apCallBack = NULL , |
||
void * | apCallBackObject = NULL |
||
) |
Use this overloaded version if you're interested in the position at which the sensor has been found, see arResult
and if you additionally want to specify custom axis MoveEx flags.
apAxis | The McRobot axis name |
apName | Name of the sensor to search |
arPosition | The position to where the axis will stop if no sensor will be found. |
abSet | If true, the axis will move until the sensor changes to "Set state" (value 1). If false, the negative edge will be searched for. |
arResult | Output parameter which will contain the position of the sensor, if the move successfully completed. That variable's memory must keep begin valid throughout the whole move. Internally, the pointer to it will be passed to the axis. I.e. do NOT pass stack variables here! |
auFlags | Flags passed to CINOSPhysicalAxis::MoveEx. See the #define's starting with "DF_MOVEEX_" in cinosphysicalaxis.h. E.g. The other CTORs cause MoveEx to be called with flags that cause the axis to go into the "failed" error state if the sensor is not found. That makes the axis useless until the error get accepted. If that's not the desired behavior, this CTOR is useful, by specifying the DF_MOVEEX_NO_ERROR flag (most probably or'ed with DF_MOVEEX_STOP_AT_EVENT, DF_MOVEEX_TRG_EQ and DF_MOVEEX_SET_TRG_POS, which are the default MoveEx flags for "move to digital sensor", see also the implementation of CINOSPhysicalAxis::MoveToDigitalSensor |
apParam | Speedset with which the axis shall be moved |
apCallBack | Optional call back function, which gets called when the move completed. |
apCallBackObject | Optional call back object, used for calling apCallBack. If it's NULL, the CINOSMcModule instance pointer will be used |
CINOSMcRobotCmdMoveToDigitalSensor::CINOSMcRobotCmdMoveToDigitalSensor | ( | CINOSTaskExMsg * | apMsg, |
tMcAxisName | apAxis, | ||
real64 | arPositionVel, | ||
real64 | arVelocity, | ||
const char * | apName, | ||
real64 | arPosition, | ||
bool | abSet, | ||
real64 & | arResult, | ||
uint32 | auFlags, | ||
const char * | apParam, | ||
void * | apCallBack = NULL , |
||
void * | apCallBackObject = NULL |
||
) |
This overload perfoms a "Move Approach" to find the sensor. It is useful to find the sensor "sooner", since this function moves with a higher speed "close to the sensor" and only then starts "searching the sensor" with the reduced speed. Parameters unique to this overload are
arPositionVel | The reduced velocity with which the actual 'sensor search' will be done |
arPosition | The position at which the velocity is guaranteed to be reduced. This position is usually "close to the expected sensor position". |
apParam | Speedset with which the axis shall be moved. Note that the velocity specified in here is used to move "close to the sensor". |
|
virtual |
add event to command
Reimplemented from CINOSMcRobotCmd.
|
virtual |
check command
Implements CINOSMcRobotCmd.
done command
Implements CINOSMcRobotCmd.
|
virtual |
emergency stop command
Implements CINOSMcRobotCmd.
get act position
Implements CINOSMcRobotCmd.
get act velocity
Implements CINOSMcRobotCmd.
get cmd position
Implements CINOSMcRobotCmd.
|
virtual |
get event ticks
Reimplemented from CINOSMcRobotCmd.
|
virtual |
run command
Implements CINOSMcRobotCmd.
set slowmotion
Implements CINOSMcRobotCmd.
|
virtual |
stop command
Implements CINOSMcRobotCmd.
|
virtual |
prepare command
Implements CINOSMcRobotCmd.