Esempio n. 1
0
        public void DAQDI()
        {
            NationalInstruments.DAQmx.Task digitalReadTask = DaqSystem.Local.LoadTask("Digital_Read_Multi");
            DigitalMultiChannelReader      DI_Channel      = new DigitalMultiChannelReader(digitalReadTask.Stream);

            do
            {
                Global.DI = DI_Channel.ReadSingleSampleSingleLine();
            } while (exit == false);
        }
Esempio n. 2
0
 /// <summary>
 /// Perform DI task.
 /// </summary>
 /// <returns></returns>
 public bool[] DigitalRead()
 {
     if (digitalIn != null)
     {
         try
         {
             DigitalMultiChannelReader dr = new DigitalMultiChannelReader(digitalIn.Stream);
             return(dr.ReadSingleSampleSingleLine());
         }
         catch (DaqException de)
         {
             log.Write(de.Message);
         }
     }
     return(new bool[0]);
 }