LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger from laser pulses?

the trigger from the laser(1KHz rep rate) is connected to PFI0.I collect data from a PMT.I use "Acquire 1 Point Digital Trig.Vi" in a for loop and then average the data.The program is very simple, and if my logic is right, I should be able to average 1000 points(N=1000) in 1 second, because I get 1000 pulses(train of pulses)in a second.However it takes around 1 minute to average 1000 points. Somehow I lose time, I don't know why? I attached the program I am using. I really appreciate any help.Thanks.
0 Kudos
Message 1 of 6
(4,100 Views)
You need to use low level VIs to acquire your data. The method you are using configures the DAQ device for EACH data point you are trying to acquire.

Look at the DAQ examples. There should be an example that is close to what you want to do.

If you still have trouble, post here. This is the exact kind of DAQ programming I did when I learned LabVIEW 5 years ago (and I do mean exact! 1kHz Lasers with PMT output as the acquired data, and a timing signal as the trigger...)
0 Kudos
Message 2 of 6
(4,100 Views)
Hi, i believe the problem u have relates to similar problem i had a couple of years ago. And it relates i had to collect a lot of data at rapid rate, but then i found later that the buffer where the data was collected, was getting full. And u know what happens to computer which has low memory it takes a lot longer to process the data with in the computer. So i should if possible increase the buffer size. Hope this helps.

Stu
0 Kudos
Message 3 of 6
(4,100 Views)
I tried something else. I used(or tried to use) an external clock,The laser signal coming from PFI0 will define my scan rate.Also I am not configuring the device for each data point.this still doesn't work.I get errors about buffer size. What shoul it be?

It still takes more time to average.
I looked at some of the DAQ examples like " Acquire N Scans-ExtScanClk.vi". I really am a beginner in Labview, so all these examples looked more confusing.
So I need help. Thanks.
0 Kudos
Message 4 of 6
(4,100 Views)
Ok, but how do you change the buffer where data is collected?
0 Kudos
Message 5 of 6
(4,100 Views)
First, you are starting the acquisition for each instance (loop iteration), this is not necessary.

Second, you need to set the acquisition to continuous, and the scan clock source to external connector. These are set at the AI Start. You don't need the low level start and control VIs.

Here is what you should do:

Configure your acquistion: Use AI Config Mid Level function. This sets the buffer size. The buffer should reflect how often you want to read. If you want to read and average 1000 points at a time, you just set your buffer to continuous.

Start the acquisition: This comences the acquisition of the data from the laser. You should configure this to read 1000 points at a time, or, alternatively, use DAQ Occurrences to read when the buffer reaches 1000. I used this method for a strip chart recorder to read buffered data and process it when it was available. This is a more advanced method, and I don't recommend using it right away. For now, just set the number of scans to read at 1000. Here is where configure the trigger. For your case, just set the scan clock source to "external connector". This is the PFI pins.

Read the data in the for loop with the number of iterations set to the number of sets of averages you want to perform. If this is done only once (i.e., you ONLY acquire 1 set of 1000 points, period, then don't use a for loop. Use the AI Read mid level function to perform the read. Set the number to read to 1000. This will read your 1000 points from the DMA memory location to your program.

Average the data. This is also done in the for loop, using the single function (Add array elements) after you have gleaned the 1-D array of data from your channel using the "Delete from Array" function. You will receive a single data point for each set of 1000.

After the loop, you need to stop your acquisition and clear the setup on the DAQ card. Use the mid level AI Clear function to accomplish this.



It is important to know exactly how the DAQ functions work, at least on a high level. I would suggest that you take some NI courses on Data Acquisition. There are books out there too, but the courses are comprehensive, and well worth the investment. Contact NI or your sales rep to find out about the courses.
0 Kudos
Message 6 of 6
(4,099 Views)