10-16-2006 05:38 PM
10-17-2006 12:16 AM
10-17-2006 11:44 AM
10-17-2006 01:07 PM
10-17-2006 01:13 PM
10-17-2006 02:42 PM - edited 10-17-2006 02:42 PM
Not sure how the speed stacks up, but it's pretty easy to perform these functions within your LabVIEW program as well. Here's a screenshot:
Under LV, the "natural" form of the diff function will produce an output with the same size as the input. A form that reduces the size by 1 (like Matlab) is likely to be a slower on average.
-Kevin P.
Message Edited by Kevin Price on 10-17-2006 03:43 PM
10-17-2006 02:48 PM
11-10-2006 08:27 AM
@ChrisErven wrote:
Hi,
Thanks to anyone who can give me help. I've done some LabView programming with a DAC before in an older version of LabView, I'm just starting out with Counter/Timer applications with the new LabView and I'm trying to figure out what's going on. Information on exactly what's going on is hard to come by. I've spent the last two days going through most of the LabView help files and examples, and today I've been going through this forum. I'm hoping though that someone can provide me with an explanation as to what's going on.
My application: I'm trying to make an application that will provide highly accurate time stamps (using the 80MHz internal clock ~12.5ns) in a quantum key distribution experiment. What happens is I generate a photon pair, this pair then goes through an optical circuit and eventually each gets detected by a separate photon detector which outputs TTL pulses, these pulses are then meant to come into the counter and be stamped with a highly accurate event time, so two lists will be generated and a time correlation function will then be run on these lists to determine the paired events in each list.
My Hardware: PCI6602 counter/timer card, BNC-2121 board, LabView 7.1
My general idea of what I have to do: Have 2 counters running off of the 80MHz timebase to keep an accurate time, have an overflow counter so that when the counters reach their maximum they reset to zero and the overflow counter gets incremented (so that the experiment can run for longer then the size of the counters), have the 2 photon detector signals come in as the gates for the two counter channels, write a time stamp to a file every time the gates fire.
(I've included the code I have so far)
Steps I have so far:
1) Create a channel
- I've tried various things now to put a gate or a trigger in, Start Trigger complains about not having the right component, arm trigger seems to work but from what I've gathered from reading other posts I want a DAQmx Timing.vi to use as the Gate (using a Timing vi as the gate was not at all obvious to me), so how do I use the timing VI as a gate? Can you explain to me what each pin is doing and what's going on? I can look at example code easily enough myself, but I want to have an idea of what the heck is happening.
2) Start a task
3) Read the counter
- Alright so if I get the gate working, someone also told me that I have to use a buffered read so that the hardward continues to read the clock and there's no software latency issues, I'm going through the example Counter Digital Events-Buffered Continuous.vi again, but if someone can help me on what to do, and more importanly how things are working and why I'm doing things that would be great
- I also need a write function here to write time stamps to a file, anything I need to be aware of so that the write doesn't slow down the time stamping or anything else?
4) Stop Task
5) Clear Task
I need to keep all this going in some sort of loop as well until the end of the experiment, thoughts?
What does the DAQmx trigger.vi do? Because that's what I've been trying for the longest time to use and it hasn't been working.
As you can see I have two loops there, I was trying to make the vi continuous so that it could receive multiple events from the photon detectors, but what I've done is probably very ugly, is there a better way to set this up?
Lastly, if there are any good resources which EXPLAIN what components are doing and how to use them (I've gone through the help files on all the DAQmx components and they don't have much in depth info), I'm more then willing to do some work and learn how to do things myself, all I need are some good resources.
Thanks to anyone that can help me with this gigantic post, I really appreciate it 🙂
Chris
@ChrisErven wrote:
Hi,
Thanks to anyone who can give me help. I've done some LabView programming with a DAC before in an older version of LabView, I'm just starting out with Counter/Timer applications with the new LabView and I'm trying to figure out what's going on. Information on exactly what's going on is hard to come by. I've spent the last two days going through most of the LabView help files and examples, and today I've been going through this forum. I'm hoping though that someone can provide me with an explanation as to what's going on.
My application: I'm trying to make an application that will provide highly accurate time stamps (using the 80MHz internal clock ~12.5ns) in a quantum key distribution experiment. What happens is I generate a photon pair, this pair then goes through an optical circuit and eventually each gets detected by a separate photon detector which outputs TTL pulses, these pulses are then meant to come into the counter and be stamped with a highly accurate event time, so two lists will be generated and a time correlation function will then be run on these lists to determine the paired events in each list.
My Hardware: PCI6602 counter/timer card, BNC-2121 board, LabView 7.1
My general idea of what I have to do: Have 2 counters running off of the 80MHz timebase to keep an accurate time, have an overflow counter so that when the counters reach their maximum they reset to zero and the overflow counter gets incremented (so that the experiment can run for longer then the size of the counters), have the 2 photon detector signals come in as the gates for the two counter channels, write a time stamp to a file every time the gates fire.
(I've included the code I have so far)
Steps I have so far:
1) Create a channel
- I've tried various things now to put a gate or a trigger in, Start Trigger complains about not having the right component, arm trigger seems to work but from what I've gathered from reading other posts I want a DAQmx Timing.vi to use as the Gate (using a Timing vi as the gate was not at all obvious to me), so how do I use the timing VI as a gate? Can you explain to me what each pin is doing and what's going on? I can look at example code easily enough myself, but I want to have an idea of what the heck is happening.
2) Start a task
3) Read the counter
- Alright so if I get the gate working, someone also told me that I have to use a buffered read so that the hardward continues to read the clock and there's no software latency issues, I'm going through the example Counter Digital Events-Buffered Continuous.vi again, but if someone can help me on what to do, and more importanly how things are working and why I'm doing things that would be great
- I also need a write function here to write time stamps to a file, anything I need to be aware of so that the write doesn't slow down the time stamping or anything else?
4) Stop Task
5) Clear Task
I need to keep all this going in some sort of loop as well until the end of the experiment, thoughts?
What does the DAQmx trigger.vi do? Because that's what I've been trying for the longest time to use and it hasn't been working.
As you can see I have two loops there, I was trying to make the vi continuous so that it could receive multiple events from the photon detectors, but what I've done is probably very ugly, is there a better way to set this up?
Lastly, if there are any good resources which EXPLAIN what components are doing and how to use them (I've gone through the help files on all the DAQmx components and they don't have much in depth info), I'm more then willing to do some work and learn how to do things myself, all I need are some good resources.
Thanks to anyone that can help me with this gigantic post, I really appreciate it 🙂
Chris
04-05-2007 03:29 PM
Hello everyone
I'm doing something similar to CJKS and have also been trying to work through this thread to understand DAQmx (with which I have almost no experience). Does anyone know what the best way would be to gate the measurement? Here's a brief explanation of what I am doing, and what I mean by gate:
I'm running two photon detectors into a 6602 board. I want to count the digital pulses generated by these and timestamp each. The problem is that I need to make sure that both counters are counting during the exact same, accurately prespecified interval. I was planning on using a third counter to generate a precisely defined pulse to use as a gate window, thus while the pulse was high the counters would count and timestamp, and as soon as the pulse went low it would stop. In the code above the armtrigger property in the trigger node served nicely to syncronously start both channels counting, but I can't figure out how to make them stop counting when my pulse goes low. I tried inserting a pause trigger in the same property node, but it says I can't use a pause trigger when the task includes a Sample Clock (which I assume is essential to timestamp the pulses, and thus can't be eliminated).
Is there a way to make this work, or another way to accomplish the same thing? I wondered if there was a way, since I'm using the sample clock as a timebase for timestamps, to tell the clock to only count for a certain interval, thus since the counters begin simultaneously with the rising edge of the gate pulse the clocks would simultaneously terminate the task as soon as the time elapsed (since it's a 32 bit counter running at 80MHz, I assume the clock would would be able to give me a window of about 53 seconds before it rolled over and began counting its timebase from zero again). I tried doing this by telling Sample Clock to count Finite Samples, but then I came up with the problem that it said it couldn't allocate memory. Would this accomplish what I'm trying to do, and if so how would I determine the buffer size to give it for say a 2 second gate window?
Any help would be great, thanks
Lee
04-09-2007 01:55 AM