LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use two counters simultaneously for pulse width measurment

Solved!
Go to solution

Hi John

 

I don't know whether you have used NI 9401 together with the cDAQ 9171. When I use two counters togehter, it seems there is an interference between the two counters. When I only generate the pulse to ctr0, the result sometimes is also shown in ctr1. Have you met this problem?

 

Cheers

Daisy

0 Kudos
Message 21 of 38
(1,053 Views)

Hi Daisy,

 

The indicators on the front panel are in an array where element N in the array corresponds to the most recent sample measured from counter N  (I'm assuming you're only shooting 1 bullet through the gate at a time so you just are interested in the most current reading).  If one of the counters isn't connected, that particular array element shouldn't update (the read from the disconnected counter should result in error -200284 which the software is handling by not inserting anything into the array for the disconnected counter).  

 

I have used a 9401 with a 9171 but it's been a while (at least a year) and I don't have any cDAQ systems available to me currently.  I can't think of any reason that the signal on channel x would be affect channel y unless there is some sort of external wiring issue (e.g. floating COM relative to the ground of your sensors perhaps?).

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 22 of 38
(1,034 Views)

Hi John

 

Thank you for your great help! My system can work well now!

 

Cheers

Daisy

0 Kudos
Message 23 of 38
(1,011 Views)

Hi John

 

I meet some problem about the counters. Previously, I'd like to separate two counters and let them work individually. However, the problem is that there is some noise from the surrounding. Is it possible to limit the number of measurement, i.e.. Only record 1 measurement value from each channel? It might be simple to implement but is difficult to me. Could you please give me some advice?

 

Cheers

 

Daisy

0 Kudos
Message 24 of 38
(994 Views)

Sure, see the attached VI (I just made a small change to the old VI I posted, there are other ways to go about doing this same thing of course).  You could add reset buttons or something to re-arm the counters but as it is right now you would have to restart the program to take a new measurement.

 

You might want to address your noise issue anyway if it is affecting measurement accuracy.  

 

 

Best Regards,

John Passiak
0 Kudos
Message 25 of 38
(986 Views)

Thank you John for your quick reply!

 

I just wonder whether the modified system can take one measurement from each channel. That is to say the system will pause if there is one data from channel 1 and the other data from channel 2.

 

Also, I also find there is some problem in the previous model. I set a start button to begin writing data to file. However, it seems the buffer can save the data which are obtained before I click the start button and show these data to my file. How can I do if I only save the data after I click the start button?

 

Cheers

 

Daisy

0 Kudos
Message 26 of 38
(978 Views)

I see you updated to LV 2012.

 

I'm still on 2011 though.  If there's something in that VI you want me to see you'll have to save it for 2011 or post a screenshot.

 

You could just start the task when you press the start button, no?  From my understanding though you are measuring some sort of projectile--if you're getting triggers that don't correspond to an actual projectile you need to fix your hardware setup.

 

 

Best Regards,

John Passiak
0 Kudos
Message 27 of 38
(976 Views)

Hi John

 

I should notice the version. I attachs the 2011 version copy. I suppose if I want to recode data after the I press start button, I need to move the control to another place.

 

Cheers

Daisy

 

0 Kudos
Message 28 of 38
(969 Views)

Your attachment is still LV 2012.

 

You can save it as another version by using File >> Save for Previous Version.

 

 

Best Regards,

John Passiak
0 Kudos
Message 29 of 38
(961 Views)

Sorry John

 

Hope this VI can work.

 

Cheers

Daisy

0 Kudos
Message 30 of 38
(954 Views)