12-12-2011 05:02 AM
I have a problem.
I would like to use two counters in my VI.
I would like to use first to count edges. And second one to measure frequency. Separately it works fine. I do not know how to use two counters at the same time. Always only one counter works. I was trying to connect signal to every input, without any success.
Does anybody know how to make it works?
My DAQ device is USB-6210.
I would appreciate any help.
Regards.
12-13-2011 02:20 AM
Hi Rogal,
you are probably making some programming error.
If you configure two tasks seprately, it should work fine.
BR,
12-13-2011 02:45 AM
Could you take a look on my code?
This is only one part responsible for data acquisition.
12-14-2011 07:46 AM
Hi Rogal,
it should work properly, however you need to put some timing inside your loop. It is now running as fast as possible which is not healthy.
Also, have a look at the configuration of the counter tasks (for exmple it is possible to configure counter task that uses two counters).
If it is still not working try putting just two DAQ Assistants in a loop and see whether it works like that.
BR,
12-15-2011 12:22 AM - edited 12-15-2011 12:22 AM
With two DAQ Assistant it works fine. But I tried to do it in this way because I didn't know how to reset counter with DAQ Assistant.
12-15-2011 01:30 AM - edited 12-15-2011 01:39 AM
What I did:
First counter which I have to reset I left without any changes. For second one I used DAQ Assistant and now it works fine.
But I still have some problems with timeout. For every DAQ channel I set timeout 0,02. But when I set this value of timeout to DAQ Assistant I get error that timeout expired. When I set greater timeout my while loop works very slow and I can't get smooth reading from the counter.
How can I fix it?
Thank you for your help.
12-19-2011 02:57 AM
Hello Rogal,
Some tips for DAQ:
1. Try to seperate your measurements into different loops if the don't have to by synchronized. I'm getting the idea that you do not have to synchronize your measurements from the fact that you are not using standardsynch. techniques in your code.
2. Specify timing for your tasks. Now your measurement is done using software timing and this solution is highly dependant on Windows. Try to do it like this:
When you specify clock for a task like that, you won't have to specify loop timing, your measurement will execute based on hardware clockand the timout value will be more meaningful.
Fisrts thing to remember, is to develop (especially in the beggining) your application in steps. Write some code (ex. one measurement) and test it out. You can even test it on simulated devices, but it is cruicial to expand the functionality in small steps and not in big leaps.
I hope that helps, Peter