Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

counter gate and DAQmx

Hi,

Does anybody know how to configure E-series counter to work with gate signal in DAQmx ?
What are the  DAQmx functions corresponding to cwcounter.gatemode, cwcounter.gatesource and cwcounter.gatesignal ?
Example code would be very helpful !

thanks,

Thierry

0 Kudos
Message 1 of 5
(8,795 Views)
Hi Thierry-
 
I assume you are looking for a way to pause a counter pulse train generation by an external signal.  I have modified a VB6 NI-DAQmx shipping example to show the three attributes you must set to accomplish this.  A similar configuration is necessary for counter input operations.
 
Hopefully this helps-

Message Edited by Tom W [DE] on 05-22-2006 04:51 PM

Tom W
National Instruments
0 Kudos
Message 2 of 5
(8,791 Views)
Hi Tom,

Thank you for your answer.
The functions used in the example are quite hard to find in the documentation !

In fact  I have a product running with a PCI-6052E and I'm going to move to PCI-6221. So the software has to be adapted to DAQ-mx.

I have already tested the main functionnalities with PCI-6221 and it works fine. (analog in and out, digital in and out)
But i'd like to be able to drive the PCI-6052E under DAQ_mx to keep the compatibility with previous users.

The PCI 6052E has only a very few number of digital ports, and I use some PFI terminals as  inputs.

The PFI port is declared as a gate for the counter. The counter is started. After a while, I read the value of the counter to determine if it has run or not and if the PFI port was high or low. It's a little bit special but it works.

I'd like to do the same thing under DAQ-mx ( or something else if you have a better idea).

(The PCI-6221 has a lot of digital ports and  there is no problem).

best regards


Thierry
0 Kudos
Message 3 of 5
(8,779 Views)

Hi Thierry-

If I understand your application correctly I think my example may point you in the right direction.  It sounds like you want to start a counter, let it run for a while, and based on whether a PFI input is high or low you want the counter to either count or not.  In the case of the pause trigger I suggested you can still read the count value.  If it is 0 then you know that the pause trigger was in the inactive state.  If it is non-zero, you will get the count value you need and will know that the pause trigger is in the active state.

Please let me know if I do not understand your application correctly.  Thanks-

Tom W
National Instruments
0 Kudos
Message 4 of 5
(8,776 Views)
Hi Tom,

Sorry for my late answer, I was out of the office for some days off.
Yes, you perfectly understood  what I want to do in my application.

Thanks,

Thierry
0 Kudos
Message 5 of 5
(8,745 Views)