SimulateAxisCam

Simulates the cam interpolation results. Can be used before a cam is applied to an axis to make sure the slave is in the right position.

Syntax

KsError SimulateAxisCam(
     int Index,
     double MasterPosition,
     double MasterOffset,
     double SlaveOffset,
     double MasterScaling,
     double SlaveScaling,
     int* RepetitionCount,
     int* RowIndex,
     double* SlaveTargetPosition,
     double* MinimumSlavePosition,
     double* MaximumSlavePosition
);

Parameters

Index [in]: the index of a cam table. Indexes are zero based. Aliases affect this parameter.

MasterPosition [in]: the master position in the cam table.

MasterOffset [in]: the offset to the positions of the master axis in the cam table.

SlaveOffset [in]: the offset to the positions of the slave axis in the cam table.

MasterScaling [in]: the factor for the master profile (default = 1.0). From the slave point of view the overall master profile is multiplied by this factor.

SlaveScaling [in]: the factor for the slave profile (default = 1.0). The overall slave profile is multiplied by this factor.

RepetitionCount [out]: for periodic cam tables only. The repetition count is the number of time the table was repeated to reach the current master target. The plus and minus signs indicate direction. Zero means we are in the defined table range, positive values mean the master position has exceeded the last value in the table, and negative values mean the master position has not yet reached the first table value.

RowIndex [out]: the index of the row currently used in the cam table. The row is selected based on the master position. When the master position exceeds the value given for current row but has not yet reached the value given for the next row, the RowIndex will be the current row. For example, RowIndex is 2 if the current master position is in between MasterPositions[2] and MasterPositions[3].

The row looks like this:

Row MasterPos SlavePos
0 0 0
1 10 50
2 20 30
3 30 50
4 40 0

SlaveTargetPosition [out]: the target position of the slave axis calculated by the cam table. Ramps are not taken into account for this value.

MinimumSlavePosition [out]: the minimum position the slave axis will reach while following the table.

MaximumSlavePosition [out]: the maximum position the slave axis will reach while following the table.

Return value

If the function succeeds, it returns errNoError, otherwise an error code. For more information about the error code, see the KsError list.

Example

N/A

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header ksmotion.h ksmotion.h
Library KsApi_Rtss.lib KsApi.lib

See also

GetAxisCamInfo

GetCamTable

PowerAxis

SetAxisCam

SetCamTable

StopAxis