Example – ADLINK PCI-8258 User Manual
Page 205
Motion Control Theory
191
PCI-8254 / PCI-8258
• Example:
#include
"APS168.h"
#include
"APS_define.h"
#include
"ErrorCodeDef.h"
void
pt_move_example ()
//This example shows how pt move operation
I32 ret;
I32 Board_ID = 0;
I32 PtbId = 0; //Point table 0
I32 Dimension = 2; //2D Dimension
I32 AxisArr[2] = { 0, 1 }; //Set Axis 0 & Axis 1 to point table 0
PTLINE Prof;
PTSTS Status;
//Enable point table id 0 for 2D dimension with aixs 0 and axis 1.
APS_pt_enable (Board_ID , PtbId, Dimension, & AxisArr); //Enable point table id 0
//Get status of point table id 0 to monitor buffer
APS_get_pt_status (Board_ID , PtbId, &Status);
if ( !(Status.BitSts & 0x02 ) ) //Point buffer is not full
//Push move into point buffer
Prof.Dim = 2;
Prof.Pos[0] = 10000;
Prof.Pos[1] = 10000;
ret = APS_pt_line (Board_ID, PtbId, &Prof, &Status);
//Start point table move
APS_pt_start (Board_ID, PtbId, 0);