09-04-2008 08:06 AM
Hello,
I have a USB 6009, set to read 6-analog channels. I wish to determine the phase angle of the voltage on each channel at a rate of 25 Hz.
I am using the external trigger of the USB 6009 to synchronise it with a GPS oscillator. The GPS oscillator is generating a 25 Hz pulse train.
When I look at the logged phase angles, I find that they are all taken at 80 ms intervals (12.5 Hz).
I have reduced the number of captured samples down so that the following should happen:
First 20ms: Capture 1 cycle of AC supply
Next 20ms: Compute Phase Angle
Repeat.
Windows reports the CPU activity as 6%, so I don't think the calculations are exceeding the available time.
Can anyone advise?
Thanks
09-11-2008 04:25 AM
Hi,
Would it be possible for you to post your code onto this thread?
Thanks
Steve
09-11-2008 11:21 AM
Hi Steve,
Code attached. The main VI is "00_PMU_V3.0.....vi". It was written with a USB-6009 in mind, but also works on a 6025E.
The card receives a trigger every 40 ms (25 Hz), but it only seems to aquire one block of samples every 80 ms (12.5 Hz). It seems to be missing every other trigger.
Thanks,
David
09-12-2008 04:40 AM
Hi!
I hope you are doing well today! I had a look at your code and it seems like you are acquiring N samples and then doing all of the processing in the same loop. Now, while this processing is done, you might well be missing the next trigger. I would suggest that you use a Producer/Consumer architecture to seperate the acquisition and processing in different loops. To get a template of the producer/consumer architecture, click on the More directory in 'New' in your getting started window. Then, navigate to VI -> From Template -> Frameworks -> Design Patterns. Let me know if you have any other questions.
09-12-2008 11:57 AM
Hi Adnan,
I decided to take a step back and check this out from a more basic perspective. I deleted everything except the data acquisation and added a millisecond timer to check the time it takes the loop to execute.
Although the card is definately getting a trigger every 40 ms, the while loop still takes 80 ms to execute.
I've attached the latest file if you can offer any suggestions.
Thanks
09-18-2008 05:30 AM
09-18-2008 09:21 AM
Hi Adnan,
Thanks for looking at this. I think you're on to something. I have set to continuous acquisition and I now get all the data I am requesting, however I have lost the sync with my GPS disciplined oscillator.
It would seem that the trigger will start the continuous acquisition, but after that the DAQ just free runs. Are you aware of a means by which I could set the DAQ so that the start of each block of data is disciplined by the GPS clock? This was the case with "N samples" but of course the problem appears as though the card takes too long resetting itself.
Thanks again,
David