예제 #1
0
 public DigitalWaveformGenerator(string line, bool periodic)
 {
     periodicWaveform             = periodic;
     waveform                     = new WaveformState[2];
     waveform[0]                  = new WaveformState();
     waveform[0].state            = true;
     waveform[0].durationMilliSec = onDuration;
     waveform[1]                  = new WaveformState();
     waveform[1].state            = false;
     waveform[1].durationMilliSec = offDuration;
     transitionevent              = new WaveformEventArgs();
     lastStateIdx                 = 0;
     digitalLine                  = line;
     try
     {
         DAQTask = new Task();
         DOChannel outputChannel = DAQTask.DOChannels.CreateChannel(digitalLine, "waveform", ChannelLineGrouping.OneChannelForAllLines);
         outputChannel.OutputDriveType = DOOutputDriveType.ActiveDrive;
         DAQTask.Start();
         writer = new DigitalSingleChannelWriter(DAQTask.Stream);
     }
     catch (DaqException ex)
     {
         MessageBox.Show(ex.Message);
         if (DAQTask != null)
         {
             DAQTask.Dispose();
             DAQTask = null;
         }
     }
 }
예제 #2
0
 public WaveformEventArgs(WaveformState s)
 {
     state = s;
 }