SetCamTable
Sets a cam table by setting the connections to a relevant table.
Syntax
KsCommandStatus SetCamTable(
int Index,
McCamTable Table,
double* MasterPositions,
double* SlavePositions,
double* PointParameters
);
Parameters
Index [in]: the index of a cam table. Indexes are zero based. Aliases affect this parameter.
Table [in]: defines the cam table. See the McCamTable structure.
MasterPositions [in]: the array that stores the master positions in the cam table.
SlavePositions [in]: the array that stores the slave positions in the cam table.
PointParameters [in]: the additional parameter for the table points, depends on the interpolation type.
Linear interpolation: null.
Poly5 interpolation: it has four point types. "!=" means "not equal to."
- StopPoint: Vel = 0; Acc = 0;
- VelocityPoint: Vel != 0; Acc = 0;
- AccelerationPoint: Vel = 0; Acc != 0;
- MovePoint: Vel != 0; Acc != 0;
Return value
Returns the KsCommandStatus structure.
Remarks
- For more information about how a cam table works, see Chapter 7: Camming > How axes work in cam.
- A simulated axis can be used as master axis.
- The index of the cam table is a supplier-specific data type.
- SetCamTable lets you select a cam table that contains the data to make a cam move. This includes:
- Download the starting point of a cam profile.
- Start to generate a cam profile.
- When the
Done
field of KsCommandStatus is set, the index of the cam table is valid and ready for use in SetAxisCam.
Example
BOOL DefineCamTable(INT Index) {
McCamTable Table = { 0 };
Table.MasterAbsolute = MASTER_ABSOLUTE;
Table.SlaveAbsolute = SLAVE_ABSOLUTE;
Table.Periodic = PERIODIC;
Table.InterpolationType = INTERPOLATION_TYPE;
Table.Length = TABLE_LENGTH;
double MasterPositions[TABLE_LENGTH] = MASTER_POSITIONS;
double SlavePositions[TABLE_LENGTH] = SLAVE_POSITIONS;
double PointParameters[TABLE_LENGTH] = POINT_PARAMETERS;
KsCommandStatus cam = WaitForCommand(5, FALSE, SetCamTable(Index, Table,
MasterPositions, SlavePositions, PointParameters));
return TRUE;
}
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.0 | 4.0 |
Header | ksmotion.h | ksmotion.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also