11-20-2007 10:49 AM
11-21-2007 11:05 AM
Hello Techiess,
I just tested out your application on my M-Series board and
it worked correctly. Both the Pulse
Width and Period measurements only require one counter. When you perform an edge count, the signal
needs to be connected to the source of the counter. However when performing a Pulse Width and
Period measurement, the signal needs to be connected to the gate of the
counter. If a signal is not present on the gate, then your task will timeout.
The best way to get the pinout for your device is through Measurement & Automation Explorer (MAX). Right click on the 6251 under devices and interfaces, then select “Device Pinout.” There will be a new window that pops up with your device pinout. At the bottom of the page is table with the counter default pins. CTR 0 Gate is pin 3 or PFI 9 and CTR 1 Gate is pin 41 or PFI 4.
There are two simple ways to test this setup. The first is to create a task in MAX for either Period or Pulse Width measurement. The task gives you more functionality then the test panels. You can also use a DAQ Assistant in LabVIEW to create the desired measurement. There is a test button at the top of both the task in MAX and the DAQ Assistant, which makes sure your counter is working correctly.
Once the DAQ Assistant is working correctly, you can right click on it and select “Generate NI DAQmx Code.” If you created a task in MAX, you can simulate the code similar to the DAQ Assistant. Place a task constant on the block diagram and select the desired task. Then right click on it and select “Generate Code” >> “Configuration and Example.”