LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Help to acquisition an interval of values

Solved!
Go to solution

I have a DAQ Task for capture a LVDT signal, my task start by a digital trigger and capture N samples in  M rate, with a time = N/M, and the interval captured is between 10 and 40.  
but the problem is I need capture only  an interval of data, (for example between 15 and 30 ).

Is posible start the task , capturing the data only in a specific interval ?

 

I have using a PCI-6224 card.

 

redgards.

0 Kudos
Message 1 of 12
(3,909 Views)

A task like this is normally achieved using an analog trigger channel; unfortunately, the 6224 is not equipped wich such feature so this alternative is not feasible to you.

The best option is to set a continuous analog acquisition and post process acquired data to filter out unwanted measures.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 12
(3,907 Views)

OK, I guessed that was the problem ...

what model card with similar specifications have an analog trigger channel ?

 

thanks for all.

0 Kudos
Message 3 of 12
(3,902 Views)

This a simple search on NI product and services area: I selected "Multifunction daq", "analog trigger" and "PCI":

http://sine.ni.com/np/app/main/p/bot/no/ap/daq/lang/it/pg/1/sn/n17:daq,n21:41,n22:an,n24:PCI/

From this you can refine your search based on type/speed of measurement and other parameters.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 12
(3,898 Views)

I'm thinking:

 

to try to solve this problem (in this moment is not possible to change the card) I thought to throw short and quick tasks evaluating the position,

on the threshold that interests me, throw the final task in continuous mode.

 

What is the best way to launch quick and short tasks ?

 

thx.

0 Kudos
Message 5 of 12
(3,894 Views)

On one hand it is possible to reuse a task; that is: you can prepare a measuring task that takes a short measurement and use StartTask to start it repeatedly (provided the task has finished before you start it again. Until you do not clear the task, it can be reused. This is probably the fastest way to run tasks in the scenario you proposed.

 

On the other hand, it seems better to me to place a continuous running buffered acquisition task and monitor it while running: you may decide to discard measurements while not in the correct posiiont and start collecting them after this moment.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 6 of 12
(3,890 Views)

something like this (for capture a range between 15 and 28.5 controled for the channel 4):

 

// EXPERIMENTAL FUNCTIONS *********************************************************************************************************

int CVICALLBACK FuncionDaqCtrl (int panel, int control, int event, void *callbackData, int eventData1, int eventData2){
    switch (event){
        case EVENT_COMMIT:
            ControlDesplazamiento(6, 15);
            break;
    }
    return 0;
}



void ControlDesplazamiento(int LVDT, double dmax){
    double xstart,
           elapse,
           AValue[4];
    
    int i,
        j,
        m,
        ini,
        fin,
        desp,
        numRead;
         
    float64 vect[16],
            Volt[4],
            sum;

   char bufferDAQ[512];
            
  do{
    xstart = Timer ();   
    DAQmxStartTask (tareaCtrlDAQ); // DAQmx Start Code  
    DAQmxReadAnalogF64 (tareaCtrlDAQ, -1, 10, DAQmx_Val_GroupByChannel, vect, 16, &numRead, NULL);
    DAQmxStopTask (tareaCtrlDAQ);
    
    for(i=3; i<4; ++i){
        sum = 0.0;
          for(j=0; j<numRead; ++j)
            sum = sum + vect[j+i*numRead]; 
                    
        sum = sum/numRead; 
        Volt[i] = sum;     
        AValue[i] = Volt[i] * Gain[i+2] + Offset[i+2];
    }
   
    
}while(AValue[3] < dmax);

              

// Afer AValue[3] > dmax --> Launch the DAQ Task for capture the rest of values (to 28) ****** //

              
        
}

// FIN ******************************************************************************************************

 

0 Kudos
Message 7 of 12
(3,888 Views)

 

On the other hand, it seems better to me to place a continuous running buffered acquisition task and monitor it while running: you may decide to discard measurements while not in the correct posiiont and start collecting them after this moment.

 

Can you suggest me any way to monitor buffered task while it is runnig ?

0 Kudos
Message 8 of 12
(3,886 Views)

You can look at DAQmx shipping examples: all "ContAcq-xxx" example shows you how to perform a continuous acquisition and monitor measurements while it is running.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 12
(3,878 Views)

I'm working it ...

I'm use the CVICALLBACK Function EveryNCallback for chekit the values....

 

thanks for all ...

 

0 Kudos
Message 10 of 12
(3,876 Views)