LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I Want to synchronise event count from both counters (PCI-MIO 16 E board)

Hi,
I have found SO MANY people asking variants of my question but noone has answered it to my satisfaction so i am going to post it myself and REALLY hope that i get a quick reply.

1. is it AFTER ALL possible to SYNCHRONOUSLY start event counting [ say TTL pulses coming from 2 PMTs at same/different frequencies] using the 2 counters of traditional STC DAQ board using any of the features like FOUT,DIO,gating using AO...or whatever.

2. if yes then PLEASE help me and tell me how do it...and if someone has an example VI of synchronously starting both counters and counting TTL pulses in bins of 10 microseconds... i am gonna give him/her all my blessings.

3.if NO !:( then what is the best sh
ot i got ?

please all the gurus of Labview...and the application engg. PLEASE help.
gvs
0 Kudos
Message 1 of 13
(3,580 Views)
Hi gvs,

I think I have a solution for you. Let me know if I understand your application correctly. You would like to count edges on 2 counters that start at the same time. You would like to store the current count every 10us.

If this is the case, you would generate a 10us clock on pin fout. Fout is the frequency generator on the E Series cards. You could use the Counter Control.vi with "enable FOUT" as the action and set the Fout data using the bottom terminal. You would then setup your other 2 counters for buffered event counting. You would connect your Fout pin to both gates of your counters. The main idea is to start both your "counting" counters and then after they are configured and ready, you would start your Fout frequency generator. The si
gnal would go high enabling both counters simultaneously (at most 1 clock cycle off).

If you want your count to reset after each gate signal then you would set your application to buffered period measurement. There are shipping examples to perform both event counting and period measurement, you would just need to adapt them for two counters and add the Fout call after configuration of your 2 counters.

Hope that helps. Have a good day.

Ron
Applications Engineer
National Instruments
0 Kudos
Message 2 of 13
(3,580 Views)
thanks ron
I tried that but cudnt get it work.i guess i havent used counters extensivley so not able to do exactly what you said. can you help mwe with VIs which do the same ?
gvs
0 Kudos
Message 3 of 13
(3,580 Views)
hi
well i tried what ever i cud and here is the VI i made and it is NOT working.
can you help? please.
gvs
0 Kudos
Message 4 of 13
(3,580 Views)
Hi gvs,

I created an example program that might do the trick. Let me know how it works for you.

You should connect the Fout pin to both default gate pins. I used the internal 20MHz as my source.

Ron
0 Kudos
Message 5 of 13
(3,580 Views)
Dear Ron
thanks for the program
but i can run only labview 6.1...and i think you have made the program in version 7.
My labview refuses for it to open.Can u please convert this program to version 5 or 6 ?

Gvs
0 Kudos
Message 6 of 13
(3,580 Views)
Hope this works. I saved it in LabVIEW 6.1.

Ron
0 Kudos
Message 7 of 13
(3,580 Views)
Dear Ron,

Thanks for your patience and reply.
I tried you VI.
I connected FREQOUT to pin pin4 and pin9 [ default gates for the 2 counters on my board ]
I connected pin 3 and 8 [ default counters sources ] to USER1 and USER2.
then from a function generator 2 BNC to both the USER1 and USER2 inputs.

So now when i start the Vi i get the following error..

Error - 10920 occured at Counter Read Buffer.

Possible reasons:
NI-DAQ LV: One or more data points may have been lost during buffer GPCTR operations due to speed limitations of your system.

I am using a 900mHz comouter with 256 MB RAM.

I dont think i have a speed limitation. I think this program is doing something funny.
i played around with " c
ounts to read" and "internal buffer size" but to no use. it always gives the same result.

Please help me out.
thanks in advance...

gvs
0 Kudos
Message 8 of 13
(3,580 Views)
Hi GVS,

That error indicates you could be losing data because of the speed of your bus. If your frequency generator on FOUT is greater than 100kHz you might be going to quickly for your current transfer method.

Try setting your FOUT to be the slowest possible value it can be. This will help us debug your situation. If it works, then we will have to find a workaround.

One possible solution is to make sure your counters are automatically using DMA transfer. You can do this using a Set DAQ Device Info.vi and specifying that both counters (use one for each of your two counter tasks) use DMA transfer. This will be your quickest transfer method. It is also important that you try and limit the
amount of other data that is being transferred to memory. Try closing down all programs but your program. Hopefully that will help the situation.

Ron
0 Kudos
Message 9 of 13
(3,580 Views)
Dear Ron

thanks for your reply and patience.
but this is still not working. let me tell you how i am doing it then u tell me if there is something wrong i am doing while testing your vi.

with wires i have connected FREQOUT to the gates of GPCTR0 and 1 and their sources to USER1 and 2.

I have function generator DS345 from Stanford research and i generate 1KHz or 1MHz TTL pulse and using a 'T' give the same output of the function generator to USER1 and 2.

now in the VI...

for both counter i have
Source selection as internal timebase = 100kHz
and Gate specification as PFI line = default

for your info I am sending the jpg of the front and diagram panel of my vi.

y
ou can see that i have also used the set DAQ info.vi and have asked it to use the DMA.
I also disabled ALL other programs running in the back ground including norton and taskmanager.

the program shows same error
10920 and 10846

that is essentially the same error it gave last time.

I would greatly appreciate if you help me solve this problem.

regards
gvs

ps: there are a few more things...

1. If i give top counter as 1 and bottom as 0, the program works but if i give the top 0 and bottom 1 then the program gives 10008 error saying that the group is invalid !!? can u guess why ?

2. in ur reply u suggested that "Try setting your FOUT to be the slowest possible value it can be. This will help us debug your situation"..how do i do that ?
Download All
0 Kudos
Message 10 of 13
(3,580 Views)