LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two source buffered counting

I'm working with a buffered counting program that takes the imput from two different sources and displays the counts as a function of time.  The other day I did a test and realized that the time axis for these two counters is not synchronized.  The program was written by a visiting student and basically from files and subvis taken from the labview code sharing.  Basically, its two individual buffered counting programs running in parrallel and their is no connection between the two.  I have tried several things including using the time data from one for both sources and many other simple things.  I'm not very experienced with labview but I'm reading up and it looks like I may need to use a trigger to synchronize the counting.  It would be nice if anybody can help me with this problem?  I'm using the 6602 in traditional NiDaq mode.

Message Edited by Briconn on 01-12-2006 12:54 PM

0 Kudos
Message 1 of 10
(3,143 Views)

You are right you will need a hardware task to synchronize the start of the tasks, if they are started without a trigger they will be started with a software "task start command" and they will be asynchronous and there will be an indeterminate amount of time between the tasks.  Use the daqMX trigger vi to set the source of the trigger (probably a digital edge) and make sure you set both tasks to share the same hardware trigger source (PFI line) you will then be able to send a digital pulse from another counter or even an external TTL pulse to start both tasks.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 10
(3,133 Views)
So, from this I'm thinking I will need another external source with a well defined pulse or TTL like a function generator to start my trigger?  Might there be a way to do it so that I can use the signal from one of my sources to start the trigger for both counting events?  Also, right now the source is going to the buffered counter and also through something that is called a pulse train generator and an internal time base chain, any idea what this is for?  I haven't been able to find this MXdaq trigger.vi though I have found many programs that talk about it, can you point me in the right direction?

Message Edited by Briconn on 01-12-2006 03:30 PM

0 Kudos
Message 3 of 10
(3,117 Views)
You can click on the little magnifying glass on the Functions pallet to search for the DAQmx trigger.vi
0 Kudos
Message 4 of 10
(3,112 Views)
Thanks! I didn't realize it was a vi that is in the functions menu.  So I have to use the sample clock DAQmx to set up my start trigger and then how do I connect all my counting events to this trigger?  Can I use seperate trigger.vi's for each counter and they will each start based on the start trigger?  Also, where do I put the trigger after the source?  after the buffer? 

Sorry I'm such a newb at this labview stuff (... well really at programming in general)
0 Kudos
Message 5 of 10
(3,109 Views)
It depends on what sort of devices you have.  The "Find Examples..." on the help menu will help a lot, I think.  There is an example I found when I searched the examples for "syncronization" called "Multi-Device Synch-Analog Input-Finite Aquisition.vi" that goes through all the different variations on hardware.
0 Kudos
Message 6 of 10
(3,107 Views)
Thanks again.  I've found some useful examples.  I'm having a difficult time understanding the physical channels imputs and how they pertain to my sources.  I'm using two APDs (avalanche photodiodes)... they output a TTL 2.5V (minimum) and count photons.  Right now I can do counting of both apds but the time is not synchronized.  I'm thinking to use one to start a trigger that will synchronize both time vectors.  I have a ton of questions but I'll probably find most of the answers in the help files.  If anybody has any tips though I can sure use em.

-Regards,
Bri
0 Kudos
Message 7 of 10
(3,101 Views)

Hi Bri,

You can find an example code of exactly what you are trying to accomplish with 6602 at http://forums.ni.com/ni/board/message?board.id=170&message.id=161054 . However, this code uses DAQmx driver and in your original posting you mentioned that you have the traditional NI-DAQ driver. In order to be able to use this code you will have to download the DAQmx driver (assuming that your OS is Windows)  from http://digital.ni.com/softlib.nsf/websearch/4c9e45f6ee5c29f98625708900712cbc?opendocument&node=13206.... Given that you are fairly new to LabView, I would strongly suggest using the Daqmx driver rather then the traditional because it's much simpler for programming. Also, if you want to get more info about the 6602 such signal connections you can reference the user manual http://www.ni.com/pdf/manuals/322137b.pdf.

In this example the counters are synchronized using an external source as a trigger by default. However, you can specify to use your onboard clock as source for the start trigger in the "Triggering Parameters" field.  The onboard clock is automatically wired to PFI 2 and PFI 6, so you don't have to make any extra physical connection other then the counter connections. If you do decide to use an external clock then, you will have to wire it to any available PFI lines.

I hope this helps.

Regards,
Natasa
0 Kudos
Message 8 of 10
(3,074 Views)
Hi,

The first link is back to this forum. Not sure thats what you ment to do.  I would love to see the code of this because I've been playing with it and I think I'm almost there but kinda slow going and the example code helps alot.  This is my first time on the forums and everybodies been very helpful.  If you can find that link to the code I'd appreciate it.

-Brian
0 Kudos
Message 9 of 10
(3,063 Views)

Hi Bri,

 

My bad .... i posted the wrong link Smiley Sad

 

The correct link to the example code is http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DC9F56A4E034080020E74861&p_....

 

Sorry about that, I didn't realize my error until I posted the response.

Regards,
Natasa
0 Kudos
Message 10 of 10
(3,058 Views)