LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter operations Traditional DAQ to DAQmx conversion

I am in the process of converting a LabVIEW 6 application to LabVIEW 2012. I am at a sticking point when it comes to certain Counter operations. In partictular, converting operations accomplished through the LabVIEW 6 vi "Counter Set Attribute.vi". In the attachment you can see the operation I can not seem to replicate is an attribute of "Gate Selection" with a value of "Other Counter Output".

 

I have read the white paper http://www.ni.com/white-paper/3021/en (Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy)) as well as "Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW" located at http://www.ni.com/white-paper/4342/en but neither of them address my specific issue.

 

I have found references saying that a Counter Channel Property Node will provide equivalent propertys as found in "Counter Set Attribute.vi" but I cannot see it.

 

Any help is appreciated. Thank you.

0 Kudos
Message 1 of 6
(2,489 Views)

MikeW_MikeW,

 

You are correct that you can set attributes of a counter task with a DAQmx Channel Property Node. However, I am not sure that it is necessary to do that with your application. Based on the code you sent over, it looks like you were trying to do a Frequency Task with 2 counters, where one is gated by another. You may be doing this either to account for High Frequencies or to give yourself the largest range possible. Please confirm if this is correct. If so, the following example takes care of the appropriate attributes for performing a frequency task with two counters:

 

Finite Buffered Measurement of Digital Frequency Using Two Counters in DAQmx

 

If this is not what you are looking for, please describe what you are looking for your code to do and exactly what HW you are using. I am sure that there will be a relatively simple solution for your project. I also encourage you to check out the examples in the NI Example Finder, as they may prove to suit your needs out of the box.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(2,453 Views)

I am using a PXI-6281 Multifunction DAQ. Attached is a sample output of what I am after.

0 Kudos
Message 3 of 6
(2,435 Views)

MikeW_MikeW,

 

What frequencies are the two input signals?

Is their frequency and pulse width constant or varied?

Are they coming from your 6281 (reserving PFI lines) or are they routed from some other device?

Will this be a finite or continuous task?

 

After I get this information, I will have sufficient information to set up this task.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(2,416 Views)

Jason M.

 

Thank you for your response. Here are the details:

 

The counter frequencies could be any combination of the following frequencies depending on user action:

 

  • Counter 1
    • 4550 Hz
    • 5525 Hz

 

  • Counter 2
    • 21.5 Hz
    • 15.3 Hz
    • 10.1 Hz
    • 6.83 Hz
    • 4.5 Hz
    • 3 Hz
    • 0 Hz

 

Frequency and pulse width will remain constant after the user selects a combination of counter 1 frequency and counter 2 frequency.

 

The source is from the PXI- 6281 reserved PFI lines.

 

This will be a continuous task until the user selects a new counter frequency combination.

 

Thank you for your effort.

 

Mike_W

0 Kudos
Message 5 of 6
(2,387 Views)

Are you supposed to have an integer number of periods of counter 1 during the high time of counter 2?  If so, you're probably looking to configure a 'pause trigger'--use counter 2 as the pause trigger for counter 1.  However, you might want to check those frequencies (also keep in mind that the counter output is derived from an 80 MHz timebase).  It might make more sense to specify counter 2 in terms of time rather than frequency (i.e. make the high time equal to the exact number of periods of counter 1 that you want, then make the low time as close as you can to get the desired frequency).

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 6
(2,377 Views)