Skip to content Skip to navigation

Connexions

You are here: Home » Content » Simple Event Counting VI

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

    • External bookmarks
  • E-mail the author

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • National Instruments

    This module is included in aLens by: National InstrumentsAs a part of collection:"LabVIEW Graphical Programming Course"

    Comments:

    "A full introductory course on programming with LabVIEW."

    Click the "National Instruments" link to see all content affiliated with them.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Simple Event Counting VI

Module by: National Instruments

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 to PFI 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.

Comments, questions, feedback, criticisms?

Send feedback