Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how to take a single data point for each trigger pulse ( synchronous acquisition).

 hi
          im using the pci-mio-16E1 card, with the IDE VC++, so  im looking for an example to explicate me how to make an synchronous acquisition data using an external timing, so the idea is to acquire (take) a single data point for each trigger pulse  from one  input channel ,and saving  the data in a file .
now im making a code using the AI_setup and DAQ_op functions, im getting  a speed acquisition (it is the start of acquisition data), and  it is  a synchronous acquisition just for one trigger pulse, and me i looking for an acquisition for each trigger pulse. 
 
 
 
  so to  understand my problem you can see my code :
 
 
iStatus = Timeout_Config(iDevice, lTimeout);
         iRetVal = NIDAQErrorHandler(iStatus, "Timeout_Config", iIgnoreWarning);
 
 
   //  configuration and selection of  signal trigger  
 
         iStatus = Configure_HW_Analog_Trigger(iDevice, ND_ON, iLowValue,iHighValue, ND_ABOVE_HIGH_LEVEL, ND_THE_AI_CHANNEL);
  
        iRetVal = NIDAQErrorHandler(iStatus, "Configure_HW_Analog_Trigger", iIgnoreWarning);
    
 
  iStatus = Select_Signal(iDevice, ND_IN_CONVERT, ND_PFI_2,ND_HIGH_TO_LOW);
    
         iRetVal = NIDAQErrorHandler(iStatus, "Select_Signal", iIgnoreWarning);
    
    iStatus = AI_Setup(iDevice, iChannel, iGain);
   iRetVal = NIDAQErrorHandler(iStatus, "AI_Setup", iIgnoreWarning);
  
   while ((iReadingAvail != 1) && (iStatus == 0)) {
      
 /* Wait until reading is available. */
         iStatus = AI_Check(iDevice, &iReadingAvail, &iReading);
       
        iRetVal = NIDAQYield(iYieldON);
    }
 
       //  Acquire data from a single channel 
 
    iStatus = DAQ_Op (iDevice, iChannel, iGain, piBuffer, ulCount, dSampRate);
 
   while ((iDAQstopped != 1) && (iStatus == 0)) {
   
        iStatus = DAQ_Check(iDevice, &iDAQstopped, &ulRetrieved);
         
        iRetVal = NIDAQYield(iYieldON);
      }
  
 
       iStatus = DAQ_VScale(iDevice, iChannel, iGain, dGainAdjust, dOffset,ulCount, piBuffer, pdVoltBuffer);
 
      iRetVal = NIDAQErrorHandler(iStatus, "DAQ_VScale",iIgnoreWarning);
   
   /* Set analog trigger mode back to initial state. */
       iStatus = Configure_HW_Analog_Trigger(iDevice, ND_OFF, iLowValue,iHighValue, ND_ABOVE_HIGH_LEVEL, ND_THE_AI_CHANNEL);
   
 
  /* Set PFI line back to initial state. */
       iStatus = Select_Signal(iDevice, ND_IN_START_TRIGGER,ND_AUTOMATIC, ND_DONT_CARE);
  
   
          iStatus = DAQ_Clear(iDevice);
     
 /* Plot acquired data  */
   
      iRetVal = NIDAQPlotWaveform(pdVoltBuffer,ulCount, WFM_DATA_F64);
    
so this is the data acquired -0.900879,-0.900879,-0.900879,-0.900879,-0.900879,-0.900879,-0.900879,-0.900879 and i think that is a noise because all time i get this data.
tank you very mutch fo your help
0 Kudos
Message 1 of 2
(3,033 Views)
Hello,
 
Please see the responses to this thread at the following post.
 
Also, please only post one thread per issue.
 
Regards,
Sean C.
0 Kudos
Message 2 of 2
(3,026 Views)