LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI DAQ Assistant Express

Hi,

 

I am using NI DAQ assistant express to get my 4 rotating fan counter values. I am using USB 6501 device therefore i have only one counter input. I set my fan turn on continuously and measure the counter value one at a time for 1s each. I assign a For loop to get the counter value for each fan. However i can't get the actual value for my counter. I stop the DAQ Assistant Express every time i used. But something goes wrong. From the picture below, there are four loops, each loop have one DAQ assistant express with data output. The data output is to control the multiplexer to select fan1, 2, 3 or 4 at a time. Iteration 1, fan 1 selected, for iteration 2, fan 2 selected and so on..I don't know anything goes wrong. Please help!!! Thank you.

Capture.JPG

0 Kudos
Message 1 of 5
(2,995 Views)

A few things:

Your flat sequences are unnecessary. You already have data dependency through the error cluster so you don't need the sequences.

The blue dynamic data wire that DAQ Assistant spits out is difficult to work with.

 

Which part is going wrong? Are you sure your digitals are setting to select your MUX? What are you actually getting in your counter indicators when reading the dynamic data?

 

EDIT: I'm pretty sure you don't need those while loops around the DAQ Assistant either.

0 Kudos
Message 2 of 5
(2,978 Views)

Hi Takki1999,

 

Yes, the digital setting is used to select MUX. USB6501 Digital input 20(Select 1), 21(Select 2) and 22(Common output of MUX) is used to select MUX while Digital output 23 is used to indicate the counter value. I have 4 inputs to select each fan counter value to be taken. Data one 001 will result a counter value of Fan1, 011 will result a counter value of Fan 2, 101 will result a counter value of Fan3 and 111 will result a counter value of Fan4. SInce NI USB6501 has only one counter, so my code using a For loop to select a fan and result the counter value for 1 sec one at a time. 

 

My problem is, without using For Loop, case structure, while loop and sequence structure, i wrote the program to get the counter value of only Fan1 for 1 second, i can get my counter value of around 400++. But this is only limited to only single Fan counter test. When i modified my program to get all 4 fans counter value in sequence by applying For Loop (as shown in the image(Capture.jpg) just now, i can only get the counter value either is 0 or 1. This is my problem. I don't know what's wrong. Issit because i stop my DAQ Assistant in a wrong way?

 

I create another code for my fan counter. Same thing happen. I can only get my counter value of either 0 or 1. This is abnormal as when i test the fan one by one for one second each, each of them give me the almost same value of 400++. Please help to explain. Or there is another better way for my request? Please advise. Thank you.

Capture2.PNG

 

 

0 Kudos
Message 3 of 5
(2,948 Views)

I think you may need to move away from using the DAQ Assistant for the counter. From the DAQ Assistant Help on Counting Edges:

When doing on-demand edge counting, each subsequent read returns the number of edges counted since the counter was started. If you perform multiple reads without first starting the counter, the counter implicitly starts and stops with each Read function/VI call, and the number of counted edges is not cumulative between read calls

 

You may do better by Converting to NI-DAQmx and seeing where the counter is started.

0 Kudos
Message 4 of 5
(2,929 Views)

Hi Taki1999,

 

"the counter implicitly starts and stops with each Read function/VI call, and the number of counted edges is not cumulative between read calls" 

 

Thia is exactly what i need for my project. But the problem is, the counter doesn't stop and keep cummulate for other fan's counter. Eg, fan1 have a counter value of 400, fan2 suppose have around 400 but it gives me a counter value of 900. 

0 Kudos
Message 5 of 5
(2,905 Views)