Example #1
0
        /// <summary>
        /// The digital outputs are sequentially switched on and off until the digital output test checkbox is unchecked.
        /// </summary>
        private void K8055DigitalOutputTest()
        {
            while (_digitalOutputTest)
            {
                for (int i = 1; i < 9; i++)
                {
                    Dispatcher.BeginInvoke(new Action(delegate
                    {
                        K8055ButtonClick(new Button {
                            Name = "K8055ClearAllDigitalButton"
                        }, null);
                        ((CheckBox)K8055DigitalOutputCanvas.Children[i - 1]).IsChecked = true;
                    }));
                    Thread.Sleep(100);
                }

                K8055.ClearDigitalChannel(8);
                Dispatcher.BeginInvoke(new Action(delegate
                {
                    K8055DigitalOutputCheckbox8.IsChecked = false;
                }));
            }
        }
Example #2
0
 /// <summary>
 /// Once a digital output checkbox state changes to "unchecked", the K8055 digital output is cleared.
 /// </summary>
 private void K8055OutputCheckboxUnchecked(object sender, RoutedEventArgs e)
 {
     K8055.ClearDigitalChannel(Convert.ToInt32(((CheckBox)sender).Content));
 }