03-11-2018 03:12 AM
Hi,
I'm new to labview and i would greatly appreciate any help that can be given.
Basically, i'm trying to create a countdown/countup timer using elapsed timer vi. However, after using shift registers to store my previous data, i came to realized that my output of the timer isnt the exact speed of 0.05s per iteration and that affects my overall data. I have a feeling is the wrong usage of shift registers but i'm not sure what or how to fix this. Any help please?
Lost student,
Jarrold
03-11-2018 04:19 AM - edited 03-11-2018 04:48 AM
As a new programmer, you are making some beginner mistakes.
03-11-2018 04:27 AM
Hi AltenBach,
i’m developing a syringe pump control that infuse/withdraw liquid according to the timer values.
The missing variables and controls or enum and suchs are all a part of a state machine on a bigger vi. I took the codes out because apparently my timer is faulty as the adding and subtracting parts are incorrect as you mentioned and it would be too much to explain if I attached the whole VI in.
I would just just like the timer to be able to countup (false case) and countdown (true case) from where the timer value was before changing cases and vice versa.
The other parts of the code is written to indicate the volume left in the syringe after each infuse/withdraw
03-11-2018 04:55 AM
@Jarrold wrote:
I would just just like the timer to be able to countup (false case) and countdown (true case) from where the timer value was before changing cases and vice versa.
In real life time always goes forward. You can either indicate the elapsed time for the current state or the remaining time for the current state, but that should not depend on the direction. What should happen if the time has elapsed? What should happen if the syringe is empty or at the full mark?
Shouldn't there be at least three states (infuse, withdraw, pause)?
03-11-2018 05:39 AM
@altenbach
Thank you for tying to help and i do know that there should be conditions that stop the pump when it’s in its different states but I could not seem to find a way to pass down the data of the remaining time during the changing of states. That’s why I tried to create a timer that goes up/down depending on the direction to ensure that the total volume in the pump should change accordingly depending on what’s the remaining volume during the changes from state to state. This timer would be just a part of my “mathematical equation” to help me calculate what’s the actual remaining volume in the pump itself and not the actual calculation for elapsed time because I do have that in placed already.
Is is there a simpler way to save the remaining time and pass it to the next each time I change from infuse/withdraw state and vice versa?
03-11-2018 11:53 AM
The shift register should contain the current syringe volume (from empty to full) and should increment or decrement according to the the direction at a rate that depends on the speed and time.