LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting pulses only during high time of cycle

Hello,

 

I have a VI that controls a spray nozzle, which outputs staggered sprays cyclically. Essentially, there are two pulses: One controls the cycle (high time/low time), and the other controls the frequency of the spray within one cycle's high time. A transistor was used to connect these two pulses, so that the pulse will only trigger during the cycle's high time. I would like to count the number of spray pulses that happen only during the cycle's high time. Initially, I attempted to count the pulses using a digital line, but haven't had much luck. Does anyone have a suggestion on how to implement this? I've attached my VI to this post, and any help would be much appreciated!

 

Thanks,

Michael

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

What hardware are you using? I can't open your file because I haven't put 2018 on my computer yet. But normally this is done by wiring one signal to the gate of a counter (normally the gate keeping signal) and the other to the signal of the counter (normally the thing with the edges you want to count). This is assuming you have NI hardware counters available.

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

Hi majoris,

 

I'm using a USB 6008 DAQ board with a ValveMate 7140 valve spray controller. I've attached an image of my block diagram so you can see what I tried. I thought of using a digital line input and to count the number of rising edges from that input signal, but I'm not quite sure how to put it all together.

 

Thank you!

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

Hi Michael,

 

I'm using a USB 6008 DAQ

The USB6008 supports:

- one (1) counter, this counter is able to count pulses (no gates, no pulse time, no PWM measurements)

- several DIO pins, supporting only software-timing with ~120Hz max sample rate

- several AI pins, with upto 10kS/s sample rate for all channels due to MUX usage

 

Your VI should bring an error as soon as you try to use "ctr1"…

 

Suggestion 1:

- read ctr0 value and an additional DI pin (used for gate signal) at ~25Hz sample rate

- do some post-processing of your measurement data to gate the pulse counting…

 

Suggestion 2:

- use hardware better suited for your task…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,149 Views)

@michaelfriedmn wrote:

Hello,

 

I have a VI that controls a spray nozzle, which outputs staggered sprays cyclically. Essentially, there are two pulses: One controls the cycle (high time/low time), and the other controls the frequency of the spray within one cycle's high time. A transistor was used to connect these two pulses, so that the pulse will only trigger during the cycle's high time. I would like to count the number of spray pulses that happen only during the cycle's high time. Initially, I attempted to count the pulses using a digital line, but haven't had much luck. Does anyone have a suggestion on how to implement this? I've attached my VI to this post, and any help would be much appreciated!

 

Thanks,

Michael


What voltage levels is your system is using for the cycle and spray pulses and transistor output?

 

0xDEAD

 

 

 

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