UniSet  2.6.0
Открытые члены | Защищенные члены | Полный список членов класса
Класс UModbus

Открытые члены

std::string getUIType ()
bool isWriteFunction (int mbfunc)
void prepare (const std::string &ip, int port) throw (UException)
void connect (const std::string &ip, int port) throw (UException)
int conn_port ()
std::string conn_ip ()
bool isConnection ()
void setTimeout (int msec)
long mbread (int addr, int mbreg, int mbfunc, const std::string &vtype, int nbit=-1, const std::string &ip="", int port=-1) throw (UException)
long getWord (int addr, int mbreg, int mbfunc=0x4) throw (UException)
long getByte (int addr, int mbreg, int mbfunc=0x4) throw (UException)
bool getBit (int addr, int mbreg, int mbfunc=0x2) throw (UException)
void mbwrite (int addr, int mbreg, int val, int mbfunc, const std::string &ip="", int port=-1) throw (UException)

Защищенные члены

long data2value (uniset::VTypes::VType vt, uniset::ModbusRTU::ModbusData *data)

Методы

long UModbus::mbread ( int  addr,
int  mbreg,
int  mbfunc,
const std::string &  vtype,
int  nbit = -1,
const std::string &  ip = "",
int  port = -1 
) throw (UException)

Универсальная функция для чтения регистров. Если не указывать ip и порт, будут использованы, те чтобы были заданы в UModbus::connect(). Если заданы другие ip и port, будет сделано переподключение..

void UModbus::mbwrite ( int  addr,
int  mbreg,
int  val,
int  mbfunc,
const std::string &  ip = "",
int  port = -1 
) throw (UException)

Функция записи регистров 0x06 или 0x10 задаётся параметром mbfunc. Если не указывать ip и порт, будут использованы, те чтобы были заданы в UModbus::connect(). Если заданы другие ip и port, будет сделана переподключение..