Showing results for 
Search instead for 
Did you mean: 

Simple event counting problem with example in LabVIEW Basics I course using pci 6229 m series DAQ card


I have the LabVIEW Basics self paced learning kit and am working through the examples etc.

Exercise 7.6 Simple Event Counting seems straight forward enough and using the Signal Accessory I can get the quadrature encoder to be counted using the DAQ assistant. Turning the knob on the encoder in either direction then increases the displayed "count". A further part of the exercise has the properties of the DAQ chaged in order to have the count direction externally controlled. This, apparently without any further changes, enable the encoder to increase counting clockwise and decrease anti-clockwise. However it does not work in my application - it simply goes down much in the same way as if I had chosen "count down".

I am using the pci 6229 m series card and notice that on the Signal Accessory mention is made to E series devices. Does the LabVIEW basics course documentation hold for m series cards? Am I doing some really silly? Does my card nee checking?

Any help would be appreciated.


0 Kudos
Message 1 of 6

RE: Does the LabVIEW basics course documentation hold for m series cards?

Thank you for posting your question on the NI forum. The documentaion does indeed hold true for the m-series cards. i.e. yes! It should work for m-series cards.

Kind Regards,

Applications Engineer
0 Kudos
Message 2 of 6
Hello and thanks for replying,

If the answer is yes than why does the example always count down regardless of the direction I turn the encoder when the Basics course documentation says it will count down one way and up the other? Has the documentation missed something fundamental out? Or have I?


0 Kudos
Message 3 of 6
I believe the documentation is missing something. On E Series devices, the hardware-controlled up/down pin is DIO6 for counter 0. The MIO demo box has one of the quadrature encoder lines connected to this input internally (there is no external connection for this). On M Series devices, the hardware-controlled up/down can be selected as any PFI line which, although it means the M Series devices have more functionality than E Series devices, unfortunately means it won't work exact the same was as described in that example for E Series devices. I haven't tried it yet, but you should be able to select the source of your count direction terminal (using the channel property node->Counter Input->Count Edges->Count Direction->Terminal) and then wire to one of the other inputs in the Demo Box.

I hope this helps!
0 Kudos
Message 4 of 6

Many thanks for your reply and for verifying that there is a problem with the documentation. Your description as to how to get round the problem was understandable but unfortunately the DAQ assistant does not seem up to it (see below).

There are two problems I have found with all this.

1) As discussed the documentation AND signal accessory device both refer to E series cards. The example is not brilliant even for E series cards because it relies on internal connections which present the solution as somewhat ready-made. This is particularly a problem when using DAQ assistant (see problem 2)

2) The example I was working through on the Basics course used the DAQ assistant. When setting up the counting in the "Edge Count Setup" the count direction can be set to "externally controlled", however there is nowhere to tell it WHERE this external control is. This seems plainly wrong.

Given that I cannot specify where the external control is from the DAQ assistant do I need, to get this example working, to ditch the DAQ assistant approach altogether? If so the current example is worthless! In this case what would I need to do it from scratch?


0 Kudos
Message 5 of 6
Hello again,

Just to add I may have found the solution myself.

Using the "Count Digital Events -" I have worked out that the DAQmx create can be adapted to include CI.CountEdges.DirTerm (being the terminal where direction is given)in the DAQmx channel property node. This will mean I'll have to create my own DAQmx create in order to put in the terminal name. Is this the right way to go about it? Is the DAQ assistant of no use with this example and the M series pci 6229 card?


0 Kudos
Message 6 of 6