Class CoreMotion

Class Documentation

class CoreMotion

This class contains core motion functions.

Public Functions

CoreMotion(WMX3Api *f)

Constructor to initialize an object of this class. The device created by the WMX3Api object passed to this constructor is used to execute API functions. Also see Devices.

CoreMotion(const CoreMotion &src)

Copy constructor to initialize an object of this class based on an existing object of this class. Also see Copy Operators.

CoreMotion &operator=(const CoreMotion &src)

Copy assignment operator to initialize an object of this class based on an existing object of this class. Also see Copy Operators.

CoreMotion()

Constructor to initialize an object of this class with a self device. Also see Self Devices.

~CoreMotion()

Destructor for this class.

bool IsDeviceValid()

Return TRUE if this class object has access to a device, and FALSE otherwise. A device is required to execute most functions in this class. If this function returns FALSE, a device can be created by calling the CreateDevice function from the WMX3Api object that was passed to the constructor of this class.

Return TRUE if this class object has access to a device, and FALSE otherwise. A device is required to execute most functions in this class. If this function returns FALSE, a device can be created by calling the CreateDevice function from the WMX3Api object that was passed to the constructor of this class.

WMX3APIFUNC GetVersion(int *pMajorVersion, int *pMinorVersion, int *pRevisionVersion, int *pFixVersion)

Get the version of the module rtdll.

Get the version of the module rtdll.

Parameters:
  • pMajorVersion[out] The major version number.

  • pMinorVersion[out] The minor version number.

  • pRevisionVersion[out] The revision version number.

  • pFixVersion[out] The fix version number.

WMX3APIFUNC GetStatus(CoreMotionStatus *status)

Read the current system status from the engine.

Read the current system status from the engine.

This function obtains the main status of the entire system and all axes. This function is typically called at regular intervals using a timer loop in order to monitor the status of the system and update the user interface.

Remark

This function has a comparatively low execution overhead, as the statuses are read directly from memory without communicating with the engine.

Parameters:

status[out] A pointer to an object of the CoreMotionStatus class that will be filled in with the current system status.

WMX3APIFUNC ClearVibrationStatus(int axis)

Clear the vibration measurement statuses of an axis.

Clear the vibration measurement statuses of an axis.

This function clears the Vibration Pos Min, Vibration Pos Max, Vibration Pos Average, Vibration Vel Min, Vibration Vel Max, Vibration Vel Average, Vibration Trq Min, Vibration Trq Max, and Vibration Trq Average statuses to 0.

Remark

The statuses are cleared during the next communication cycle.

Parameters:

axis[in] The axis to clear.

WMX3APIFUNC ClearVibrationStatus(AxisSelection *pAxisSelection)

Clear the vibration measurement statuses of multiple axes.

Clear the vibration measurement statuses of multiple axes.

This function is an overloaded function of ClearVibrationStatus that clears the vibration measurement statuses of multiple axes.

Remark

Parameters:

pAxisSelection[in] A pointer to an AxisSelection class object that specifies which axes to clear.

WMX3APIFUNC ExecEStop(EStopLevel::T level)

Initiate an emergency stop to stop the motion of all axes.

Initiate an emergency stop to stop the motion of all axes.

This function is used to stop all axes in emergency situations.

Remark

The exact effect of the emergency stop will depend on the specified emergency stop “level”. It is possible to call this function while the system is already in emergency stop state to increase the “level” of the emergency stop to a higher level. However, this function cannot be used to reduce the “level” of the emergency stop to a lower level.

After an emergency stop is triggered, the system enters an emergency stop state and axes will be unable to be commanded. The ReleaseEStop API function must be called to release the emergency stop state and allow axes to be commanded again. The current emergency stop state of the system can be read using the GetStatus function to obtain the emergencyStop and emergencyStopLevel statuses.

Parameters:

level[in] The level of the emergency stop.

WMX3APIFUNC ReleaseEStop()

Clear the emergency stop state to allow the axes to be controlled again.

Clear the emergency stop state to allow the axes to be controlled again.

This function clears the emergency stop state that is set by the ExecEStop function. See ExecEStop for additional information.

Remark

WMX3APIFUNC TriggerFlightRecorder()

