LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Some problems with counters in DAQ

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.

0 Kudos
Message 1 of 7
(2,851 Views)

Hi Rogal,

you are probably making some programming error.

If you configure two tasks seprately, it should work fine.

 

BR,

0 Kudos
Message 2 of 7
(2,832 Views)

Could you take a look on my code?

This is only one part responsible for data acquisition.

0 Kudos
Message 3 of 7
(2,830 Views)

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,

0 Kudos
Message 4 of 7
(2,817 Views)

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. 

0 Kudos
Message 5 of 7
(2,806 Views)

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.

0 Kudos
Message 6 of 7
(2,802 Views)

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:

ForumDAQ.png

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

 

Piotr Kruczkowski
Certified TestStand Architect
Certified LabVIEW Architect
0 Kudos
Message 7 of 7
(2,783 Views)