Exemplo n.º 1
0
 public void Connect(string addIP)
 {
     try
     {
         Ch.OpenCommEthernetTCP(addIP, Ch.ACSC_SOCKET_STREAM_PORT);
         EnableMotor(0);
         EnableMotor(1);
         EnableMotor(2);
     }
     catch (COMException ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Exemplo n.º 2
0
        public override bool?Connect(string path, ConnectMode mode)
        {
            switch (mode)
            {
            case ConnectMode.IP:
                Ch.CloseComm();
                Ch.OpenCommEthernetTCP(path, Ch.ACSC_SOCKET_STREAM_PORT);
                return(true);

            case ConnectMode.Com:
                Ch.CloseComm();
                Ch.OpenCommSerial(Convert.ToInt32(path), -1);
                return(null);
            }
            return(null);
        }