Trigger the flight recorder to write the flight recorder data to file.

Trigger the flight recorder to write the flight recorder data to file.

This function will immediately trigger the flight recorder to write the flight recorder data to file, regardless of the flight recorder conditions specified in FlightRecorderParam.

Remark

WMX3APIFUNC ResetFlightRecorder()

Reset the flight recorder so that it may be triggered again.

Reset the flight recorder so that it may be triggered again.

Once the flight recorder is triggered, it can normally not be triggered again until the engine is restarted to prevent the flight recorder file from being overwritten. When this function is called after the flight recorder has been triggered, the flight recorder will be reset so that it may be triggered again. When the flight recorder is triggered again, the previous flight recorder file will be overwritten unless it has been moved to a different directory or the Flight Recorder Time Stamp parameter is set to enabled.

Remark

Public Members

AxisControl *axisControl
Motion *motion
Home *home
Velocity *velocity
Torque *torque
Sync *sync
Config *config

Public Static Functions

static WMX3APIFUNC ErrorToString(int errCode, char *pString, unsigned int size)

Get a string representation of the specified error code.

Get a string representation of the specified error code.

This function returns a string representation of the specified error code. The error code must be defined in the CoreMotionErrorCode enum or the ErrorCode enum in the WMX3Api.h header. All errors returned by functions in class CoreMotion will be defined in one of these enums. Errors returned by functions in other classes may not be defined in one of these enums, and when such errors are passed to this function, an ErrorCodeNotDefined error will be returned and pString will contain the string representation of this error.

Remark

If pString is too small to contain the entire string representation of the error code, pString will be set to an empty string. An array size of 256 characters will be enough to hold all string representations.

This function is static, and may be called without declaring an instance of the CoreMotion class or creating a device.

Parameters:
  • errCode[in] The error code to get the string representation of.

  • pString[in] A char array that will contain the string representation of the error.

  • size[in] The size of the char array in number of characters.

static WMX3APIFUNC ErrorToString(int errCode, wchar_t *pString, unsigned int size)

Get a string representation of the specified error code.

Get a string representation of the specified error code.

This function is a variation of ErrorToString that accepts a wchar_t array. Use this function when using Unicode character sets.

Remark

Parameters:
  • errCode[in] The error code to get the string representation of.

  • pString[in] A wchar_t array that will contain the string representation of the error.

  • size[in] The size of the wchar_t array in number of characters.

static WMX3APIFUNC ApiLogToString(unsigned char *pLogData, unsigned int logDataSize, char *pString, unsigned int size)

Get a string representation of the raw data of an API log.

Get a string representation of the raw data of an API log.

This function converts the raw data for one API function call that was extracted from the API log with the GetApiLogData function.

Remark

Parameters:
  • pLogData[in] A char array containing the raw data.

  • logDataSize[in] The size of the pLogData char array. This size must be equal to or greater than the size of the raw data.

  • pString[out] A char array that will contain the string representation of the raw data of the API log.

  • size[in] The size of the pString char array in number of characters.

static WMX3APIFUNC ApiLogToString(unsigned char *pLogData, unsigned int logDataSize, wchar_t *pString, unsigned int size)

Get a string representation of the raw data of an API log.

Get a string representation of the raw data of an API log.

This function is a variation of ApiLogToString that accepts a wchar_t array. Use this function when using Unicode character sets.

Remark

Parameters:
  • pLogData[in] A char array containing the raw data.

  • logDataSize[in] The size of the char array. This size must be equal to or greater than the size of the raw data.

  • pString[out] A wchar_t array that will contain the string representation of the raw data of the API log.

  • size[out] The size of the pString wchar_t array in number of characters.

static WMX3APIFUNC GetLibVersion(int *pMajorVersion, int *pMinorVersion, int *pRevisionVersion, int *pFixVersion)

Get the version of the module library.

Get the version of the module library.

This function is static, and may be called without declaring an instance of this class or creating a device.

Remark

Parameters:
  • pMajorVersion[out] The major version number.

  • pMinorVersion[out] The minor version number.

  • pRevisionVersion[out] The revision version number.

  • pFixVersion[out] The fix version number.