User`s manual
http://www.adtechcn.com 83
/********************* get current information on motion ************************
This function is used to get the current information on logic position, actual position
and running speed
Parameters: axis-axis number; LogPos-logic position; ActPos-actual position;
Speed-running speed
Return value=0: correct; return value=1: error
************************************************************************/
int CCtrlCard::Get_CurrentInf(int axis, long &LogPos, long &ActPos, long &Speed )
{
Result = adt8840a_get_command_pos(devnum,axis, &LogPos);
adt8840a_get_actual_pos (devnum, axis, &ActPos);
adt8840a_get_speed (devnum, axis, &Speed);
return Result;
}
/*********************** read input point *******************************
This function is used to read the single input point
Parameters: number-input point (0 ~39)
Return value: 0: low level; 1: high level; -1: error
********************************************************************/
int CCtrlCard::Read_Input(int number,int &value)
{
Result = adt8840a_read_bit(devnum, number, &value);
return Result;
}
/*************** function for outputting single-point signal ***************
This function is used to output single point single
Parameters: number-output point (0~15); value: 0: low level; 1: high level
Return value=0: correct; return value=1: error
****************************************************************/
int CCtrlCard::Write_Output(int number, int value)
{
Result = adt8840a_write_bit(devnum,0, number, value);
return Result;
}
/*******************set position counter****************************
This function is used to set the logic position and actual position
Parameters: axis-axis number; pos-value of the position;
Mode: 0-set logic position; non-0-set actual position
Return value=0: correct; return value=1: error