11-27-2012 08:08 AM
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
11-27-2012 03:36 PM - edited 11-27-2012 03:52 PM
@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
11-28-2012 03:20 PM
I lost at this step (see the attachment) , where do i have to link the select exit?
Thanks
11-28-2012 04:39 PM
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
11-29-2012 03:40 AM - edited 11-29-2012 03:47 AM
slightly modified....
11-29-2012 05:52 PM
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.