Camming header

This page contains the complete code of the header file in this chapter.

In Cam.h, your cam code should be as follows:

#pragma once

/*Select whether the master positions are absolute values or distance
  to the previous value.*/
#define MASTER_ABSOLUTE TRUE

/*Select whether the slave positions are absolute values or distance
  to the previous value.*/
#define SLAVE_ABSOLUTE TRUE

//Select whether the table is periodic.
/*With a non-periodic table the cam synchronization is automatically ended 
  when the master axis leaves the table range.*/
/*With a periodic table the end position is used as the start position
  for the next copy of the table.*/
#define PERIODIC TRUE

//Support linear and fifth degree polynomial interpolation between the points.
#define INTERPOLATION_TYPE camLinear

//Number of points in the table.
#define TABLE_LENGTH 5

//List of master positions.
#define MASTER_POSITIONS {0, 150, 180, 330, 360}

//List of slave positions.
#define SLAVE_POSITIONS {0, 360, 360, 0, 0}

//List of slave positions.
#define POINT_PARAMETERS {0, 0, 0, 0, 0}

VOID DefineCamTable(int Index);
KsCommandStatus AssignCamSlave(int Master, int Slave, int Table);
VOID RemoveCamSlave(int Index);