Hello,
Measuring the elapsed time between two pulse events is also possible with DAQmx. There are several different ways to do this:
1. The easiest way to do this is with the DAQ assistant. This is available from the function palette in Labview. On your function palette, go to �All Functions >> NI Measurements >> DAQmx � Data Acquisition�, and here there is a VI called �DAQ Assistant�. This is an express VI so it has a GUI-based configuration dialog that will custom configure a DAQ task for you. In this GUI you would choose �Counter Input�. From here you will be presented with a menu asking you to choose the type of counter measurement you�d like to make. I�d recommend choosing either �Period Measurement� or �Pulse Measurement�, since this will measure the time between two events on your input line. The GUI dialog will also ask you several other parameters such as which counter to use on your 6052E board, minimum and maximum time values for the measurement, and also how you would like to sample the counter (1 time, N times, or continuously). After going through this configuration, DAQ Assistant will generate code for you to accomplish this task. At this time the DAQ assistant will also create inputs and outputs to the VI that are specific to your task. You can also view the generated code by right clicking on the DAQ Assistant VI and choosing �Open Front Panel�. Please note when Opening the Front Panel that the Express VI is converted permanently to a regular subVI, and cannot be converted back to an Express VI (In other words you cannot configure the VI any longer with the GUI).
2. The second method of using DAQmx for counter measurements is to use the DAQmx VIs directly. These VIs are located on the Function Panel in the same location as the DAQ Assistant Express VI. The general process here would be to first create a DAQmx channel and then read data from this DAQmx channel. To create a DAQmx channel, use the �DAQmx Create Virtual Channel� VI. This VI defines what kind of measurement you would like to make, and which physical channel you�d like to use, etc. The measurement task can be changed by left clicking on the label at the bottom of the VI. Clicking this label will pop-up a menu that will allow you to choose between different tasks, such as analog input, analog output, digital I/O, and counter I/O. To make counter measurements of events you would choose either �Counter Input >> Pulse Width� or �Counter Input >> Period�. The VI will add the correct inputs and outputs to match the task type you choose. For instance for Pulse Width measurement, the VI would add inputs for the event edge and minimum/maximum time values. After configuring this VI, you need to add a �DAQmx Read� VI. This VI is also configurable just like the �DAQmx Create Virtual Channel� VI. For counter measurements you can choose to retrieve single or multiple samples from the counter and you can specify what data type these counter values should be. Again, the VI will reconfigure its inputs and outputs based on your choice of task. There are some excellent examples available for DAQmx in the Example Finder in Labview 7.0. These can be found by first opening the NI Example Finder, which can be accessed by going to �Help>>Find Examples� on the menu of any Labview window. When the example finder opens browse to the following location in the tree structure that appears in the middle of the Example Finder window: �Hardware Input and Output >> Counter Measurements >> Period or Pulse Width�. The examples in this area of the Example finder demonstrate how to use the DAQmx VIs for Period and Pulse measurement.
Hope this helps. Please respond back if anything is unclear. Have a great day!
Ken S.
National Instruments