LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

4 counter input & 6 signal input HELP

Solved!
Go to solution

Hello Friends,

 

I have a little problem, would be great if someone can help me.

I am using the counter inputs on my Data Acq. Harware to measure the pulse width of my input sigal.

 

Since the hardware has only 4 counter inputs I can connect 4 channels, but I want to measure pulse width for 6 channels.

Is there a way to use the available 4 counters and measure all of the 6 channels?

 

Thank you

Regards,

Raj

0 Kudos
Message 1 of 4
(2,607 Views)

If it meets your requirements you could just connect all 6 channels but only read from (up to) 4 at a time.  Here is an example using just 1 counter:

 

Multi_Channel_Pulse_Width_Measurement.png

 

 

If the measurements actually need to be taken simultaneously then you'll need to either use a digital input task or get new hardware.

 

 

Best Regards,

John Passiak
Message 2 of 4
(2,582 Views)

Hi John,

 

Thank you for your reply.

 

I am trying to measure the pulse width continously from my 6 inputs. And the signal on my 6 inputs gets high once in every 10 sec and the pulse width is between (2ms-10ms).

But all the signals are out of phase, meaning that at a moment only one signal is high.

 

In the example VI from you, if the signal on my first input is zero then all the other inputs are also zero, even if there is a signals on the other.

 

Can you maybe help if there is a way to measure 6 input pulse width continously, and the VI gives me the data from that pulse which is high at a moment. (Since they are coming out of phase always - 1 input high and 5 low at a time).

 

Thank you,

Kind Regards,

Raj

0 Kudos
Message 3 of 4
(2,561 Views)
Solution
Accepted by topic author Raj_Raj

In my (very basic) example, you could just increase the timeout to ~10+ seconds to ensure you acquire the pulse.  If it's possible that the pulse isn't present within the ~10+ second timeout you would also need to handle the timeout error so it doesn't wrap back around through the shift register and prevent the future reads from executing.

 

The downside to this of course is that it could take up to ~60+ seconds to acquire from all 6 channels in the worst case scenario.  The example was really just intended to show how one might use a single counter to acquire from multiple channels in succession.

 

The better way to do it with counters would be to run (up to) 4 counter tasks in parallel.  The first 2 tasks to finish with their original acquisition should then measure a second channel.  This could still take ~20 seconds if none of the signals are connected however.

 

 

If you want to trade a lower measurement resolution (and more memory usage) for a lower upper-bound on measurement time you could instead acquire a 10 second window of time using clocked digital inputs and use software to determine the pulse duration by parsing the acquired array.

 

 

 

Best Regards,

John Passiak
Message 4 of 4
(2,516 Views)