75 bool bRecieved =
false;
111 bool bRecieved =
false;
152 debug(1,
"readChar: wrong command ID");
163 debug(1,
"readChar: wrong parameter ID");
185 bool bRecieved =
false;
226 debug(1,
"readUnsignedChar: wrong command ID");
237 debug(1,
"readUnsignedChar: wrong parameter ID");
259 bool bRecieved =
false;
301 debug(1,
"readShort: wrong command ID");
312 debug(1,
"readShort: wrong parameter ID");
326 *piData = clData.
aiData[0];
336 bool bRecieved =
false;
378 debug(1,
"readUnsignedShort: wrong command ID");
389 debug(1,
"readUnsignedShort: wrong parameter ID");
413 bool bRecieved =
false;
455 debug(1,
"readLong: wrong command ID");
466 debug(1,
"readLong: wrong parameter ID");
482 *piData = clData.
iData;
492 bool bRecieved =
false;
534 debug(1,
"readUnsignedLong: wrong command ID");
546 debug(1,
"readUnsignedLong: wrong parameter ID");
572 bool bRecieved =
false;
614 debug(1,
"readFloat: wrong command ID");
625 debug(1,
"readFloat: wrong parameter ID");
640 *pfData = clData.
fData;
650 bool bRecieved =
false;
692 debug(1,
"readLongUnsignedChars: wrong command ID");
703 debug(1,
"readLongUnsignedChars: wrong parameter ID");
719 *piData = clData.
iData;
731 bool bRecieved =
false;
773 debug(1,
"readFloatUnsignedChars: wrong command ID");
784 debug(1,
"readFloatUnsignedChars: wrong parameter ID");
800 *pfData = clData.
fData;
812 bool bRecieved =
false;
854 debug(1,
"writeChar: wrong command ID");
865 debug(1,
"writeChar: wrong parameter ID");
885 bool bRecieved =
false;
927 debug(1,
"writeUnsignedChar: wrong command ID");
938 debug(1,
"writeUnsignedChar: wrong parameter ID");
958 bool bRecieved =
false;
1003 debug(1,
"writeShort: wrong command ID");
1014 debug(1,
"writeShort: wrong parameter ID");
1034 bool bRecieved =
false;
1079 debug(1,
"writeUnsignedShort: wrong command ID");
1090 debug(1,
"writeUnsignedShort: wrong parameter ID");
1110 bool bRecieved =
false;
1114 clData.
iData = iData;
1157 debug(1,
"writeLong: wrong command ID");
1168 debug(1,
"writeLong: wrong parameter ID");
1188 bool bRecieved =
false;
1235 debug(1,
"writeUnsignedLong: wrong command ID");
1246 debug(1,
"writeUnsignedLong: wrong parameter ID");
1266 bool bRecieved =
false;
1270 clData.
fData = fData;
1313 debug(1,
"writeFloat: wrong command ID");
1324 debug(1,
"writeFloat: wrong parameter ID");
1369 bool bRecieved =
false;
1409 debug(1,
"writeCommand: wrong command ID");
1429 bool bRecieved =
false;
1436 clData.
iData = iData;
1441 clData.
aiData[0] = iTime;
1479 debug(1,
"writeLongShort: wrong command ID");
1490 debug(1,
"writeLongShort: wrong parameter ID");
1510 bool bRecieved =
false;
1517 clData.
fData = fData;
1522 clData.
aiData[0] = iData;
1560 debug(1,
"writeFloatShort: wrong command ID");
1571 debug(1,
"writeFloatShort: wrong parameter ID");
1591 bool bRecieved =
false;
1595 clData.
aiData[0] = iData;
1636 debug(1,
"writeShortReadUnsignedLongChars: wrong command ID");
1647 debug(1,
"writeShortReadUnsignedLongChars: wrong parameter ID");
1663 *piData = clData.
iData;
1675 bool bRecieved =
false;
1679 clData.
iData = iData;
1722 debug(1,
"writeLongReadUnsignedLongChars: wrong command ID");
1733 debug(1,
"writeLongReadUnsignedLongChars: wrong parameter ID");
1749 *piData = clData.
iData;
1761 bool bRecieved =
false;
1768 clData.
iData = iData1;
1773 clData.
aiData[0] = iData2;
1811 debug(1,
"writeLongShortReadUnsignedLongChars: wrong command ID");
1822 debug(1,
"writeLongShortReadUnsignedLongChars: wrong parameter ID");
1838 *piData = clData.
iData;
1850 bool bRecieved =
false;
1854 clData.
fData = fData;
1897 debug(1,
"writeFloatReadUnsignedLongChars: wrong command ID");
1908 debug(1,
"writeFloatReadUnsignedLongChars: wrong parameter ID");
1924 *pfData = clData.
fData;
1936 bool bRecieved =
false;
1943 clData.
fData = fData;
1948 clData.
aiData[0] = iData;
1986 debug(1,
"writeFloatShortReadUnsignedLongChars: wrong command ID");
1997 debug(1,
"writeFloatShortReadUnsignedLongChars: wrong parameter ID");
2013 *pfData = clData.
fData;
2033 error(-1,
"Sorry constructor is not implemented");
2048 error(-1,
"Sorry operator= is not implemented");
2062 bool bRecieved =
false;
2067 warning(
"device not initialized");
2124 rafData[0] = clData.
fData;
2166 rafData[1] = clData.
fData;
2171 rafData[2] = clData.
fData;
2213 rafData[3] = clData.
fData;
2218 rafData[4] = clData.
fData;
2260 rafData[5] = clData.
fData;
2265 *piState = clData.
iData;
2275 bool bRecieved =
false;
2280 warning(
"device not initialized");
2286 warning(
"bad SCHUNK module ID %i", iModuleId);
2294 if(iChannelTypeId == 0)
2296 else if(iChannelTypeId == 1)
2328 if(iChannelTypeId == 0)
2340 else if(iChannelTypeId == 1)
2370 if(iChannelTypeId == 0)
2372 rafData[0] = clData.
aiData[0] / 32.;
2373 rafData[1] = clData.
aiData[1] / 32.;
2375 else if(iChannelTypeId == 1)
2377 rafData[0] = clData.
aiData[0] / 4096000.;
2378 rafData[1] = clData.
aiData[1] / 4096000.;
2382 rafData[0] = clData.
aiData[0];
2383 rafData[1] = clData.
aiData[1];
2388 if(iChannelTypeId == 0)
2390 rafData[2] = clData.
aiData[0] / 32.;
2392 else if(iChannelTypeId == 1)
2394 rafData[2] = clData.
aiData[0] / 4096000.;
2398 rafData[2] = clData.
aiData[0];
2433 if(iChannelTypeId == 0)
2435 rafData[3] = clData.
aiData[1] / 1024.;
2437 else if(iChannelTypeId == 1)
2439 rafData[3] = clData.
aiData[1] / 65536.;
2443 rafData[3] = clData.
aiData[1];
2449 if(iChannelTypeId == 0)
2451 rafData[4] = clData.
aiData[0] / 1024.;
2452 rafData[5] = clData.
aiData[1] / 1024.;
2454 else if(iChannelTypeId == 1)
2456 rafData[4] = clData.
aiData[0] / 65536.;
2457 rafData[5] = clData.
aiData[1] / 65536.;
2461 rafData[4] = clData.
aiData[0];
2462 rafData[5] = clData.
aiData[1];
2467 *piState = clData.
aiData[0];
2478 bool bRecieved =
false;
2483 warning(
"device not initialized");
2487 if(iModuleId < 0 || iModuleId >
MAX_MP55 )
2489 warning(
"bad MP55 module ID %i", iModuleId);
2527 debug(1,
"getDataMP55_IO: received CAN-ID %x, expected %x", clRead.
m_uiMessageId, 0x580 + iModuleId);
2538 *pfData = clData.
fData;
2549 bool bRecieved =
false;
2554 warning(
"device not initialized");
2558 if(iModuleId < 0 || iModuleId >
MAX_MP55 )
2560 warning(
"bad MP55 module ID %i", iModuleId);
2605 *pfData = clData.
fData;
2616 bool bRecieved =
false;
2621 warning(
"device not initialized");
2625 if(iModuleId < 0 || iModuleId >
MAX_MP55 )
2627 warning(
"bad CanOpen module ID %i", iModuleId);
2666 printf(
"getCanOpenRawAbsEnc: received CAN-ID %lu, expected %x \n", clRead.
m_uiMessageId, 0x580 + iModuleId);
2677 *piValue = clData.
aiData[0];
2694 bool bRecieved =
false;
2699 warning(
"device not initialized");
2705 warning(
"bad SCHUNK module ID %i", iModuleId);
2759 *piState = clData.
aiData[0];
2769 bool bRecieved =
false;
2775 warning(
"device not initialized");
2779 if(iModuleId < 0 || iModuleId >
MAX_MP55 )
2781 warning(
"bad MP55 module ID %i", iModuleId);
2787 clData.
iData = fTara * 1000.0;
2821 debug(1,
"setTaraMP55_FS: received CAN-ID %x, expected %x", clRead.
m_uiMessageId, 0x580 + iModuleId);
2836 bool bRecieved =
false;
2842 warning(
"device not initialized");
2846 if(iModuleId < 0 || iModuleId >
MAX_MP55 )
2848 warning(
"bad MP55 module ID %i", iModuleId);
2905 while(!bRecieved && end < 10);
2953 while(!bRecieved && end < 10);
2993 bool bRecieved =
false;
2998 warning(
"device not initialized");
3005 warning(
"wrong setMessageId");
3012 warning(
"wrong setMessageId");
3152 sprintf(readWrite,
"read");
3154 sprintf(readWrite,
"write");
3158 debug(2,
"%s CAN message Id 0x%02x, Command Id 0x%02x, ParameterId 0x%02x, Data: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",readWrite,
3171 debug(2,
"%s CAN message Id 0x%02x, Command Id 0x%02x, ParameterId 0x%02x, Data: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",readWrite,
3183 debug(2,
"%s CAN message Id 0x%02x, Command Id 0x%02x, ParameterId 0x%02x, Data: 0x%02x 0x%02x 0x%02x 0x%02x",readWrite,
3194 debug(2,
"%s CAN message Id 0x%02x, Command Id 0x%02x, ParameterId 0x%02x, Data: 0x%02x 0x%02x 0x%02x",readWrite,
3204 debug(2,
"%s CAN message Id 0x%02x, Command Id 0x%02x, ParameterId 0x%02x, Data: 0x%02x 0x%02x",readWrite,
3213 debug(2,
"%s CAN message Id 0x%02x, Command Id 0x%02x, ParameterId 0x%02x, Data: 0x%02x",readWrite,
3221 debug(2,
"%s CAN message Id 0x%02x, Command Id 0x%02x, ParameterId 0x%02x",readWrite,
virtual int readDevice(CProtocolMessage &rclProtocolMessage)=0
int readFloatUnsignedChars(int iModuleId, int iCommandId, int iParameterId, float *pfData, unsigned char *pucData1, unsigned char *pucData2)
int getDataSCHUNK_FTC(int iModuleId, int iChannelTypeId, std::vector< float > &rafData, short *piState)
#define MSGID_SCHUNK_RECV
unsigned char m_aucMessageData[8]
#define CMDID_SCHUNK_SET_NULL
#define CMDID_DLR_DATA_ACK1
#define CMDID_DLR_DATA_ACK3
int writeLong(int iModuleId, int iCommandId, int iParameterId, long iData)
int setInitMP55_IO_fast(int iModuleId)
#define ERRID_DEV_WRONGSCHUNKMODULEID
CRITICAL_SECTION m_csDevice
int getUnsignedLong(int iModuleId, unsigned long *puiData)
int readUnsignedShort(int iModuleId, int iCommandId, int iParameterId, unsigned short *puiData)
void error(const int iErrorCode, const char *pcErrorMessage,...) const
int writeLongShortReadLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, long iData1, short iData2, long *piData, unsigned char *pucData1, unsigned char *pucData2)
int getDataMP55_IO_fast(int iModuleId, float *pfData)
int readLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, long *piData, unsigned char *pucData1, unsigned char *pucData2)
#define CMDID_SCHUNK_GET_TEI
int writeAll(int iCommandId, int iParameterId)
int setNullSCHUNK_FTC(int iModuleId, short *piState)
CProtocolDevice()
default constructor
#define ERRID_DEV_NOTINITIALIZED
#define MSGID_DLR_DATA_GET
int writeFloatReadFloatUnsignedChars(int iModuleId, int iCommandId, int iParameterId, float fData, float *pfData, unsigned char *pucData1, unsigned char *pucData2)
unsigned char m_ucMessageLength
int writeChar(int iModuleId, int iCommandId, int iParameterId, char cData)
int printMessage(CProtocolMessage &rclProtocolMessage, bool read)
int readFloat(int iModuleId, int iCommandId, int iParameterId, float *pfData)
int writeUnsignedLong(int iModuleId, int iCommandId, int iParameterId, unsigned long uiData)
int readUnsignedLong(int iModuleId, int iCommandId, int iParameterId, unsigned long *puiData)
virtual int clearReadQueue()=0
#define MSGID_DLR_INIT_ACK
unsigned long m_uiMessageId
#define CMDID_SCHUNK_GET_FTI
CProtocolDevice & operator=(const CProtocolDevice &rclProtocolDevice)
virtual ~CProtocolDevice()
destructor
void warning(const char *pcWarningMessage,...) const
#define MSGID_SCHUNK_SEND
int getDataDLR_FTS(std::vector< float > &rafData, long *piState)
int getCanOpenRawAbsEnc(int iModuleId, short *piValue)
int writeLongReadLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, long iData, long *piData, unsigned char *pucData1, unsigned char *pucData2)
void debug(const int iDebugLevel, const char *pcDebugMessage,...) const
int writeUnsignedShort(int iModuleId, int iCommandId, int iParameterId, unsigned short uiData)
#define PARID_DLR_DATA_GET
int writeShort(int iModuleId, int iCommandId, int iParameterId, short iData)
#define CMDID_DLR_DATA_GET
unsigned short auiData[2]
int readLong(int iModuleId, int iCommandId, int iParameterId, long *piData)
int write8Bytes(int iModuleId, bool bAck, void *pBytes)
#define MSGID_DLR_DATA_ACK
#define CMDID_DLR_DATA_ACK0
int readUnsignedChar(int iModuleId, int iCommandId, int iParameterId, unsigned char *pucData)
int readShort(int iModuleId, int iCommandId, int iParameterId, short *piData)
int writeUnsignedChar(int iModuleId, int iCommandId, int iParameterId, unsigned char ucData)
int writeShortReadLongUnsignedChars(int iModuleId, int iCommandId, int iParameterId, short iData, long *piData, unsigned char *pucData1, unsigned char *pucData2)
int writeFloat(int iModuleId, int iCommandId, int iParameterId, float fData)
int readChar(int iModuleId, int iCommandId, int iParameterId, char *pcData)
virtual int writeDevice(CProtocolMessage &rclProtocolMessage)=0
#define ERRID_DEV_WRONGMP55MODULEID
int writeFloatShortReadFloatUnsignedChars(int iModuleId, int iCommandId, int iParameterId, float fData, short iData, float *pfData, unsigned char *pucData1, unsigned char *pucData2)
int writeCommand(int iModuleId, int iCommandId)
virtual int setMessageId(unsigned long uiMessageId)=0
int getDataMP55_IO(int iModuleId, float *pfData)
int writeLongShort(int iModuleId, int iCommandId, int iParameterId, long iData1, short iData2)
#define CMDID_DLR_DATA_ACK2
#define CMDID_SCHUNK_GET_TRI
int setTaraMP55_IO(int iModuleId, float fTara)
int writeFloatShort(int iModuleId, int iCommandId, int iParameterId, float fData, short iData)