补充漏传文件

1600-900
Jeffrey_Li 2 years ago
parent e792799564
commit e775e1a5b9

@ -7,7 +7,7 @@
extern SysConf g_sys_conf; extern SysConf g_sys_conf;
modbus_t * g_modbus; //Modbus TCP modbus_t * g_modbus = NULL; //Modbus TCP
bool PLCDevice::init_plc(PLCDevice* PLCptr) bool PLCDevice::init_plc(PLCDevice* PLCptr)
{ {
@ -28,9 +28,12 @@ bool PLCDevice::init_plc(PLCDevice* PLCptr)
return true; return true;
} }
bool PLCDevice::disconnect_plc(void) bool PLCDevice::disconnect_plc(void)
{
if(g_modbus)
{ {
modbus_close(g_modbus); modbus_close(g_modbus);
modbus_free(g_modbus); modbus_free(g_modbus);
}
return true; return true;
} }
int PLCDevice::write_bit_2_plc(int addr, int value) int PLCDevice::write_bit_2_plc(int addr, int value)

Loading…
Cancel
Save