Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpiCore)  1.26.2
Motion Configuration
Collaboration diagram for Motion Configuration:

Functions

MLPIRESULT mlpiMotionGetConfiguredAxes (const MLPIHANDLE connection, MlpiAxisInformation *configAxes, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiMotionGetAxisValues (const MLPIHANDLE connection, MlpiAxisValues *axisValues, const ULONG numElements)
 
MLPIRESULT mlpiMotionGetAxisUnits (const MLPIHANDLE connection, MlpiAxisUnits *axisUnits, const ULONG numElements)
 
MLPIRESULT mlpiMotionGetAxisStatus (const MLPIHANDLE connection, MlpiAxisStatus *axisStatus, const ULONG numElements)
 
MLPIRESULT mlpiMotionCreateAxis (const MLPIHANDLE connection, const MlpiAxisType axisType, const WCHAR16 *name, const MlpiAxisRef axis, const ULONG deviceAddress)
 
MLPIRESULT mlpiMotionDestroyAxis (const MLPIHANDLE connection, const MlpiAxisRef axis)
 
MLPIRESULT mlpiMotionGetActualPosition (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionGetActualVelocity (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionGetActualAcceleration (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionGetActualTorque (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionGetInterpolatedPosition (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionGetInterpolatedVelocity (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionGetInterpolatedTorque (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionGetPositionLimitPos (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetPositionLimitPos (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetPositionLimitNeg (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetPositionLimitNeg (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetVelocityLimitPos (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetVelocityLimitPos (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetVelocityLimitNeg (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetVelocityLimitNeg (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetVelocityLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetVelocityLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetAccelerationLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetAccelerationLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetJerkLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetJerkLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetTorqueLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetTorqueLimitBip (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetTorqueLimitPos (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetTorqueLimitPos (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetTorqueLimitNeg (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetTorqueLimitNeg (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetPositionScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, USHORT *value)
 
MLPIRESULT mlpiMotionSetPositionScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, const USHORT value)
 
MLPIRESULT mlpiMotionGetVelocityScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, USHORT *value)
 
MLPIRESULT mlpiMotionSetVelocityScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, const USHORT value)
 
MLPIRESULT mlpiMotionGetAccelerationScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, USHORT *value)
 
MLPIRESULT mlpiMotionSetAccelerationScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, const USHORT value)
 
MLPIRESULT mlpiMotionGetTorqueScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, USHORT *value)
 
MLPIRESULT mlpiMotionSetTorqueScaling (const MLPIHANDLE connection, const MlpiAxisRef axis, const USHORT value)
 
MLPIRESULT mlpiMotionGetModulo (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetModulo (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetSlaveDriveFeedTravel (const MLPIHANDLE connection, const MlpiAxisRef axis, DOUBLE *value)
 
MLPIRESULT mlpiMotionSetSlaveDriveFeedTravel (const MLPIHANDLE connection, const MlpiAxisRef axis, const DOUBLE value)
 
MLPIRESULT mlpiMotionGetState (const MLPIHANDLE connection, const MlpiAxisRef axis, ULONG *value)
 
MLPIRESULT mlpiMotionGetStateExtended (const MLPIHANDLE connection, const MlpiAxisRef axis, ULONG *value)
 
MLPIRESULT mlpiMotionGetDiagnosisNumber (const MLPIHANDLE connection, const MlpiAxisRef axis, ULONG *number)
 
MLPIRESULT mlpiMotionGetDiagnosisText (const MLPIHANDLE connection, const MlpiAxisRef axis, WCHAR16 *buffer, const ULONG numElements)
 
MLPIRESULT mlpiMotionGetName (const MLPIHANDLE connection, const MlpiAxisRef axis, WCHAR16 *name, const ULONG numElements)
 
MLPIRESULT mlpiMotionSetName (const MLPIHANDLE connection, const MlpiAxisRef axis, const WCHAR16 *name)
 
MLPIRESULT mlpiMotionGetAxisType (const MLPIHANDLE connection, const MlpiAxisRef axis, USHORT *type)
 
MLPIRESULT mlpiMotionGetCondition (const MLPIHANDLE connection, const MlpiAxisRef axis, ULONG *value)
 
MLPIRESULT mlpiMotionSetCondition (const MLPIHANDLE connection, const MlpiAxisRef axis, const ULONG value)
 
MLPIRESULT mlpiMotionLoadDefaultParameters (const MLPIHANDLE connection, const MlpiAxisRef axis)
 
MLPIRESULT mlpiMotionClearError (const MLPIHANDLE connection, const MlpiAxisRef axis)
 

Detailed Description

The following functions can be used for the configuration of motion settings.

Function Documentation

MLPIRESULT mlpiMotionGetConfiguredAxes ( const MLPIHANDLE  connection,
MlpiAxisInformation configAxes,
const ULONG  numElements,
ULONG numElementsRet 
)

This function returns a list of configured axes.

Parameters
[in]connectionHandle for multiple connections.
[out]configAxesPointer to an array of structures where the configured axes are stored.
[in]numElementsNumber of structures available in the array. A number of 0 is valid and will not copy any data.
[out]numElementsRetPointer to a variable where the number of configured axes will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 MLPIRESULT result;
2 ULONG numAxes;
3 MlpiAxisInformation configuredAxes[100];
4 
5 // read current axes configured from motion system
6 memset(configuredAxes, 0, sizeof(configuredAxes));
7 result = mlpiMotionGetConfiguredAxes(connection, configuredAxes, _countof(configuredAxes), &numAxes);
8 
9 if (MLPI_FAILED(result)) {
10  printf("\ncall of MLPI function failed with 0x%08x!", result);
11  return result;
12 }
13 
14 // print information about all configured axes
15 printf("\nFound %d configured axes:", numAxes);
16 for (ULONG i=0; i<numAxes; i++) {
17  printf("\n - (%d) %s, ", configuredAxes[i].axis.axisNo, W2A16(configuredAxes[i].name));
18 
19  switch (configuredAxes[i].axisType) {
20  case MLPI_AXISTYPE_VIRTUAL: printf("(VIRTUAL)"); break;
21  case MLPI_AXISTYPE_REAL: printf("(REAL)"); break;
22  case MLPI_AXISTYPE_ENCODER: printf("(ENCODER)"); break;
23  case MLPI_AXISTYPE_LINK: printf("(LINK)"); break;
24  case MLPI_AXISTYPE_CONTROLLER: printf("(CONTROLLER)"); break;
25  }
26 }
MLPIRESULT mlpiMotionGetAxisValues ( const MLPIHANDLE  connection,
MlpiAxisValues axisValues,
const ULONG  numElements 
)

This function fills an array of MlpiAxisValues structures. Use the axis element of the structure to specify the axis for which information should be read. You may want to use this structure to read several sets of axis information for several axes using one single function call during operation of the axes. This gives increased performance in comparison to reading the values bit by bit and axis by axis.

Parameters
[in]connectionHandle for multiple connections.
[in,out]axisValuesFills a struct with the current operation information about axes. AxisRef has to be set by the caller.
[in]numElementsNumber of axes for which values should be read. This is the array length of the parameter axisValues.
Returns
Return value indicating success (>=0) or error (<0).
Note
Elements of the struct that can not be read will be set to 0.
Example:
1 // This example reads a list of all current configured axes.
2 // It uses this information to read the axis values (position, velocity, state...)
3 // as well as the corresponding units and shows a summary of the state of all
4 // axes.
5 //
6 // Please note that 3 different MLPI functions are used. This is due to performance
7 // reasons. You may want to call mlpiMotionGetConfiguredAxes and mlpiMotionGetAxisUnits
8 // only when the axis configuration is changed. In contrast, the function
9 // mlpiMotionGetAxisValues can be polled more often and contains values which are
10 // more dynamic (position, velocity, state, diagnosis...). You can also use it for
11 // a subset of axes only.
12 
13 MLPIRESULT result;
14 ULONG numAxes;
15 MlpiAxisInformation configuredAxes[100];
16 
17 // read current axes configured from motion system to know which axes are available
18 memset(configuredAxes, 0, sizeof(configuredAxes));
19 result = mlpiMotionGetConfiguredAxes(connection, configuredAxes, _countof(configuredAxes), &numAxes);
20 
21 if (MLPI_FAILED(result)) {
22  printf("\ncall of MLPI function failed with 0x%08x!", result);
23  return result;
24 }
25 printf("\nFound %d configured axes:", numAxes);
26 
27 // build list of axis to read the values for
28 MlpiAxisValues axisValues[100];
29 MlpiAxisUnits axisUnits[100];
30 for (ULONG i=0; i<numAxes; i++) {
31  axisValues[i].axis = configuredAxes[i].axis;
32  axisUnits[i].axis = configuredAxes[i].axis;
33 }
34 
35 // read all axis values for the given axes list
36 result = mlpiMotionGetAxisValues(connection, axisValues, numAxes);
37 
38 if (MLPI_FAILED(result)) {
39  printf("\ncall of MLPI function failed with 0x%08x!", result);
40  return result;
41 }
42 
43 result = mlpiMotionGetAxisUnits(connection, axisUnits, numAxes);
44 
45 if (MLPI_FAILED(result)) {
46  printf("\ncall of MLPI function failed with 0x%08x!", result);
47  return result;
48 }
49 
50 // let's print some information of all axes
51 for (ULONG i=0; i<numAxes; i++) {
52  printf("\n--- (%d) %s ---", axisValues[i].axis.axisNo, W2A16(configuredAxes[i].name));
53  printf("\n Position: %lf %s", axisValues[i].actualPosition, W2A16(axisUnits[i].position));
54  printf("\n Velocity: %lf %s", axisValues[i].actualVelocity, W2A16(axisUnits[i].velocity));
55  printf("\n Acceleration: %lf %s", axisValues[i].actualAcceleration, W2A16(axisUnits[i].acceleration));
56  printf("\n Torque: %lf %s", axisValues[i].actualTorque, W2A16(axisUnits[i].torque));
57  printf("\n Diagnosis: 0x%08X", axisValues[i].diagnosisNumber);
58 }
MLPIRESULT mlpiMotionGetAxisUnits ( const MLPIHANDLE  connection,
MlpiAxisUnits axisUnits,
const ULONG  numElements 
)

This function returns the current unit settings of an array of axes in string representation. Use it to read the unit settings for display in an HMI. If you want detailed information about the unit and scaling settings of the axis, please look at the functions mlpiMotionGetPositionScaling, mlpiMotionGetVelocityScaling, etc...

Parameters
[in]connectionHandle for multiple connections.
[in,out]axisUnitsFills a struct with the current unit settings of the axis. AxisRef in the struct has to be set by the caller.
[in]numElementsNumber of axes for which values should be read. This is the array length of the parameter axisUnits.
Returns
Return value indicating success (>=0) or error (<0).
Example:
See mlpiMotionGetAxisValues
MLPIRESULT mlpiMotionGetAxisStatus ( const MLPIHANDLE  connection,
MlpiAxisStatus axisStatus,
const ULONG  numElements 
)

This function fills an array of MlpiAxisStatus structures. Use the axis element of the structure to specify the axis for which information should be read. You may want to use this function to read several sets of axis status information for several axes using one single function call during operation of the axes. This gives increased performance in comparison to reading the values with the function mlpiMotionGetAxisValues, since the actual values of axes are not needed (e.g. actual position A-0-0101).

Parameters
[in]connectionHandle for multiple connections.
[in,out]axisStatusFills a struct with the current operation information about axes. AxisRef has to be set by the caller.
[in]numElementsNumber of axes for which status values should be read. This is the array length of the parameter axisStatus.
Returns
Return value indicating success (>=0) or error (<0).
Note
Elements of the struct that can not be read will be set to 0.
Example:
1 // This example reads a list of all current configured axes.
2 // It uses this information to read the axis status values (state, stateExtended, diagnosis...)
3 // of all axes.
4 //
5 // Please note that 2 different MLPI functions are used. This is due to performance
6 // reasons. You may want to call mlpiMotionGetConfiguredAxes
7 // only when the axis configuration is changed. In contrast, the function
8 // mlpiMotionGetAxisStatus can be polled more often and contains status values which are
9 // more dynamic (state, diagnosis...). You can also use it for
10 // a subset of axes only.
11 
12 MLPIRESULT result;
13 ULONG numAxes;
14 MlpiAxisInformation configuredAxes[100];
15 
16 // read current axes configured from motion system to know which axes are available
17 memset(configuredAxes, 0, sizeof(configuredAxes));
18 result = mlpiMotionGetConfiguredAxes(connection, configuredAxes, _countof(configuredAxes), &numAxes);
19 
20 if (MLPI_FAILED(result)) {
21  printf("\ncall of MLPI function failed with 0x%08x!", result);
22  return result;
23 }
24 printf("\nFound %d configured axes:", numAxes);
25 
26 // build list of axis to read the status values for
27 MlpiAxisStatus axisStatus[100];
28 for (ULONG i=0; i<numAxes; i++) {
29  axisStatus[i].axis = configuredAxes[i].axis;
30 }
31 
32 // read all axis status values for the given axes list
33 result = mlpiMotionGetAxisStatus(connection, axisStatus, numAxes);
34 
35 if (MLPI_FAILED(result)) {
36  printf("\ncall of MLPI function failed with 0x%08x!", result);
37  return result;
38 }
39 
40 // let's print some information of all axes
41 for (ULONG i=0; i<numAxes; i++) {
42  printf("\n--- (%d) %s ---", axisStatus[i].axis.axisNo, W2A16(configuredAxes[i].name));
43  printf("\n Diagnosis: 0x%08X", axisStatus[i].diagnosisNumber);
44 }
MLPIRESULT mlpiMotionCreateAxis ( const MLPIHANDLE  connection,
const MlpiAxisType  axisType,
const WCHAR16 name,
const MlpiAxisRef  axis,
const ULONG  deviceAddress 
)

This function creates an axis. If an axis already exists, it will be overwritten.

Parameters
[in]connectionHandle for multiple connections.
[in]axisTypeDefines the axis type.
[in]nameName of the axis. It will not be used other than for display purposes.
[in]axisLogical address of the axis.
[in]deviceAddressSercos address of the axis. In case of a virtual axis, this parameter is not used.
Returns
Return value indicating success (>=0) or error (<0).
MLPIRESULT mlpiMotionDestroyAxis ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis 
)

This function destroys an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis to be destroyed.
Returns
Return value indicating success (>=0) or error (<0).
MLPIRESULT mlpiMotionGetActualPosition ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the actual position of a axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the position
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetActualPosition(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nCurrent position of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetActualVelocity ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the actual velocity of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the velocity
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetActualVelocity(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nCurrent velocity of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetActualAcceleration ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the actual acceleration of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the acceleration
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetActualAcceleration(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nCurrent acceleration of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetActualTorque ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the actual torque of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the torque
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetActualTorque(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nCurrent torque of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetInterpolatedPosition ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the actual interpolated position of an axis. The interpolated position is the position as calculated by the interpolator of the axis. For axes with interpolation in the control, this is the value that gets sent to the drive as a commanded value when running an operation mode with position control. If there is no operation mode with position interpolation active, or if the interpolation is not done in the control, then this function might return an error.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the interpolated position
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetInterpolatedPosition(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nCurrent interpolated position of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetInterpolatedVelocity ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the actual interpolated velocity of an axis. The interpolated velocity is the velocity as calculated by the interpolator of the axis. For axes with interpolation in the control, this is the value that gets sent to the drive as a commanded value when running an operation mode with velocity control. If there is no operation mode with velocity interpolation active, or if the interpolation is not done in the control, then this function might return an error.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the interpolated velocity
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetInterpolatedVelocity(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nCurrent interpolated velocity of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetInterpolatedTorque ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the interpolated torque of an axis. If there is no operation mode with torque interpolation active, or if the interpolation is not done in the control, then this function might return an error.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the interpolated torque
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetInterpolatedTorque(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nCurrent interpolated torque of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetPositionLimitPos ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the positive position limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the positive position limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetPositionLimitPos(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nPositive position limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetPositionLimitPos ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the positive position limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the positive position limit
2 DOUBLE value = 36000.0;
3 MLPIRESULT result = mlpiMotionSetPositionLimitPos(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nPositive position limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetPositionLimitNeg ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the negative position limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the negative position limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetPositionLimitNeg(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nNegative position limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetPositionLimitNeg ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the negative position limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the negative position limit
2 DOUBLE value = -36000.0;
3 MLPIRESULT result = mlpiMotionSetPositionLimitNeg(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nNegative position limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetVelocityLimitPos ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the positive velocity limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the positive velocity limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetVelocityLimitPos(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nPositive velocity limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetVelocityLimitPos ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the positive velocity limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the positive velocity limit
2 DOUBLE value = 1000.0;
3 MLPIRESULT result = mlpiMotionSetVelocityLimitPos(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nPositive velocity limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetVelocityLimitNeg ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the negative velocity limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the negative velocity limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetVelocityLimitNeg(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nNegative velocity limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetVelocityLimitNeg ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the negative velocity limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the negative velocity limit
2 DOUBLE value = -1000.0;
3 MLPIRESULT result = mlpiMotionSetVelocityLimitNeg(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nNegative velocity limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetVelocityLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the bipolar velocity limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the bipolar velocity limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetVelocityLimitBip(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar velocity limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetVelocityLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the bipolar velocity limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the bipolar velocity limit
2 DOUBLE value = 1000.0;
3 MLPIRESULT result = mlpiMotionSetVelocityLimitBip(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar velocity limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetAccelerationLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the bipolar acceleration limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the bipolar acceleration limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetAccelerationLimitBip(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar acceleration limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetAccelerationLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the bipolar acceleration limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the bipolar acceleration limit
2 DOUBLE value = 1000.0;
3 MLPIRESULT result = mlpiMotionSetAccelerationLimitBip(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar acceleration limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetJerkLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the bipolar jerk limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the bipolar jerk limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetJerkLimitBip(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar jerk limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetJerkLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the bipolar jerk limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the bipolar jerk limit
2 DOUBLE value = 10.0;
3 MLPIRESULT result = mlpiMotionSetJerkLimitBip(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar jerk limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetTorqueLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the bipolar torque force limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the bipolar torque force limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetTorqueLimitBip(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar torque force limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetTorqueLimitBip ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the bipolar torque force limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the bipolar torque force limit
2 DOUBLE value = 100.0;
3 MLPIRESULT result = mlpiMotionSetTorqueLimitBip(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nBipolar torque force limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetTorqueLimitPos ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the positive torque force limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the positive torque force limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetTorqueLimitPos(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nPositive torque force limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetTorqueLimitPos ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the positve torque force limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the positive torque force limit
2 DOUBLE value = 100.0;
3 MLPIRESULT result = mlpiMotionSetTorqueLimitPos(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nPositive torque force limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetTorqueLimitNeg ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the negative torque force limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the negative torque force limit
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetTorqueLimitNeg(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nNegative torque force limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetTorqueLimitNeg ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the negative torque force limit of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the negative torque force limit
2 DOUBLE value = -100.0;
3 MLPIRESULT result = mlpiMotionSetTorqueLimitNeg(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nNegative torque force limit of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetPositionScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
USHORT value 
)

This function reads the position scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
MLPIRESULT mlpiMotionSetPositionScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const USHORT  value 
)

This function writes to the position scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // set position scaling of axis 1 to rotatory modulo
2 MLPIRESULT result = mlpiMotionSetPositionScaling(connection, 1, MlpiAxisScalingPosition(MLPI_SCALING_TYPE_ROTATORY, MLPI_SCALING_FORMAT_MODULO));
3 if (MLPI_FAILED(result)) {
4  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
5  return -1;
6 }
MLPIRESULT mlpiMotionGetVelocityScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
USHORT value 
)

This function reads the velocity scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
MLPIRESULT mlpiMotionSetVelocityScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const USHORT  value 
)

This function writes to the velocity scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // set velocity scaling of axis 1 to rotatory and seconds (deg/s)
2 MLPIRESULT result = mlpiMotionSetVelocityScaling(connection, 1, MlpiAxisScalingVelocity(MLPI_SCALING_TYPE_ROTATORY, MLPI_SCALING_TIME_SECOND));
3 if (MLPI_FAILED(result)) {
4  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
5  return -1;
6 }
MLPIRESULT mlpiMotionGetAccelerationScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
USHORT value 
)

This function reads the acceleration scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
MLPIRESULT mlpiMotionSetAccelerationScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const USHORT  value 
)

This function writes to the velocity scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // set acceleration scaling of axis 1 to rotatory and seconds (deg/s)
2 MLPIRESULT result = mlpiMotionSetAccelerationScaling(connection, 1, MlpiAxisScalingAcceleration(MLPI_SCALING_TYPE_ROTATORY));
3 if (MLPI_FAILED(result)) {
4  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
5  return -1;
6 }
MLPIRESULT mlpiMotionGetTorqueScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
USHORT value 
)

This function reads the acceleration scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
MLPIRESULT mlpiMotionSetTorqueScaling ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const USHORT  value 
)

This function writes to the torque scaling of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // set torque scaling of axis 1 to rotatory and newton meter
2 MLPIRESULT result = mlpiMotionSetTorqueScaling(connection, 1, MlpiAxisScalingTorque(MLPI_SCALING_TYPE_ROTATORY));
3 if (MLPI_FAILED(result)) {
4  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
5  return -1;
6 }
MLPIRESULT mlpiMotionGetModulo ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the modulo value of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the modulo value
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetModulo(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nModulo value of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetModulo ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes to the modulo value for an axis of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the modulo value
2 DOUBLE value = 360.0;
3 MLPIRESULT result = mlpiMotionSetModulo(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nModulo value of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetSlaveDriveFeedTravel ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
DOUBLE value 
)

This function reads the feed distance of a following axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the feed distance
2 DOUBLE value = 0.0;
3 MLPIRESULT result = mlpiMotionGetSlaveDriveFeedTravel(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nFeed distance of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionSetSlaveDriveFeedTravel ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const DOUBLE  value 
)

This function writes the feed distance of a following axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueData value to be written to the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to write the feed distance
2 DOUBLE value = 10.0;
3 MLPIRESULT result = mlpiMotionSetSlaveDriveFeedTravel(connection, 1, value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nFeed distance of axisNo 1: %lf", value);
MLPIRESULT mlpiMotionGetState ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
ULONG value 
)

This function reads the state of an axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 MlpiAxisRef axis(1);
2 
3 // read the state
4 ULONG axisState = 0;
5 result = mlpiMotionGetState(connection, axis, &axisState);
6 if (MLPI_FAILED(result)) {
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8  return -1;
9 }
10 
11 // we use the helper struct from #include <util/mlpiMotionHelper.h> to decode the axisState
12 // this makes it easier to read the code:
13 // if(state.Error()) {
14 // mlpiMotionClearError(axis);
15 // }
16 // ... and so on...
17 MlpiAxisStateDecoder state = axisState;
18 
19 printf("\nAxis is in velocity..................................%s", state.InVelocity() ? "true" : "false");
20 printf("\nAxis is standstill...................................%s", state.Standstill() ? "true" : "false");
21 printf("\nAxis is in position..................................%s", state.InPosition() ? "true" : "false");
22 printf("\nAxis is synchronous to another axis..................%s", state.InSynchron() ? "true" : "false");
23 printf("\nAxis has warning.....................................%s", state.Warning() ? "true" : "false");
24 printf("\nAxis has an error....................................%s", state.Error() ? "true" : "false");
25 printf("\nAxis is homed........................................%s", state.Homed() ? "true" : "false");
26 printf("\nAxis is in torque....................................%s", state.InTorque() ? "true" : "false");
27 printf("\nAxis is in P4........................................%s", state.OperationMode() ? "true" : "false");
28 printf("\nAxis is ready for operation..........................%s", state.InAb() ? "true" : "false");
29 printf("\nAxis is ready for power..............................%s", state.Inbb() ? "true" : "false");
30 printf("\nAxis has power.......................................%s", state.Power() ? "true" : "false");
31 printf("\nAxis has an active sercos command....................%s", state.CmdActive() ? "true" : "false");
32 printf("\nError reaction of axis is in progress................%s", state.ErrInProgress() ? "true" : "false");
33 printf("\nAxis has reached the master phase offset.............%s", state.InMasterPhaseOffset() ? "true" : "false");
34 printf("\nNRT channel for axis is connected....................%s", state.NRTActive() ? "true" : "false");
35 printf("\nAxis did not follow control..........................%s", state.Interrupted() ? "true" : "false");
36 printf("\nAxis is in modulo format.............................%s", state.Modulo() ? "true" : "false");
37 printf("\nAxis is rotatory.....................................%s", state.Rotatory() ? "true" : "false");
38 printf("\nActual data of axis is valid.........................%s", state.Valid() ? "true" : "false");
39 printf("\nAxis is decoupled from commanded position of control.%s", state.Decoupled() ? "true" : "false");

Referenced by utilMotionWaitAxisInterrupted().

Here is the caller graph for this function:

MLPIRESULT mlpiMotionGetStateExtended ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
ULONG value 
)

This function reads the extended state of the axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 MlpiAxisRef axis(1);
2 
3 // read the state
4 ULONG axisStateExtended = 0;
5 result = mlpiMotionGetStateExtended(connection, axis, &axisStateExtended);
6 if (MLPI_FAILED(result)) {
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8  return -1;
9 }
10 
11 // we use the helper struct from #include <util/mlpiMotionHelper.h> to decode the axisState
12 // this makes it easier to read the code:
13 // if(state.Standstill()) {
14 // // do something...
15 // }
16 // ... and so on...
17 MlpiAxisStateExtendedDecoder state = axisStateExtended;
18 
19 printf("\nAxis is in state ErrorStop...........%s", state.ErrorStop() ? "true" : "false");
20 printf("\nAxis is in state Stopping............%s", state.Stopping() ? "true" : "false");
21 printf("\nAxis is in state Homing..............%s", state.Homing() ? "true" : "false");
22 printf("\nAxis has power.......................%s", state.PowerOn() ? "true" : "false");
23 printf("\nAxis is in state DiscreteMotion......%s", state.DiscreteMotion() ? "true" : "false");
24 printf("\nAxis is in state ContinuousMotion....%s", state.ContinuousMotion() ? "true" : "false");
25 printf("\nAxis is in state SynchronizedMotion..%s", state.SynchronizedMotion() ? "true" : "false");
26 printf("\nAxis is in state Standstill..........%s", state.Standstill() ? "true" : "false");
27 printf("\nAxis is in state CoordinatedMotion...%s", state.CoordinatedMotion() ? "true" : "false");
MLPIRESULT mlpiMotionGetDiagnosisNumber ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
ULONG number 
)

This function reads the diagnostic number of the axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]numberPointer to a variable which is receiving the error number.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the diagnostic number
2 ULONG value = 0;
3 MLPIRESULT result = mlpiMotionGetDiagnosisNumber(connection, 1, &value);
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nDiagnostic number of axisNo 1: 0x%08X", value);
MLPIRESULT mlpiMotionGetDiagnosisText ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
WCHAR16 buffer,
const ULONG  numElements 
)

This function reads the diagnostic message of the axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]bufferPointer to where text should be stored.
[in]numElementsNumber of available WCHAR16 characters in buffer.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the diagnostic message
2 WCHAR16 buffer[128] = L"";
3 MLPIRESULT result = mlpiMotionGetDiagnosisText(connection, 1, buffer, _countof(buffer));
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nDiagnostic message of axisNo 1: %s", W2A16(buffer));
MLPIRESULT mlpiMotionGetName ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
WCHAR16 name,
const ULONG  numElements 
)

This function reads the name of the axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]namePointer to where text should be stored.
[in]numElementsNumber of available WCHAR16 characters in buffer.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the axis name
2 WCHAR name[128] = L"";
3 MLPIRESULT result = mlpiMotionGetName(connection, 1, buffer, _countof(name));
4 
5 // evaluate for success or error
6 if (MLPI_FAILED(result))
7  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 else
9  printf("\nName of axisNo 1: %s", W2A16(name));
MLPIRESULT mlpiMotionSetName ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const WCHAR16 name 
)

This function writes the name of the axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]nameName of the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to change the axis name
2 MLPIRESULT result = mlpiMotionSetName(connection, 1, L"myAxisName");
3 
4 // evaluate for success or error
5 if (MLPI_FAILED(result))
6  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
MLPIRESULT mlpiMotionGetAxisType ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
USHORT type 
)

This function reads the type of the axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]typePointer to where value should be stored. The value contains a bit sequence that can be interpreted with MlpiAxisTypeDecoder. Refer to mlpiMotionHelper.h
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the type of axis
2 USHORT type;
3 MLPIRESULT result = mlpiMotionGetAxisType(connection, 1, &type);
4 if (MLPI_FAILED(result)){
5  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
6  return -1;
7 }
8 
9 // decode the type using AxisTypeDecoder see #include <util/mlpiMotionHelper.h>
10 MlpiAxisTypeDecoder axisType(type);
11 switch(axisType.Type())
12 {
13 case MLPI_AXISTYPE_VIRTUAL: printf("\nType of axisNo 1 is VIRTUAL");
14  printf(" - Virtual axis, no physical drive attached."); break;
15 case MLPI_AXISTYPE_REAL: printf("\nType of axisNo 1 is REAL");
16  printf(" - Real axis, this is the common axis when doing motion."); break;
17 case MLPI_AXISTYPE_ENCODER: printf("\nType of axisNo 1 is ENCODER");
18  printf(" - An encoder that is attached to a real drive, no motion possible."); break;
19 case MLPI_AXISTYPE_LINK: printf("\nType of axisNo 1 is LINK");
20  printf(" - A link ring axis."); break;
21 case MLPI_AXISTYPE_CONTROLLER: printf("\nType of axisNo 1 is CONTROLLER ");
22  printf(" - An axis that can be used when generating your own controller to operate the drive."); break;
23 default: printf("\nType of axisNo 1 is invalid."); break;
24 }
25 
26 printf("\nAxis is in interpolation in control......................%s", axisType.InterpolationInControl() ? "true" : "false");
27 printf("\nAttached drive is configured in sercos PackProfile mode..%s", axisType.IsPackProfile() ? "true" : "false");
28 printf("\nAttached drive is a hydraulic drive......................%s", axisType.IsHydraulicDrive() ? "true" : "false");
29 printf("\nAxis supports Parametrization mode.......................%s", axisType.SupportsParametrization() ? "true" : "false");
MLPIRESULT mlpiMotionGetCondition ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
ULONG value 
)

This function reads the axis condition.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[out]valuePointer to where value should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to read the condition of an axis
2 ULONG condition;
3 MLPIRESULT result = mlpiMotionGetCondition(connection, 1, &condition);
4 if (MLPI_FAILED(result)){
5  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
6  return -1;
7 }
8 
9 // decode the type using MlpiAxisConditionDecoder see #include <util/mlpiMotionHelper.h>
10 MlpiAxisConditionDecoder axisCondition(condition);
11 printf("\nAxis condition: %d", axisCondition.Condition());
12 printf("\nAxis is active................%s", axisCondition.IsActive() ? "true" : "false");
13 printf("\nAxis is deactivated...........%s", axisCondition.IsDeactivated() ? "true" : "false");
14 printf("\nAxis is in parking............%s", axisCondition.IsParking() ? "true" : "false");
15 printf("\nAxis is in parametrization....%s", axisCondition.IsParametrization() ? "true" : "false");
16 printf("\nAxis is decoupled.............%s", axisCondition.IsDecoupled() ? "true" : "false");
MLPIRESULT mlpiMotionSetCondition ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis,
const ULONG  value 
)

This function writes to the axis condition.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
[in]valueCondition that should be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // use the mlpi function to set the condition of axis to active
2 MLPIRESULT result = mlpiMotionSetCondition(connection, 1, MLPI_AXIS_CONDITION_ACTIVE);
3 if (MLPI_FAILED(result)){
4  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
5  return -1;
6 }
MLPIRESULT mlpiMotionLoadDefaultParameters ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis 
)

Load default parameters for the axis.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
Returns
Return value indicating success (>=0) or error (<0).
Note
During the execution of the command all parameter values of the axis will be set to their initial values. Considering that IndraWorks use some parameters for global identification etc., you have to save and restore some parameter values therewith you are able to reconnect with Indraworks without another project download.
Axis parameter (A) Save and restore parameter...
A-0-1000 A-0-0002, Axis name
A-0-0016, Project identification number
A-0-0008, Link axis, master axis selection
A-0-0630, Controller axis, controller name
Example:
1 // use the mlpi function to load default parameter
2 MLPIRESULT result = mlpiMotionLoadDefaultParameters(connection, 1);
3 
4 // evaluate for success or error
5 if (MLPI_FAILED(result))
6  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
MLPIRESULT mlpiMotionClearError ( const MLPIHANDLE  connection,
const MlpiAxisRef  axis 
)

Clears a pending error for the axis. An axis needs to be free of errors before commanding power and start of movement.

Parameters
[in]connectionHandle for multiple connections.
[in]axisLogical address of the axis.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // clear all pending errors
2 MLPIRESULT result = mlpiMotionClearError(connection, 1);
3 
4 // evaluate for success or error
5 if (MLPI_FAILED(result))
6  printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);