50 lines
865 B
C++
50 lines
865 B
C++
/*
|
|
* 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_ */
|