LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting cycles

Hello

I am using labview and an HP34970a to collect data from a 6 station pump life cycle test stand. I am only collecting data when a pump is running. I am detecting this by looking at the motor power draw. The cycle is 3 minutes on and 1 minute off. I want to count the number of on/off cycles of each pump and display them on the labview front panel. The problem I have encountered is, each time through the loop, if the power is above 100 watts (threshold I start collecting data), I increment the counter. I am sampling every 30 seconds, so within the 3 minute "on" span I have counted 6 instead of 1. I do not log any data when the pump is off.

Thanks

Everett
0 Kudos
Message 1 of 6
(3,624 Views)
You need to increment your count only once when the motor goes from off to on. To do this, create a shift register in your loop where you monitor the motor state. Initialized the shift register to false. I am assuming that whatever you use to poll the motor state puts out a boolean True for motor on and False for motor off. Now wire the motor state boolean to an AND gate and to the right shift register. Wire the left shift register through a NOT gate and into the other input of the AND gate. Wire the output of the AND to the case structure that increments the counter. The output of the AND will be True when the left shift register is False and the motor state is True. This will increment the count. On the next loop iteration, the shift register will be True and the AND output will be False. The count will not increment. See attached vi for an example.
- tbob

Inventor of the WORM Global
Message 2 of 6
(3,618 Views)
Works well, thanks!
0 Kudos
Message 3 of 6
(3,595 Views)

I am having an issue with counting cycles similar to this. I can't open the example, I have 7.0.

Anyway, I'm using Booloean cycles to switch an Iotech DBK-25 (8 channel output card through a DaqLab 2005). I create a boolean array that is converted to a 32 bit word (I think) to switch the card. My problem is I want to count cycles indivitually on each channel, but when more than one channel is active (at diverent rates) the counters count off, even though the timing for the individual channels is in different while loops. I've tried a few differnt ways to count cycles, using 'increment', but then I get a continues counting in the 'true' state.

I guess it would probably easier to look at the program, its quiet a mess; I’m still working on it....

 

 

Any suggestions???

 

0 Kudos
Message 4 of 6
(3,450 Views)
Bdel:

I tried opening your example, however it is missing the following VIs:

- Acquire Initialize.vi
- Basic Trigger Configuration.vi
- Acquire Scan Configuration.vi
- Acquisition Arm.vi
- Acquisition read Scan.vi
- Acquisition Close.vi
- DaqLab 2005 Analog Input Channel Configuration.vi

Thanks,

Rudi N.
Applications Engineer
0 Kudos
Message 5 of 6
(3,423 Views)
Here is a picture of my block diagram:  The True case has an increment function in it.
 

Message Edited by tbob on 10-05-2006 05:36 PM

Message Edited by tbob on 10-05-2006 05:37 PM

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 6
(3,421 Views)