Showing results for 
Search instead for 
Did you mean: 

problem with counting



I've searched, but havent found. Thats why I would like to ask you guys about the following problem:


I got a NI USB 6211 DAQ hooked up to my Labview. I have a encoder with a slotted disc which is producing a pulse train.

I want to acquire this signal with the counter input of the DAQ. As I need the encoder for acquiring a speed, I want to use the integrated option 'frequency' , 'pulse with' 'two edge separation'or 'period' cause these options will deliver a time signal instead of a edge count signal.


My program is ment for controlling a motor and it works fine (im not an expert as you can see below). The program as shown is without the demanded encoder acquiring DAQ asistant. When I put the DAQ assistant-unit, configured to generate a frequency, on the Blockdiagram the whole program doesnt work anymore. The idea of the program is that it generates a speed signal for a servo amplifier, on base of a few parameters. But with a DAQ assistant configured to generate a frequency, no signal is created. Looks like some things are interfearing or so.



Im aware that both my English and my limited knowledge/experience of labview make this prehaps a hard question. But it would be real kind if someone could share his or her idea, about what could be the cause of the DAQ assistant and my blockdiagram not working together. If neccesairy I can provide more information on request.


already thanks a lot!



0 Kudos
Message 1 of 4


prehaps my question was a bit unclear. If i add the following element to the program above, within the while loop, the program doesnt work anymore. What I mean is that the time of the graph won't start ticking/running and all the other elements don't function aswell.


what am I doing wrong?



this is the element that I have to add, in order to acquire the period of the slotted disc.

Can somebody tell what is going wrong?


thankyou verry much! 🙂

0 Kudos
Message 2 of 4

in found some new things. putting the DAQ assistant in a sub VI doesnt solve anything. I noticed that when the program is started and stoped there are results so the program standing still, untill I restart it, then it updates all the graphs at the frontpanel and is then standing still again.


also putting a "wait untill" didnt improved the situation.


.. anyone prehaps a tinyest clue about whats going on here?

0 Kudos
Message 3 of 4

Dear Martijn,


Thank you so much for your post on our webforum. I think it is best to use the DAQmx VI's instead of the DAQ assistant. Please use a DAQ assistant only when doing a single measurement. I think we are bumping in to some tasks issues here. If I'm correct you want to do

-counter input task

-digital input task

-digital ouput task

-analog output task

I think it is best to implement them one at the time, with the normal DAQmx VI's. The DAQ assistant can help you with this, since you are able to generate DAQmx code from your DAQ assistant configuration; please rightclick on your DAQ assistant express VI and choose generate DAQmx code.

An example from multifunction tasks (in this case a counter output, digital input and digital output) can be found in the example finder (under help);

\examples\DAQmx\Synchronization\Multi-Function.llb\Multi-Function-Synch Dig Read Write With

With this example they are doing some synchronisation, so it is just to give you an idea how it looks like. On important thing to keep in mind is that you can only have running on digital input task (for example) at the time. So you have to read all your digital input in one task. It is the same for other IO tasks.  

So lets start to implement the counter task, see how this works and then implement the second task.

Please let me know if you are bumping into any issues, and it is best to post your code (and also the Labview version (8.6?) you are using.


Best regards,


Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 4 of 4