@@ -69,8 +69,12 @@ const bool aptserial::stringToPositionControlMode(const std::string _positionCtr
69
69
}
70
70
return false ;
71
71
}
72
+ // ====================================================================================================================
73
+
72
74
73
75
76
+
77
+ // ====================================================================================================================
74
78
aptserial::KPZ101::KPZ101 (const std::string _deviceFileName) : APTDevice(_deviceFileName, APT_MGMSG_SRC_DEST_GENERIC_USB) {
75
79
updateHWInfo ();
76
80
updateIOSettings ();
@@ -92,7 +96,7 @@ void aptserial::KPZ101::setIOSettings(const PZ_VOLTAGE_RANGE _vRange, const PZ_A
92
96
93
97
94
98
void aptserial::KPZ101::getIOSettings (PZ_VOLTAGE_RANGE& _vRange, PZ_ANALOG_INPUT_SOURCE& _analogInputSource) {
95
- std::vector<char > replyData = WriteRead (APT_MGMSG_PZ_REQ_TPZ_IOSETTINGS, APT_MGMSG_PZ_GET_TPZ_IOSETTINGS, m_idSrcDest, sizeof (uHeader)+sizeof (stChannelIOSettings));
99
+ std::vector<char > replyData = Try_Write_Read (APT_MGMSG_PZ_REQ_TPZ_IOSETTINGS, APT_MGMSG_PZ_GET_TPZ_IOSETTINGS, m_idSrcDest, sizeof (uHeader)+sizeof (stChannelIOSettings));
96
100
97
101
if (replyData.size () == 0 )
98
102
throw SerialPortException (" kpz101.cpp" , " getIOSettings()" , " Reply not received" );
@@ -127,7 +131,7 @@ void aptserial::KPZ101::setInputVoltageSource(const PZ_INPUT_VOLTAGE_SOURCE _inp
127
131
128
132
129
133
void aptserial::KPZ101::getInputVoltageSource (PZ_INPUT_VOLTAGE_SOURCE& _inputVoltageSource) {
130
- std::vector<char > replyData = WriteRead (APT_MGMSG_PZ_REQ_INPUTVOLTSSRC, APT_MGMSG_PZ_GET_INPUTVOLTSSRC, m_idSrcDest, sizeof (uHeader)+sizeof (stChannelSource));
134
+ std::vector<char > replyData = Try_Write_Read (APT_MGMSG_PZ_REQ_INPUTVOLTSSRC, APT_MGMSG_PZ_GET_INPUTVOLTSSRC, m_idSrcDest, sizeof (uHeader)+sizeof (stChannelSource));
131
135
132
136
if (replyData.size () == 0 )
133
137
throw SerialPortException (" kpz101.cpp" , " getInputVoltageSource()" , " Reply not received" );
@@ -157,7 +161,7 @@ void aptserial::KPZ101::setPositionControlMode(const PZ_POSITION_CONTROL_MODE _p
157
161
158
162
159
163
void aptserial::KPZ101::getPositionControlMode (PZ_POSITION_CONTROL_MODE& _positionControlMode) {
160
- std::vector<char > replyData = WriteRead (APT_MGMSG_PZ_REQ_POSCONTROLMODE, APT_MGMSG_PZ_GET_POSCONTROLMODE, m_idSrcDest);
164
+ std::vector<char > replyData = Try_Write_Read (APT_MGMSG_PZ_REQ_POSCONTROLMODE, APT_MGMSG_PZ_GET_POSCONTROLMODE, m_idSrcDest);
161
165
162
166
if (replyData.size () == 0 )
163
167
throw SerialPortException (" kpz101.cpp" , " getPositionControlMode()" , " Reply not received" );
@@ -188,7 +192,7 @@ void aptserial::KPZ101::setOutputVoltage(const uint16_t _voltage_adu) {
188
192
189
193
190
194
void aptserial::KPZ101::getOutputVoltage (uint16_t & _voltage_adu) {
191
- std::vector<char > replyData = WriteRead (APT_MGMSG_PZ_REQ_OUTPUTVOLTS, APT_MGMSG_PZ_GET_OUTPUTVOLTS, m_idSrcDest, sizeof (uHeader)+sizeof (stChannelValue));
195
+ std::vector<char > replyData = Try_Write_Read (APT_MGMSG_PZ_REQ_OUTPUTVOLTS, APT_MGMSG_PZ_GET_OUTPUTVOLTS, m_idSrcDest, sizeof (uHeader)+sizeof (stChannelValue));
192
196
193
197
if (replyData.size () == 0 )
194
198
throw SerialPortException (" kpz101.cpp" , " getOutputVoltage()" , " Reply not received" );
0 commit comments