06-03-2011 07:40 AM
Hello guys,
I'm implementing an application using counter timers.
I created a Vi that read a counter from a sensor of water ( each liter give me an impulse), and I use it to analyze the partial and total consumption of water in the laboratory.
I wants to create a front panel that the customer can observe the current consumption of water ( last 24 hours) ( last 7 days ) and ( total ).
I can read correctly for a partial last 24 hours and reset the indicator correctly after 24 hours, but I can't do the same thing with indicator of after 7 days because when reset the indicator of partial 1 ( last 24 hours) is resetted also the indicator partial 2 ... while the total indicator is ok..
Do you have any ideas to solve this problem,. any suggest are precious for me..
P.s I think a good workaround is to use another counter timers to acquire the same impulse and use the same programm, but i think there is a tip to solve this problem by programm
Thanks in advance
Dave
Solved! Go to Solution.
06-06-2011 03:08 PM
Good Evening
Can someone give me a suggest to solve this problem, i trying to developing the Vi, but i can't find the solution..
I need to use another shift register with a case structor to reset the total indicator ? or there is a simple tip?
thanks who wants to help me
Dave
06-06-2011 03:14 PM
Hi,
Can you downconvert your vi into 2009 and upload it. Then I can take a look now.
Regards,
Nitzz
(Kudos are always Welcome;))
06-06-2011 03:53 PM - edited 06-06-2011 03:54 PM
Hi,
If you debug your code, you will see the following in your lower True/False case
- When it's true you are changing Partial2 to zero.
- When it's false you are changing Partial2=Partial1 but JUST after change Partial1 to zero (that's in your upper True/False cycle).
Basically you will see in Partial2 the value of Value1 or Zero. You need to change your code to add to the value of Partial2.
Best Regards,
Jorge N.
PD: "Quotient & Remainder" function and "Select" functions are not doing anything in your code
06-06-2011 04:06 PM
Hi Nitzz
Thanks for your precious help.. here below i attached the VI with a partial and total counter..
I ask you only an advice how to reset the total counter after 30 second because the partial counter is ok ( is able to reset after 10 seconds ) while the loop is running..
thanks again for any suggest you can give me.. 🙂
Dave
06-07-2011 12:21 AM
Hi,
I still couldn't run your vi as I don't have the necessary tool kits:) but i guess i figured out what was wrong with the code. I have edited your second code a bit and have attached here. Have a look. The explanations are also included in the block diagram so that you can understand the concept well.
Regards,
Nitzz
(Give kudos to good Answers, Mark it as a solution if your problem is Solved;))
06-07-2011 12:42 PM
Hello Nitzz
I read your code..it's so similar as "C code concept " first istruction is reset partial and second istruction reset total keeping the shift register the same..
Thank you very much for you big help and your precious explanation..
you'll have a good Kudos..
Good Evening
Dave