LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse width counter measurements causing an error. Could this be a hardware bug?

Solved!
Go to solution

My Daq device is a USB-6341. I am running labview 2015 SP1 version 15.0.1.f7 (32 bit). Windows 7 OS. I am using 4 counters to perform pulse width measurements. I am using 4 independent sources. All 4 are square waves with a 1.5  second period, 50% duty cycle. All 4 Counters are accurately measuring .750 milliseconds pulse widths. Amplitude of waveforms is +4.5 volts referenced to ground.  The problems I am seeing is if I remove one source from counter 0 and reapply it again after 10 seconds (past the timeout of the counter read vi) I notice that counter 1 drops out. Meaning it gets corrupted and gives a very inaccurate measurement for a short period of time until counter 0 starts reading correctly again. This does not happen every time. It may take several tries to see it. I have included a working example of the code I am using. I am assuming that theses counters are independent of each other and one should not affect another one.

Help is greatly appreciated. Thanks.

0 Kudos
Message 1 of 3
(2,196 Views)
Solution
Accepted by BrianSw

Let me make sure I'm understanding you:

 

-You have pulse generator A connected to ctr0 generating 750 ms pulses every 1.5 seconds

-You have pulse generator B connected to ctr1 generating 750 ms pulses every 1.5 seconds

-When both generators are connected, both channels correctly report 750 ms pulse widths continually.

-If you disconnect generator A for >10 seconds, ctr1 (connected to generator B) starts giving you bad data.

-While the signal is disconnected, ctr0 gives you repeated 0 or NaN data (I'm not sure which if it sees no pulses)

-While the signal is disconnected, ctr1 gives you repeated "bad" data

 

If that's right, here are a few thoughts:

-What is the "bad" data? How inaccurate is it? Can you replace your numeric indicators with a plot and show us what happens exactly?

-Check for grounding issues. Both devices must be grounded correctly (and independently) to the DAQ card.

-Can you observe your signals with an oscilloscope? Perhaps your "bad" data is correct, and there is a link you're not seeing in your hardware devices.

-When disconnecting generator A, try grounding the PFI pin you're using instead of leaving it floating. Does the issue persist?

-Does the effect happen to ctr0 if you disconnect ctr1 instead?

 

I suspect an electrical issue here, but without knowing more about your system it's hard to say.

Message 2 of 3
(2,171 Views)
Solution
Accepted by BrianSw

I agree with BertMcMahan's suspicion of an electrical issue.

 

It's been my understanding that NI's multifunction boards typically have all the DGND pins at the terminal block tied together internally.   I've had issues in the past with independent floating 5V differential signals.  It was as though the sources were "fighting" to drive the board's DGND to their own idea of digital (-).  

 

Another consideration is that you're using a USB device and I don't know for sure whether the USB cables ties the DAQ grounds to your PC chassis.  If you're using a laptop with your USB device, your DAQ is likely floating relative to earth ground which may contribute to the odd symptom you've observed.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 3 of 3
(2,163 Views)