LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 acquisition loops

Hi,
 
I am working on a new project with the latest labview 8.5. Now i want to make 2 timed loops with in loop 1 a hardware triggered acquisition of my USB6215 (8channels 500Hz) and it updates every 1 second. Then in loop 2 i want to display the aquired samples realtime so with a loop interval of 2 ms (= 500Hz). When i set DAQmx Read number of samples per channels on "-1" it should read the samples that are in the buffer at that time, but when i do this, i sometimes get the data but other times the chart's data jumps to the start (left). Can anyone provide me with a basic example...? I can't find it in the example files of LabVIEW.
 
Best regards,
Thijs Boeree 
0 Kudos
Message 1 of 10
(3,456 Views)

Hi Thijs,

Why do you want to use two loops? And why do you want to use a Timed loop?
What is the update mode of the chart that you are using?
The most basic example what exactly does what you want is the next:

Example Finder >> Hardware input and output >> DAQmx >> Analog Measurement >> Cont Acq&Graph Voltage-Int Clk.vi

Regards,

Bas van Dijke
AE, Netherlands

0 Kudos
Message 2 of 10
(3,420 Views)

Thanks for the answer! I thought i'd use two loops with each a different priority, i want to be shure that loop 1 aquires the data with a hardware timed clock (500 Hz) and that loop 2 displayes the data.

The problem that i always have is that when i use a sample frequency of 500 Hz that that the loop udates every 1000ms (i think it has to do with the hardware clock.

I am rebuilding my eyemovement data-acquisition program, so what i want is a loop that is udated say every 1/75 second (refresh rate of my monitor) So that i smoothly can see what the eyes are doing and at the same time i want to aquire the data in EDF format, i allready wrote a VI that converts binairy data in this format, the condition is that i need to write 8 channels 500Hz every second. So there is some sort of need of a buffer that fills up every second and empty's it in my data-file.

Best regards and i really appriciate your time!!

Thijs Boeree

 

 

0 Kudos
Message 3 of 10
(3,414 Views)

Hi Thijs,

I am sorry for the late response.

The problem that i always have is that when i use a sample frequency of 500 Hz that that the loop udates every 1000ms (i think it has to do with the hardware clock.
I don't understand what you mean with this. Could you post some code?

Maybe an idea is to enter a number of samples, based on a known samplerate. And then send the samples with a queue function to the second loop.

You can also contact us by phone. That is maybe more easy.

Regards,

Bas

 

 

0 Kudos
Message 4 of 10
(3,356 Views)

Hi Bas,

 

Happy newyear! It has been some time that i started with my acquisition program... Still, i used to have a data-acquisition loop with a daq occurence build in, but since that isn't available anymore with the new labview i don't know how to built it...

 

It very simple what i want to do, but don't know how...

 

1. I want a very preciese data acquisition with 6 channels @ 500 Hz

2. every 1 second the data has to be written to a file, in chunks of 6 x 500 samples = 3000 samples

3. I want to see every last sample in a waveform graph udated every 10 ms. ( so that I have a smooth update of the data being aquired, like a heart monitor, but this is for eye movement)

 

Best regards,

Thijs Boeree

0 Kudos
Message 5 of 10
(3,218 Views)

Hi Thijs,

 

Thanks for your reply to Bas.

 

Have your top loop doing the DAQ for 6 channels at 500Hz. Set the number of samples to collect to 3000. In the read DAQ loop (top loop) enqueue the data. In the second loop have a dequeue and a save to file code. (both examples of saving to file and queues in the NI Example finder - Help>>Find Examples).

 

Why do you want to update the graph every10ms? I would use a chart (which just adds the new data) and place it in the top loop, so everytime it iterates, the new 3000 samples are just added to the chart. Graphs are used when data isn't being continously acquired. It would only show the last 3000samples.


Hope this helps,
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 6 of 10
(3,207 Views)

Thanks for your fast reaction!

 

Is there a specific VI that i need to look up, to learn about qeues? I've seen some, but i don't know how to use them in conjunction with the daq story?

 

Best regards,

Thijs Boeree 

0 Kudos
Message 7 of 10
(3,203 Views)

Hi Thijs,

 

Thanks for your reply. 

 

I have posted an example in LabVIEW 8.6. 

 

Hope it helps,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 8 of 10
(3,199 Views)

Thanks so much... but i have version 8.5... Aaaargh!!

Can you convert it to version 8.5?

 

Best regards!

Thijs 

0 Kudos
Message 9 of 10
(3,195 Views)

Hi Thijs,

 

No Problems.

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 10 of 10
(3,192 Views)