Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Event Counting Output

Hi, I'm using the PCI-6602 card to acquire simple photon counting measurements on 3 separate channels in Labview 7.0. I'd like to output this data into three separate files. I've been going through the examples listed under HardwareIO>>traditionalDAQ>>Counters>>Ti-TIO, but can't seem to find an example that shows how to acquire on 3 separate channels. also, i've tried adding my own code to some of the examples to have a file output, but each time I only get the header outputted or all zeroes where my counts should be. I'm kind of at my wits end, so any help would be greatly appreciated.

Thanks,
Kate
0 Kudos
Message 1 of 8
(4,183 Views)
Hello Kate,

From the information you�ve provided, it sounds like you need to a 3-channel counting application. With the NI-TIO chip on the 6602 board, the counters must be treated separately in your VI. Basically, the counter VIs must be duplicated for each counter channel. This Knowledge Base gives more details on why this is necessary:

http://digital.ni.com/public.nsf/websearch/862567530005F09C86256747006C64D1?OpenDocument

I�m not certain of how you would like the acquired data written to a file, but one way to do this might be to create an array from your 3 acquired count values (using a Build Array VI), then inputting this to a Write Spreadsheet File VI (located in the File I/O function palette). This VI will convert your data to string format and wr
ite that string to a file. This file can then be opened in Excel or in any text editor program.

Hope this helps. Please let me know if I need to clarify anything or if you have any other questions.

Ken S.
National Instruments
0 Kudos
Message 2 of 8
(4,182 Views)
I keep getting a 10401 error when i try running two counters at the same time. I placed two Count Edges VI's in one program and ran it, with two different sources. It will still run, but only my first channel will output data. The second channel will output headers only. Any ideas?

Thanks,
Katie
0 Kudos
Message 3 of 8
(4,183 Views)
Hello Kate,

Would you mind posting your code? Then I can see better what is happening in your VI.

Thanks,
Ken S.
National Instruments
0 Kudos
Message 4 of 8
(4,182 Views)
I'm tryint to modify a VI called Buffered_Event_Counting_(8).VI (vi is attachted). Another Labview guy told me that this would be a good way to do what I want to do. Unfortuanely, my binary data all looks the same and every other time I get a bunch of errors (then all the binary data resets itself to 0 and the next time will run again).

Thanks.
0 Kudos
Message 5 of 8
(4,183 Views)
Hello,

I looked at your VI and couldn�t really see anything wrong. So let�s start out simple and go from there. I�ve attached a VI which I�ve modified from the �Count Edges (NI-TIO)� example that is installed with Labview; I chose this example because it is the simplest event counting example. I�ve modified this example to use two counters instead of one without For loops or start triggers. Basically I just duplicated the existing code and set the counter number to a different counter.

Note that you may have to change some of the settings on your front panel to accommodate your application (like the device number, source specifications, etc.). To stop the VI you'll also have to click both Stop buttons.

If this ex
ample works then we can go from there and build it up to better suit your application.

Let me know how this one runs. Have a great day!

Ken S.
National Instruments
0 Kudos
Message 6 of 8
(4,182 Views)
Yay, that worked great and I easily made it work for 3 channels. Now, I have one last question, and that is how can I output the data to one file? Right now, I'm outputting to three separate files (each one inside each counter's loop).

Thanks a bunch!
Katie
0 Kudos
Message 7 of 8
(4,183 Views)
Hello Katie,

For the file I/O it kind of depends on how you want to store the data. I�ve attached an example of a couple of different ways you could do this.

Hope this helps! Let me know if there�s anything I can help with or clarify.

Ken S.
National Instruments
0 Kudos
Message 8 of 8
(4,183 Views)