示例#1
0
 public Controller(string address)
 {
     ipAddress       = address;
     DMC1425         = new Galil.Galil();
     DMC1425.address = ipAddress;
     //  ControllerInfo = DMC1425.connection();
 }
示例#2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     try
     {
         g            = new Galil.Galil();                        //create a new object
         label1.Text  = g.libraryVersion() + Environment.NewLine; //print libarary version
         g.address    = "";                                       //connect to controller
         label1.Text += g.connection() + Environment.NewLine;     //print connection in label1
         label1.Text += "MG TIME " + g.command("MG TIME");
     }
     catch (System.Runtime.InteropServices.COMException ex)
     {
         label1.Text += ex.Message;
     }
 }
示例#3
0
        public bool Connect(string ipAddr)
        {
            bool ret = false;

            try
            {
                if (gALIL == null)
                {
                    gALIL = new Galil.Galil();
                }
                if (tmr_pos != null)
                {
                    tmr_pos.Stop();
                }
                gALIL.address = ipAddr;
                connIpAddr    = ipAddr;
                GalibVersion  = gALIL.libraryVersion();
                string rec = gALIL.connection();
                if (rec.Contains(ipAddr))
                {
                    IsConnect        = ret = true;
                    GalibVersion     = rec;
                    gALIL.onMessage += new Galil.Events_onMessageEventHandler(g_onMessage);
                }
                else
                {
                    IsConnect = ret = false;
                }
                //set timer
                SetTimer();
            }
            catch (Exception ex)
            {
                LogHelper.AppLoger.Error(ex);
            }
            return(ret);
        }
示例#4
0
 public void Disconnect()
 {
     gALIL = null;
 }