예제 #1
0
        private static void Adam6017Demo(string ipAdam6017)
        {
            // initialize
            var adam6017 = new Adam6017(ipAdam6017);
            // make connection
            var isConnected = adam6017.Connect();
            if (isConnected)
            {
                // read firmware version
                var firmwareVersion = adam6017.GetFirmWareVersion();

                Console.WriteLine("Start Adam6017 demo");
                Console.WriteLine("Adam6017 connected: " + true);
                Console.WriteLine("Adam6017 firmware:" + firmwareVersion);

                for (var i = 0; i < adam6017.Channels; i++)
                {
                    var val = adam6017.ReadInputChannelAsString(i);
                    Console.WriteLine("Ch-"+ i + ": " + val);
                }

                adam6017.Disconnect();
                Console.WriteLine("End Adam6017 demo");
            }
            else
            {
                Console.WriteLine("No connection to Adam6017 :-(");
            }
            Console.WriteLine();
        }
예제 #2
0
        private static void Adam6017Demo(string ipAdam6017)
        {
            // initialize
            var adam6017 = new Adam6017(ipAdam6017);
            // make connection
            var isConnected = adam6017.Connect();

            if (isConnected)
            {
                // read firmware version
                var firmwareVersion = adam6017.GetFirmWareVersion();

                Console.WriteLine("Start Adam6017 demo");
                Console.WriteLine("Adam6017 connected: " + true);
                Console.WriteLine("Adam6017 firmware:" + firmwareVersion);

                for (var i = 0; i < adam6017.Channels; i++)
                {
                    var val = adam6017.ReadInputChannelAsString(i);
                    Console.WriteLine("Ch-" + i + ": " + val);
                }

                adam6017.Disconnect();
                Console.WriteLine("End Adam6017 demo");
            }
            else
            {
                Console.WriteLine("No connection to Adam6017 :-(");
            }
            Console.WriteLine();
        }