fix modbus sending FP32_R values (#4882)

This commit is contained in:
Samuel Sieb 2023-05-23 15:00:33 -07:00 committed by Keith Burzinski
parent 7d2ae4e252
commit 6e414180e0
No known key found for this signature in database
GPG key ID: 802564C5F0EEFFBE

View file

@ -506,12 +506,12 @@ void number_to_payload(std::vector<uint16_t> &data, int64_t value, SensorValueTy
case SensorValueType::U_DWORD: case SensorValueType::U_DWORD:
case SensorValueType::S_DWORD: case SensorValueType::S_DWORD:
case SensorValueType::FP32: case SensorValueType::FP32:
case SensorValueType::FP32_R:
data.push_back((value & 0xFFFF0000) >> 16); data.push_back((value & 0xFFFF0000) >> 16);
data.push_back(value & 0xFFFF); data.push_back(value & 0xFFFF);
break; break;
case SensorValueType::U_DWORD_R: case SensorValueType::U_DWORD_R:
case SensorValueType::S_DWORD_R: case SensorValueType::S_DWORD_R:
case SensorValueType::FP32_R:
data.push_back(value & 0xFFFF); data.push_back(value & 0xFFFF);
data.push_back((value & 0xFFFF0000) >> 16); data.push_back((value & 0xFFFF0000) >> 16);
break; break;