Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronization of analog input and counter input

Hi,

 

I am using a PCIe 6259 board and want to count the TTL pulse from a detector as well as record some driving voltage of the system. Is there a way to synchronize these two inputs? Or a way to put a fixed delay between them so that I can simply shift them offline?

Thank you!

 

Yan

0 Kudos
Message 1 of 4
(7,558 Views)

Hello yanjiang,

 

Thanks for your post!  I see that you need to synchronize your AI and CI tasks. There is a way you can do this and its dependent on the DAQmx Timing function. This will allow you to set a sample rate and source that you want to use. I have to apologize but I use LabVIEW more than VB but please see an image below of how this would be done in LabVIEW. The best way to do this is to use the AI sample clock for both tasks and you can specify this as a parameter on the timing task. Let me know if this helps!

 

Cheers!

 

Corby_B

http://www.ni.com/support 

Message Edited by Corby_B on 10-02-2008 02:17 PM
0 Kudos
Message 2 of 4
(7,544 Views)

Hi Corby,

 

Thanks a lot for your reply. Following your idea, I searched and read some documentation about the sample clocking configuration. I'm now able to synchronize the AI and CI in VB.

However, I realized an issue after all these. My purpose with the counter is actually to binning the pulses, i.e. to count the number of pulses per fixed time like 1ms. We used to use the DAQmxCreateCIFreqChan function and set the measurement time to be 1ms. Whereas now I'm only able to count the accumulated number of pulses at each sample clock edge, which is very memory intensive especially when the number of pulses built up as the acquisition time increases.

Is it possible to synchronize the frequency measurement with the AI?

Thanks!

 

Yan

0 Kudos
Message 3 of 4
(7,511 Views)

Hi Yan,

 

I wouldn't use the DAQmxCreateCIFreqChan as it's meant to measure the frequency of TTL pulses and not necesarilly to simply edge count.

 

If your memory is increasing, I don't believe this is a fault of having a counter application but more of an application architecture. Are you displaying data over time? Logging this data should free up RAM and your first post showed the possibility for post-processing. As far as displaying the count register's change since the last read, simply storing the array of count values and then subtracting the previous count values should do the trick. I'll use LabVIEW's graphical environment to show this idea while I do realize you are coding in VB6.

PBear
NI RF
0 Kudos
Message 4 of 4
(7,502 Views)