Ejemplo n.º 1
0
double QxrdNIDAQPlugin::count(int /* chan */, double /* time */)
{
  QMutexLocker lock(&m_Mutex);

  static TaskHandle counterTask = 0;
  int error;
  float64 res = 0;

  if (counterTask == 0) {
    DAQmxErrChk(DAQmxCreateTask("counter", &counterTask));
    DAQmxErrChk(DAQmxCreateCICountEdgesChan(counterTask,"Dev1/ctr2", "", DAQmx_Val_Rising, 0, DAQmx_Val_CountUp));
    DAQmxErrChk(DAQmxSetCICountEdgesTerm(counterTask, "/Dev1/ctr2", "/Dev1/100MHzTimebase"));
    DAQmxErrChk(DAQmxStartTask(counterTask));
  }

  if (counterTask) {
    DAQmxErrChk(DAQmxReadCounterScalarF64(counterTask, 0, &res, NULL));
  }

  return res;

Error:
  DAQmxClearTask(counterTask);
  return res;
}
Ejemplo n.º 2
0
/******************************************************************************
**
** Acquisition des données des compteur et mise en forme pour
** déterminer l'origine
**
******************************************************************************/
int NI6211::readCounter()
{
    float64 data[1];
    int error=0;
    DAQmxErrChk (DAQmxReadCounterScalarF64(*taskCounter,DAQmx_Val_WaitInfinitely,data,NULL));

Erreur:
    checkError(error);
    return data[0];
}
Ejemplo n.º 3
0
/******************************************************************************
**
** Acquisition des valeur de la tache d'acquisition de la vitesse
**
******************************************************************************/
double NI6211::readSpeed()
{
    int error;
    double speed[1];

    /*------ DAQmx Read Code ------*/
    DAQmxErrChk (DAQmxReadCounterScalarF64(*taskFreq,1,speed,NULL));

Erreur:
    checkError(error);
    return speed[0];
}