/// <summary> /// Opens the barrier /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOpen_Click(object sender, EventArgs e) { if (_con.IsConnected) { _con.WriteModbusRegisterUInt16(0x0000, 0x0001); } }
public static string CloseBoomBarrior(string BoomBarrierIP, cMGCConnector _con) { string CloseBBStatus = ""; if (_con.IsConnected) { _con.WriteModbusRegisterUInt16(0x0000, 0x0002); string closeConnection = BoomBarriorConnection(BoomBarrierIP, _con); CloseBBStatus = "Boom Barrier Closed"; } else { CloseBBStatus = "Not Connected"; } return(CloseBBStatus); }
public static string OpenBoomBarriorO(string BoomBarrierIP, cMGCConnector _con) { string OpenBBStatus = ""; if (BoomBarriorConnection(BoomBarrierIP, _con) == "Conneted") { if (_con.IsConnected) { _con.WriteModbusRegisterUInt16(0x0000, 0x0001); string closeConnection = BoomBarriorConnection(BoomBarrierIP, _con); OpenBBStatus = "BoomBarrier Opened"; } } else { OpenBBStatus = "BoomBarrier Not Connected"; } return(OpenBBStatus); }
public static string OpenBoomBarrior(string BoomBarrierIP, cMGCConnector _con) { string OpenBBStatus = ""; if (!_con.IsConnected) { BoomBarriorConnection(BoomBarrierIP, _con); } if (_con.IsConnected) { _con.WriteModbusRegisterUInt16(0x0000, 0x0001); //string closeConnection = BoomBarriorConnection(BoomBarrierIP, _con); OpenBBStatus = "Open"; } else { OpenBBStatus = "Not Connected"; } return(OpenBBStatus); }