21 #include "../Util/Message.h" 22 #include "../Util/StopWatch.h" 23 #include "../ComDef/DeviceErrors.h" 24 #include "../ComDef/ModuleErrors.h" 25 #include "../ComDef/IOErrors.h" 26 #include "../Device/ProtocolCommands.h" 54 virtual int reinit(
unsigned char ucBaudRateId) = 0;
55 virtual int write8Bytes(
int iModuleId,
bool ack,
void* pBytes ) = 0;
58 virtual int readChar(
int iModuleId,
int iCommandId,
int iParameterId,
char* pcData) = 0;
59 virtual int readUnsignedChar(
int iModuleId,
int iCommandId,
int iParameterId,
unsigned char* pucData) = 0;
60 virtual int readShort(
int iModuleId,
int iCommandId,
int iParameterId,
short* piData) = 0;
61 virtual int readUnsignedShort(
int iModuleId,
int iCommandId,
int iParameterId,
unsigned short* puiData) = 0;
62 virtual int readLong(
int iModuleId,
int iCommandId,
int iParameterId,
long* piData) = 0;
63 virtual int readUnsignedLong(
int iModuleId,
int iCommandId,
int iParameterId,
unsigned long* puiData) = 0;
64 virtual int readFloat(
int iModuleId,
int iCommandId,
int iParameterId,
float* pfData) = 0;
66 virtual int readLongUnsignedChars(
int iModuleId,
int iCommandId,
int iParameterId,
long* piData,
unsigned char* pucData1,
unsigned char* pucData2) = 0;
67 virtual int readFloatUnsignedChars(
int iModuleId,
int iCommandId,
int iParameterId,
float* pfData,
unsigned char* pucData1,
unsigned char* pucData2) = 0;
69 virtual int writeChar(
int iModuleId,
int iCommandId,
int iParameterId,
char cData) = 0;
70 virtual int writeUnsignedChar(
int iModuleId,
int iCommandId,
int iParameterId,
unsigned char ucData) = 0;
71 virtual int writeShort(
int iModuleId,
int iCommandId,
int iParameterId,
short iData) = 0;
72 virtual int writeUnsignedShort(
int iModuleId,
int iCommandId,
int iParameterId,
unsigned short uiData) = 0;
73 virtual int writeLong(
int iModuleId,
int iCommandId,
int iParameterId,
long iData) = 0;
74 virtual int writeUnsignedLong(
int iModuleId,
int iCommandId,
int iParameterId,
unsigned long uiData) = 0;
75 virtual int writeFloat(
int iModuleId,
int iCommandId,
int iParameterId,
float fData) = 0;
77 virtual int writeAll(
int iCommandId,
int iParameterId) = 0;
78 virtual int writeCommand(
int iModuleId,
int iCommandId) = 0;
79 virtual int writeLongShort(
int iModuleId,
int iCommandId,
int iParameterId,
long iData,
short iTime) = 0;
80 virtual int writeFloatShort(
int iModuleId,
int iCommandId,
int iParameterId,
float fData,
short iTime) = 0;
82 virtual int writeShortReadLongUnsignedChars(
int iModuleId,
int iCommandId,
int iParameterId,
short iData,
long* piData,
unsigned char* pucData1,
unsigned char* pucData2) = 0;
83 virtual int writeLongReadLongUnsignedChars(
int iModuleId,
int iCommandId,
int iParameterId,
long iData,
long* piData,
unsigned char* pucData1,
unsigned char* pucData2) = 0;
84 virtual int writeLongShortReadLongUnsignedChars(
int iModuleId,
int iCommandId,
int iParameterId,
long iData1,
short iData2,
long* piData,
unsigned char* pucData1,
unsigned char* pucData2) = 0;
85 virtual int writeFloatReadFloatUnsignedChars(
int iModuleId,
int iCommandId,
int iParameterId,
float fData,
float* pfData,
unsigned char* pucData1,
unsigned char* pucData2) = 0;
86 virtual int writeFloatShortReadFloatUnsignedChars(
int iModuleId,
int iCommandId,
int iParameterId,
float fData,
short iData,
float* pfData,
unsigned char* pucData1,
unsigned char* pucData2) = 0;
131 int getDefConfig(
int iModuleId,
unsigned long* puiValue);
132 int getDefSetup(
int iModuleId,
unsigned long* puiValue);
142 int getDefA0(
int iModuleId,
short* piValue);
143 int getDefC0(
int iModuleId,
short* piValue);
144 int getDefDamp(
int iModuleId,
short* piValue);
154 int getConfig(
int iModuleId,
unsigned long* puiValue);
157 unsigned char* pucDio,
float* pfPos);
158 int getDioData(
int iModuleId,
unsigned long* puiValue);
159 int getA0(
int iModuleId,
short* piValue);
160 int getC0(
int iModuleId,
short* piValue);
161 int getDamp(
int iModuleId,
short* piValue);
164 int getHomeVel(
int iModuleId,
float* pfValue );
166 int getPos(
int iModuleId,
float* pfPos);
167 int getPosInc(
int iModuleId,
long* piValue);
169 int getVel(
int iModuleId,
float* pfVel);
170 int getVelInc(
int iModuleId,
long* piValue);
171 int getIPolVel(
int iModuleId,
float* pValue );
172 int getCur(
int iModuleId,
float* pfCur);
173 int getCurInc(
int iModuleId,
short* piValue);
174 int getMinPos(
int iModuleId,
float* pfValue);
176 int getMaxPos(
int iModuleId,
float* pfValue);
178 int getMaxVel(
int iModuleId,
float* pfValue);
180 int getMaxAcc(
int iModuleId,
float* pfValue);
182 int getMaxCur(
int iModuleId,
float* pfValue);
187 int getSavePos(
int iModuleId,
float* pfValue);
222 virtual int getDataDLR_FTS(std::vector<float>& rafData,
long* piState) = 0;
223 virtual int getDataSCHUNK_FTC(
int iModuleId,
int iChannelTypeId, std::vector<float>& rafData,
short* piState) = 0;
232 void setName(
const char* acNameString);
235 int setConfig(
int iModuleId,
unsigned long puiValue);
236 int setDioData(
int iModuleId,
unsigned long uiValue);
237 int setA0(
int iModuleId,
short iValue);
238 int setC0(
int iModuleId,
short iValue);
239 int setDamp(
int iModuleId,
short iValue);
248 int setMinPos(
int iModuleId,
float fValue);
250 int setMaxPos(
int iModuleId,
float fValue);
252 int setMaxVel(
int iModuleId,
float fValue);
254 int setMaxAcc(
int iModuleId,
float fValue);
256 int setMaxCur(
int iModuleId,
float fValue);
274 int setDefSetup(
int iModuleId,
unsigned long uiValue);
300 virtual int init() = 0;
301 virtual int init(
const char* acInitString) = 0;
302 virtual int exit() = 0;
313 int movePos(
int iModuleId,
float fPos);
316 unsigned long* puiState,
unsigned char* pucDio,
float* pfPos);
317 int moveRamp(
int iModuleId,
float fPos,
float fVel,
float fAcc);
318 int moveRampInc(
int iModuleId,
long iPos,
long iVel,
long iAcc);
320 unsigned long* puiState,
unsigned char* pucDio,
float* pfPos);
321 int moveVel(
int iModuleId,
float fVel);
324 unsigned long* puiState,
unsigned char* pucDio,
float* pfPos);
325 int moveCur(
int iModuleId,
float fCur);
328 unsigned long* puiState,
unsigned char* pucDio,
float* pfPos);
329 int moveStep(
int iModuleId,
float fPos,
unsigned short uiTime);
330 int moveStepInc(
int iModuleId,
long iPos,
unsigned short uiTime);
332 unsigned long* puiState,
unsigned char* pucDio,
float* pfPos);
336 int waitForHomeEnd(
int iModuleId,
unsigned long uiTimeOut = 60000);
338 int waitForRampEnd(
int iModuleId,
unsigned long uiTimeOut = 60000);
339 int waitForRampDec(
int iModuleId,
unsigned long uiTimeOut = 60000);
int getMinMotorVoltage(int iModuleId, float *pfValue)
int getMaxLogicVoltage(int iModuleId, float *pfValue)
int homeModule(int iModuleId)
int serveWatchdogAll(void)
int getDefDamp(int iModuleId, short *piValue)
int getHomeVel(int iModuleId, float *pfValue)
virtual int getDataDLR_FTS(std::vector< float > &rafData, long *piState)=0
virtual int writeFloatReadFloatUnsignedChars(int iModuleId, int iCommandId, int iParameterId, float fData, float *pfData, unsigned char *pucData1, unsigned char *pucData2)=0
int setMaxDeltaPos(int iModuleId, float fValue)
int getDioData(int iModuleId, unsigned long *puiValue)
int getMinPos(int iModuleId, float *pfValue)
int setDefBrakeTimeOut(int iModuleId, unsigned short uiValue)
CDevice(void)
default constructor
int getDefBrakeTimeOut(int iModuleId, unsigned short *puiValue)
int waitForMotionEndAll(unsigned long uiTimeOut=60000)
int getDamp(int iModuleId, short *piValue)
const char * getRevision()
gets the revision string of the class
int getDefBurnCount(int iModuleId, unsigned char *pucValue)
int setDefIncPerTurn(int iModuleId, unsigned long uiValue)
int xack8Bytes(int iModuleId, void *pBytes)
int getSavePos(int iModuleId, float *pfValue)
int getDefMaxCur(int iModuleId, float *pfValue)
int getLogicSupply(int iModuleId, float *pfValue)
int getIPolVel(int iModuleId, float *pValue)
int setRampAcc(int iModuleId, float fValue)
int setMaxMotorVoltage(int iModuleId, float fValue)
int setMinPos(int iModuleId, float fValue)
int setModuleSerialNo(int iModuleId, unsigned long uiValue)
int setDefCANBaudRate(int iModuleId, unsigned char uiValue)
virtual int writeLong(int iModuleId, int iCommandId, int iParameterId, long iData)=0
int getHMaxCurOvershootTime(int iModuleId, long *piValue)
int getTemperature(int iModuleId, float *pfValue)
int xmit8Bytes(int iModuleId, void *pBytes)
int setConfig(int iModuleId, unsigned long puiValue)
int waitForHomeEnd(int iModuleId, unsigned long uiTimeOut=60000)
bool getInitFlag()
gets the init flag
int setHMaxCurOvershootTime(int iModuleId, long iValue)
int setA0(int iModuleId, short iValue)
int haltModule(int iModuleId)
int setMinLogicVoltage(int iModuleId, float fValue)
int getMaxVelInc(int iModuleId, long *piValue)
virtual int reinit(unsigned char ucBaudRateId)=0
virtual int writeShortReadLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, short iData, long *piData, unsigned char *pucData1, unsigned char *pucData2)=0
int setDefGearRatio(int iModuleId, float fValue)
int getCur(int iModuleId, float *pfCur)
int setNominalMotorCurrent(int iModuleId, float fValue)
int waitForMotionEnd(int iModuleId, unsigned long uiTimeOut=60000)
int getRawMotorCurrent(int iModuleId, short *piValue)
virtual int readFloat(int iModuleId, int iCommandId, int iParameterId, float *pfData)=0
int getDefDioData(int iModuleId, unsigned long *puiValue)
int setDamp(int iModuleId, short iValue)
int getDeltaPos(int iModuleId, float *pfValue)
int getMaxPos(int iModuleId, float *pfValue)
int waitForRampEnd(int iModuleId, unsigned long uiTimeOut=60000)
int getDeltaPosInc(int iModuleId, long *piValue)
std::vector< int > m_aiModuleId
int getLoadDeltaTime(int iModuleId, unsigned short *piValue)
int getMotorOvershootTime(int iModuleId, long *piValue)
int getMinPosInc(int iModuleId, long *piValue)
int getLogicUndershootTime(int iModuleId, long *piValue)
int setMinMotorVoltage(int iModuleId, float fValue)
int setDefSetup(int iModuleId, unsigned long uiValue)
int getMotorSupply(int iModuleId, float *pfValue)
virtual int getDataSCHUNK_FTC(int iModuleId, int iChannelTypeId, std::vector< float > &rafData, short *piState)=0
int setMotorOvershootTime(int iModuleId, long iValue)
virtual int writeFloat(int iModuleId, int iCommandId, int iParameterId, float fData)=0
virtual int readFloatUnsignedChars(int iModuleId, int iCommandId, int iParameterId, float *pfData, unsigned char *pucData1, unsigned char *pucData2)=0
int getIncRatio(int iModuleId, float *pValue)
virtual int readLong(int iModuleId, int iCommandId, int iParameterId, long *piData)=0
int moveVelInc(int iModuleId, long iVel)
int setC0(int iModuleId, short iValue)
virtual int readChar(int iModuleId, int iCommandId, int iParameterId, char *pcData)=0
int getDefMinPos(int iModuleId, float *pfValue)
int moveVelExtended(int iModuleId, float fCur, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
int getDefHomeOffset(int iModuleId, float *pfValue)
int getMaxPWMOutput(int iModuleId, long *piValue)
int getDefSetup(int iModuleId, unsigned long *puiValue)
int setHomeVel(int iModuleId, float fValue)
int getDefIncPerTurn(int iModuleId, unsigned long *puiValue)
int setMaxDeltaPosInc(int iModuleId, long iValue)
int waitForRampEndAll(unsigned long uiTimeOut=60000)
CDevice & operator=(const CDevice &rclDevice)
int getMotorCurrent(int iModuleId, float *pfValue)
int getDefLinearRatio(int iModuleId, float *pfValue)
int getDefC0(int iModuleId, short *piValue)
int moveVel(int iModuleId, float fVel)
int getDefGearRatio(int iModuleId, float *pfValue)
int getVel(int iModuleId, float *pfVel)
void setInitString(const char *acInitString)
int setDefHomeAcc(int iModuleId, float fValue)
int getMaxVel(int iModuleId, float *pfValue)
virtual int getDataMP55_IO_fast(int iModuleId, float *pfData)=0
int getStateDioPos(int iModuleId, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
int setMaxPosInc(int iModuleId, long iValue)
int getC0(int iModuleId, short *piValue)
int getRawTemperature(int iModuleId, short *piValue)
int setLogicOvershootTime(int iModuleId, long iValue)
int saveParameters(int iModuleId)
virtual int writeAll(int iCommandId, int iParameterId)=0
int setDefAddress(int iModuleId, unsigned char uiValue)
int getMaxMotorVoltage(int iModuleId, float *pfValue)
void charStateToLongState(unsigned char uiShort, unsigned long *puiState)
std::vector< unsigned short > m_auiModuleVersion
int setBaudRateAll(unsigned char ucBaudRateId)
int setDioData(int iModuleId, unsigned long uiValue)
int getSyncTime(int iModuleId, short *piValue)
int getModuleSerialNo(int iModuleId, unsigned long *puiValue)
int getDefMaxDeltaPos(int iModuleId, float *pfValue)
int getVelInc(int iModuleId, long *piValue)
virtual int writeLongReadLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, long iData, long *piData, unsigned char *pucData1, unsigned char *pucData2)=0
int movePosExtended(int iModuleId, float fPos, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
int getHomeOffsetInc(int iModuleId, long *piValue)
int getNomCurOvershootTime(int iModuleId, long *piValue)
int getMotorUndershootTime(int iModuleId, long *piValue)
int moveCurExtended(int iModuleId, float fCur, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
int setCurrentLimit(int iModuleId, float fValue)
virtual int getDataMP55_IO(int iModuleId, float *pfData)=0
int getDefMaxVel(int iModuleId, float *pfValue)
virtual ~CDevice()
destructor
int getDefA0(int iModuleId, short *piValue)
int setSyncTime(int iModuleId, short iValue)
int setRampVelInc(int iModuleId, long iValue)
int getLoadLimit(int iModuleId, long *piValue)
int getKpPWMLimit(int iModuleId, long *piValue)
int setNomCurOvershootTime(int iModuleId, long iValue)
int getRawLogicSupply(int iModuleId, short *piValue)
int getDefCurOffset(int iModuleId, float *pfValue)
int moveCurInc(int iModuleId, long iCur)
int getMaxAccInc(int iModuleId, long *piValue)
int setLoadDeltaTime(int iModuleId, unsigned short iValue)
virtual int writeCommand(int iModuleId, int iCommandId)=0
int setMaxAccInc(int iModuleId, long iValue)
int getDefBaudRate(int iModuleId, unsigned char *pucValue)
int setMaxVelInc(int iModuleId, long iValue)
int moveRampInc(int iModuleId, long iPos, long iVel, long iAcc)
int getDefHomeVel(int iModuleId, float *pfValue)
int recalcPIDParams(int iModuleId)
int setDefLinRatio(int iModuleId, float fValue)
int getPos(int iModuleId, float *pfPos)
int getMaxPosInc(int iModuleId, long *piValue)
int setRampAccInc(int iModuleId, long iValue)
int setKpPWMLimit(int iModuleId, long iValue)
int getMaximumMotorCurrent(int iModuleId, float *pfValue)
virtual int writeUnsignedChar(int iModuleId, int iCommandId, int iParameterId, unsigned char ucData)=0
int getModuleVersion(int iModuleId, unsigned short *puiValue)
virtual int writeFloatShort(int iModuleId, int iCommandId, int iParameterId, float fData, short iTime)=0
int getMaxDeltaPosInc(int iModuleId, long *piValue)
virtual int setInitMP55_IO_fast(int iModuleId)=0
int getMaxAcc(int iModuleId, float *pfValue)
int moveStepExtended(int iModuleId, float fPos, unsigned short uiTime, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
int getPosCountInc(int iModuleId, long *piValue)
virtual int writeFloatShortReadFloatUnsignedChars(int iModuleId, int iCommandId, int iParameterId, float fData, short iData, float *pfData, unsigned char *pucData1, unsigned char *pucData2)=0
int getStateInternal(int iModuleId, unsigned long *pBytes)
int setHomeVelInc(int iModuleId, long iValue)
int waitForRampSteady(int iModuleId, unsigned long uiTimeOut=60000)
int waitForHomeEndAll(unsigned long uiTimeOut=60000)
const char * getInitString()
gets the init string of the device
int getCurrentLimit(int iModuleId, float *pfValue)
int setHomeOffset(int iModuleId, float fValue)
virtual int setNullSCHUNK_FTC(int iModuleId, short *piState)=0
int movePosInc(int iModuleId, long iPos)
int getDefCurRatio(int iModuleId, float *pfValue)
int moveCur(int iModuleId, float fCur)
int setMaxAcc(int iModuleId, float fValue)
virtual int waitForStartMotionAll()
virtual int initDLR_FTS()=0
int getLogicOvershootTime(int iModuleId, long *piValue)
int getBaudRate(void)
gets the baud rate of the device
int getPosInc(int iModuleId, long *piValue)
virtual int readLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, long *piData, unsigned char *pucData1, unsigned char *pucData2)=0
virtual int write8Bytes(int iModuleId, bool ack, void *pBytes)=0
int getDefRSBaudRate(int iModuleId, unsigned char *pucValue)
virtual int writeUnsignedShort(int iModuleId, int iCommandId, int iParameterId, unsigned short uiData)=0
int getDefCANBaudRate(int iModuleId, unsigned char *pucValue)
int waitForRampDec(int iModuleId, unsigned long uiTimeOut=60000)
virtual int readShort(int iModuleId, int iCommandId, int iParameterId, short *piData)=0
virtual int readUnsignedShort(int iModuleId, int iCommandId, int iParameterId, unsigned short *puiData)=0
virtual int writeLongShort(int iModuleId, int iCommandId, int iParameterId, long iData, short iTime)=0
CDevice * newDevice(const char *acInitString)
int setRampVel(int iModuleId, float fValue)
int setHomeOffsetInc(int iModuleId, long iValue)
int getRawMotorSupply(int iModuleId, short *piValue)
virtual int writeChar(int iModuleId, int iCommandId, int iParameterId, char cData)=0
int getMaxDeltaPos(int iModuleId, float *pfValue)
int setMotorUndershootTime(int iModuleId, long iValue)
int moveStep(int iModuleId, float fPos, unsigned short uiTime)
int getMinLogicVoltage(int iModuleId, float *pfValue)
virtual int writeShort(int iModuleId, int iCommandId, int iParameterId, short iData)=0
int getModuleIdMap(std::vector< int > &raiModuleId)
gets the module ID map of the open device
int moveRampExtended(int iModuleId, float fPos, float fVel, float fAcc, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
int getModuleType(int iModuleId, unsigned char *pucValue)
int getCurInc(int iModuleId, short *piValue)
int setMaxVel(int iModuleId, float fValue)
virtual int readUnsignedLong(int iModuleId, int iCommandId, int iParameterId, unsigned long *puiData)=0
int getMaxCur(int iModuleId, float *pfValue)
int getA0(int iModuleId, short *piValue)
int setMaxCur(int iModuleId, float fValue)
int getConfig(int iModuleId, unsigned long *puiValue)
virtual int writeLongShortReadLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, long iData1, short iData2, long *piData, unsigned char *pucData1, unsigned char *pucData2)=0
virtual int writeUnsignedLong(int iModuleId, int iCommandId, int iParameterId, unsigned long uiData)=0
int setMaxLogicVoltage(int iModuleId, float fValue)
int getModuleState(int iModuleId, unsigned long *puiState)
virtual int getCanOpenRawAbsEnc(int iModuleId, short *piValue)=0
int moveStepInc(int iModuleId, long iPos, unsigned short uiTime)
int setLogicUndershootTime(int iModuleId, long iValue)
int getMaxLoadGradient(int iModuleId, long *piValue)
int setMinPosInc(int iModuleId, long iValue)
virtual int setTaraMP55_IO(int iModuleId, float fTara)=0
int doInternal(int iModuleId, void *pBytes)
virtual int readUnsignedChar(int iModuleId, int iCommandId, int iParameterId, unsigned char *pucData)=0
int setMaxPos(int iModuleId, float fValue)
virtual int getUnsignedLong(int iModuleId, unsigned long *puiData)=0
void setName(const char *acNameString)
sets the baud rate of the device
int moveRamp(int iModuleId, float fPos, float fVel, float fAcc)
int setDefRSBaudRate(int iModuleId, unsigned char uiValue)
int getDefMaxAcc(int iModuleId, float *pfValue)
int setDefCurRatio(int iModuleId, float fValue)
int getHomeOffset(int iModuleId, float *pValue)
int setLoadLimit(int iModuleId, long iValue)
int getModuleCount(void)
gets the number of modules of the device
int getDefMaxPos(int iModuleId, float *pfValue)
int resetModule(int iModuleId)
int setMaximumMotorCurrent(int iModuleId, float fValue)
int getNominalMotorCurrent(int iModuleId, float *pfValue)
int movePos(int iModuleId, float fPos)
int getHomeVelInc(int iModuleId, long *piValue)
int setMaxLoadGradient(int iModuleId, long iValue)
int getDefConfig(int iModuleId, unsigned long *puiValue)
const char * getName()
gets the name string of the open device