Example #1
0
        // Starts the Intrepid ValueCAN interface at 500k
        private void StartValueCANInterface()
        {
            string[] interfaces = BusInterface.ReturnInterfaces();

            for (int i = 0; i < interfaces.Length; i++)
            {
                if (interfaces[i].IndexOf("ValueCAN") != -1)
                {
                    int status = GenericCanBus.GenericCanBusOn(interfaces[i], "500K");

                    if (status == 1)
                    {
                        guidedStatusBox.Text = "Success: ValueCAN Interface is On\nValueCAN Interface started at "
                                               + GenericCanBus.GenericCanRateReturn(interfaces[0]);
                        guidedActionBox.Text = "";
                        ErrorLog.NewLogEntry("CAN", "ValueCAN in Guided Setup Started");
                    }
                    else
                    {
                        guidedStatusBox.Text = "Error Starting the ValueCAN Interface";
                        ErrorLog.NewLogEntry("CAN", "Error Starting the ValueCAN Interface in Guided Setup");
                    }
                }
            }
        }
Example #2
0
        //******************
        // Use Case Actions are provided below
        //******************

        // Starts the two Kvaser virtual interfaces
        private void StartVirtualInterfaces()
        {
            string[] interfaces = BusInterface.ReturnInterfaces();

            int status0 = GenericCanBus.GenericCanBusOn(interfaces[0], "500K");
            int status1 = GenericCanBus.GenericCanBusOn(interfaces[1], "500K");

            if (status0 == 1 && status1 == 1)
            {
                guidedStatusBox.Text = "Success: Virtual Interfaces are On\nVirtual Interface 1 started at "
                                       + GenericCanBus.GenericCanRateReturn(interfaces[0])
                                       + "\nVirtual Interface 2 started at "
                                       + GenericCanBus.GenericCanRateReturn(interfaces[1]);
                guidedActionBox.Text = "";
                ErrorLog.NewLogEntry("CAN", "Virtual Interfaces in Guided Setup Started");
            }
            else
            {
                guidedStatusBox.Text = "Error Starting the Virtual Interfaces";
                ErrorLog.NewLogEntry("CAN", "Error Starting the Virtual Interfaces in Guided Setup");
            }
        }
Example #3
0
        // Starts the ECom interface at 500k
        private void StartEComInterface()
        {
            string[] interfaces = BusInterface.ReturnInterfaces();

            for (int i = 0; i < interfaces.Length; i++)
            {
                if (interfaces[i].IndexOf("ECom") != -1)
                {
                    int status = GenericCanBus.GenericCanBusOn(interfaces[i], "500K");

                    if (status == 1)
                    {
                        guidedStatusBox.Text = "Success: ECom Interface is On\nECom adapter will not return bitrate";
                        guidedActionBox.Text = "";
                        ErrorLog.NewLogEntry("CAN", "ECom Interface in Guided Setup Started");
                    }
                    else
                    {
                        guidedStatusBox.Text = "Error Starting the ECom Interface";
                        ErrorLog.NewLogEntry("CAN", "Error Starting the ECom Interface in Guided Setup");
                    }
                }
            }
        }