LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter

Ok thanks Jeffrey , yes i'm italian hehe 🙂

 

I need that the array report only one time stamp when the gauge complete 360° lap.

At the moment when the lap end , the array report a series of time stamp because it wait the transaction change.

 

I hope you understand.

 

Thanks

0 Kudos
Message 11 of 16
(677 Views)

@Teo_CF wrote:

Ok thanks Jeffrey , yes i'm italian hehe 🙂

 

I need that the array report only one time stamp when the gauge complete 360° lap.

At the moment when the lap end , the array report a series of time stamp because it wait the transaction change.

 

I hope you understand.

 

Thanks


now i understand...i was able to get your code working, but i need you to do some work and implement it yourself with the hints

 

  • you are currently sampling the times at "lap progress" ANDing "impulse HI",also inserting it into an array and appending it at that time.
  • you need to sample the times and append to that array only at "lap progress" ANDing "impulse HI", otherwise append an empty array.
  • take that sampled array and read the 0 timed element in an index array, with an (array size equals 1) logically AND'd together with ("lap progress" ANDing "impulse HI") to insert that "element" into an array through a select.

portata_14_11_12[1]_FP.png

portata_14_11_12[1]_BD.png

0 Kudos
Message 12 of 16
(662 Views)

I lost at this step (see the attachment) , where do i have to link the select exit?

 

Thanks

0 Kudos
Message 13 of 16
(637 Views)

I was going to post this after lunch yesterday, but noticed that while I was away, Apok posted his suggestions. So I'll do it now....

 

From what I understand, you have a water meter that sends an electric impulse corresponding to each 0.1 liter, and you have simulated this meter with the square wave generator. Your desired "Lap Time" translates to the time to pump each liter through the apparatus.'

 

I have made several modifications to your original VI.  Your original version started the timer shown as "TOTAL TIME" to the left of the dial on the falling edge of the meter's impulse, although you had the counter increment on the rising edge of each impulse. I chose to have everything look for rising edges- but you could reverse the logic to detect the falling edge.

 

I added a Compound Arithmetic function configured as an AND joining the result of the Remainder=0 comparison with the inverted input of the IMPLIES function that you used to identify the rising edge (your case structure to increment the counter also uses negative logic on the output of the IMPLIES by incrementing when it is FALSE). My function replaces the two Boolean AND's to the left of the inner sequence structure which provided input to the case structure of the left-hand panel and reset the timer on the right-hand panel.

 

So.... When the rising edge of an impulse that corresponds to XXX.0 liters having been pumped through the meter, the TRUE case condition of the first pane of the inner sequence structure, which places the elapsed time from the shift register in the array, is performed one time. You may want to identify if this is the time you want to report, as it represents the elapsed time between the first NO IMPULSE of one lap and the last IMPULSE signal of the next.

 

I also used the output of the new Boolean function to reset the timer in the second pane of the sequence structure. This means that the time that put into the shift register array represents the lap time for only one lap.

 

Your original version populated the array for each loop iteration that comprised an entire duty cycle of the meter signal. Mine only stuffs the first one of each lap into the array. Your original version reset the timer at the start of the first "lap" only. I understood that you wanted individual lap times- not the cumulative time since the start of the first "lap."

  

Jeff

Jeffrey Zola
0 Kudos
Message 14 of 16
(627 Views)

slightly modified....

Spoiler
portata_14_11_12.png
0 Kudos
Message 15 of 16
(608 Views)

I solved the problem following the jeffrey zola solution because needed few modify. Thanks also to apok!

 

I'll test the vi with a real signal and than i'll accept it as solution.

 

 

0 Kudos
Message 16 of 16
(574 Views)