20 #include "Configuration.h"
21 #include "UInterface.h"
22 #include "modbus/ModbusTCPMaster.h"
23 #include "modbus/ModbusTypes.h"
24 #include "extensions/VTypes.h"
27 #include "UExceptions.h"
36 inline std::string getUIType()
38 return string(
"modbus");
41 inline bool isWriteFunction(
int mbfunc )
43 return uniset::ModbusRTU::isWriteFunction((uniset::ModbusRTU::SlaveFunctionCode)mbfunc);
47 void prepare(
const std::string& ip,
int port )
throw(
UException);
49 void connect(
const std::string& ip,
int port )
throw(
UException);
50 inline int conn_port()
54 inline std::string conn_ip()
58 inline bool isConnection()
60 return (mb && mb->isConnection());
63 inline void setTimeout(
int msec )
73 long mbread(
int addr,
int mbreg,
int mbfunc,
74 const std::string& vtype,
int nbit = -1,
75 const std::string& ip =
"",
int port = -1 )
throw(
UException);
77 long getWord(
int addr,
int mbreg,
int mbfunc = 0x4 )
throw(
UException);
78 long getByte(
int addr,
int mbreg,
int mbfunc = 0x4 )
throw(
UException);
79 bool getBit(
int addr,
int mbreg,
int mbfunc = 0x2 )
throw(
UException);
86 void mbwrite(
int addr,
int mbreg,
int val,
int mbfunc,
const std::string& ip =
"",
int port = -1 )
throw(
UException);
89 long data2value( uniset::VTypes::VType vt, uniset::ModbusRTU::ModbusData* data );
long mbread(int addr, int mbreg, int mbfunc, const std::string &vtype, int nbit=-1, const std::string &ip="", int port=-1)
Definition: UModbus.cc:129
void mbwrite(int addr, int mbreg, int val, int mbfunc, const std::string &ip="", int port=-1)
Definition: UModbus.cc:294
Definition: ModbusTCPMaster.h:16
Definition: UExceptions.h:20