コード例 #1
0
        static void Main(string[] args)
        {
            device_id = HRobot.open_connection("127.0.0.1", 1, callback);
            Thread.Sleep(1000);
            StringBuilder sdk_version = new StringBuilder();

            HRobot.get_hrsdk_version(sdk_version);
            Console.WriteLine("SDK version: " + sdk_version);
            if (device_id >= 0)
            {
                Console.WriteLine("connect successful.");
                HRobot.set_motor_state(device_id, 1);
                Thread notify = new Thread(run_notify);
                notify.IsBackground = true;
                notify.Start(device_id);

                NetWorkExample_Client(device_id);   // HRSS is socket client
                Thread.Sleep(2000);
                Console.WriteLine();
                NetWorkExample_Server(device_id);   // HRSS is socket server

                Thread.Sleep(3000);
                Console.WriteLine(" \n Please press enter key to end.");

                Console.ReadLine();
                HRobot.disconnect(device_id);
            }
            else
            {
                Console.WriteLine("connect failure.");
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: HIWINCorporation/hiwin_sdk
 static void Main(string[] args)
 {
     device_id = HRobot.open_connection("127.0.0.1", 1, callback);
     if (device_id >= 0)
     {
         Console.WriteLine("connect successful.");
         PrintFunction();
         Console.ReadLine();
         HRobot.disconnect(device_id);
     }
     else
     {
         Console.WriteLine("connect failure.");
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: HIWINCorporation/hiwin_sdk
        static void Main(string[] args)
        {
            device_id = HRobot.open_connection("127.0.0.1", 1, callback);
            Thread.Sleep(1000);
            StringBuilder sdk_version = new StringBuilder();

            HRobot.get_hrsdk_version(sdk_version);
            Console.WriteLine("sdk version: " + sdk_version);
            if (device_id >= 0)
            {
                Console.WriteLine("connect successful.");
                HRobot.set_motor_state(device_id, 1);
                SoftLimitExample(device_id);
                Console.ReadLine();
                HRobot.disconnect(device_id);
            }
            else
            {
                Console.WriteLine("connect failure.");
            }
        }