MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/driver/ModbusAnalogValue.hh
2024-06-07 11:12:56 +03:00

51 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* ModbusAnalogValue.hh
*
* Created on: 19 мар. 2021 г.
* Author: titov
*/
#ifndef UMLIBRARY_DRIVER_MODBUSANALOGVALUE_HH_
#define UMLIBRARY_DRIVER_MODBUSANALOGVALUE_HH_
#include <stdint.h>
#include "IModBus.hh"
#include "../systemic/IValueAsync.hpp"
namespace driver {
namespace modbus {
class ModbusAnalogValue : public IModBusDispatch {
typedef IModBusDispatch::Status Status;
float write_coeff;
float write_offset;
float read_coeff;
float read_offset;
bool format_signed;
float up_limit;
float down_limit;
systemic::IValueType<float> & tech_value;
const uint16_t nan_out_of_range; //!< Сопоставление для значения NAN сигнала
public:
ModbusAnalogValue( systemic::IValueType<float> & value,
float write_coeff, float write_offset, float read_coeff, float read_offset,
bool sign, float up_limit, float down_limit, uint16_t nan_register );
Status read( uint16_t & reg );
Status write( uint16_t reg );
};
}
}
#endif /* UMLIBRARY_DRIVER_MODBUSANALOGVALUE_HH_ */