Saturday, September 25, 2010

Simple Event Counting VI

Summary: In this exercise, the objective is to create a simple event counting VI. Complete the following steps to build a VI that counts pulses from the quadrature encoder on the DAQ Signal Accessory.

EXERCISE 1

1.A) Front Panel

  1. Open a blank VI and build the front panel shown in Figure 1.
    Figure 1
    Figure 1 (counterfp.png)

1.B) Block Diagram

  1. Build the block diagram shown in Figure 2.
    Figure 2
    Figure 2 (counterbd.png)
    DAQAssistantIcon.png Place the DAQ Assistant Express VI, located on the Functions>>Input palette, in a While Loop. Complete the following steps to configure the counter to perform event counting.
    1. Select Counter Input>>Edge Count for the measurement to make.
    2. Select Dev1>>ctr0 for the physical channel.
    3. In the Counter Input Edge Count Task Configuration dialog box that appears, leave the settings as they are. The default settings define the source of the counter as being Programmable Function Input (PFI) 8, which is the default source for counter 0. The DAQ Signal Accessory connects counter 0 source input toPFI 8.
    4. Click the OK button to close the Counter Input Edge Count Task Configuration dialog box. This saves all the settings specified for the task in the DAQ Assistant Express VI.
  2. Save the VI as Simple Event Counting.vi in the C:\Exercises\LabVIEW Basics I directory.
  3. On the DAQ Signal Accessory, wire the A output of the quadrature encoder to the SOURCE input of counter 0.
  4. Run the VI. Rotate the quadrature encoder knob on the DAQ Signal Accessory. Notice that the Number of Events indicator increments as you rotate the knob. The quadrature encoder knob produces pulses as you rotate the knob. The counter counts these pulses.
  5. Stop the VI.
  6. Double-click the DAQ Assistant Express VI, and change the Count Direction pull-down menu to Externally Controlled. Click the OK button to close the configuration dialog box. The DAQ Signal Accessory internally connects phase B of the quadrature encoder to the Up/Down line for counter 0. This can be used to determine the direction the knob has turned.
  7. Run the VI. Rotate the quadrature encoder knob on the DAQ Signal Accessory. Notice that the Number of Events indicator decrements when you rotate the knob clockwise, and increments when you rotate the knob counterclockwise.
  8. Save and close the VI.

Content actions

GIVE FEEDBACK:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Popular Projects

My Blog List

Give support

Give support
Encourage Me through Comments & Followers

Followers