コード例 #1
0
ファイル: frmEM01Demo.cs プロジェクト: Sandeepkondreddy/Back
 /// <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);
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }