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

50 lines
869 B
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.

/*
* ModbusAnalogOutput.hh
*
* Created on: 19 мар. 2021 г.
* Author: titov
*/
#ifndef UMLIBRARY_DRIVER_MODBUSANALOGOUTPUT_HH_
#define UMLIBRARY_DRIVER_MODBUSANALOGOUTPUT_HH_
#include <stdint.h>
#include "IModBus.hh"
namespace driver {
namespace modbus {
class ModbusAnalogOutput : public IModBusDispatch {
typedef IModBusDispatch::Status Status;
const float coeff;
const float offset;
const float invalid;
float value;
uint16_t reg;
bool sign;
float up_limit;
float down_limit;
public:
ModbusAnalogOutput( float coeff, float offset, float invalid, bool sign,
float initial, float up_limit, float down_limit );
const float & signal() const;
Status read( uint16_t & reg );
Status write( uint16_t reg );
};
}
}
#endif /* UMLIBRARY_DRIVER_MODBUSANALOGOUTPUT_HH_ */