07-16-2012 01:27 PM
Hi
I am trying to design a program that will allow the user to control the rate,
time, and direction (infusion/withdrawal) of a syringe pump. I have most of my
code already, but it will only work for one step of infusion or withdrawal. I
want to be able to allow the user to run the pump for more than one step. For example, infusion for 1 hour at
say 5g/hr and then run the pump withdrawal for 4 hours at say 2 g/hr. I want to
allow the user to have 10 available steps. If the user does not want all 10
steps than they should be allowed "disable" those steps so that they don't
interfere. I have my VI if you would like to take a look.
Thanks,
Mike
07-16-2012 01:49 PM
Mike,
Please post your VI. Without that we would only be guessing about what you had already tried.
In general terms you may want to make your one step VI a subVI of a larger prgram which handles the multiple steps. Do a search. In the past few days at least two other threads have had questions about how to program a multi-step process similar to yours.
Lynn
07-16-2012 01:59 PM
Here is my VI.
07-16-2012 02:15 PM
Mike227,
Without the pump controller subVIs, it is difficult to tell exactly what is going on.
It looks like you need two things:
1. A means of allowing the user to specify the parameters of each step. See my comment about searching in the earlier post.
2. A loop around the case structure (approximately) to repeat the code for each step. I say apporximately because there may be things inside the case structure you do not need to repeat and there may be things outside which do need to be repeated.
Lynn
07-16-2012 02:43 PM
I cannot find any multi process examples. Can you find a few for me? Could I place a for loop around my case structure then make a control for my iteration count? I could then make 10 different cases if in fact the user wanted to have 10 different steps of infusion and withdrawal.
Attached is my updated VI.
07-16-2012 02:57 PM
Make an array of the clusters of infusion/withdrawl settings and feed that to the loop. I made a quick modification to your VI.
Lynn
07-16-2012 03:01 PM
07-16-2012 03:08 PM
Hey Johnsold,
How do I link both clusters into the loop? New to this...
07-16-2012 03:26 PM
I'll reply to this.
So basically, instead of copy pasting your settings cluster 10 times, he has created an array of clusters which he fed into the loop.
The cluster array is essentially composed of your Infusion Settings and your Withdrawal settings.
On the Front Panel, if you expand the array (it<s in the bottom right corner) and you pull it down, you can reveal many more instances of your settings, just pull it down 10 times.
Now basically, you have your array or clusters, it gets unbundled into two clusters and those individual settigns are fed into the functions you designed.
Now the neat part is that Labview will automaticly grab the first Infusion settings and Withdrawal settnigs on the fisrt loop.
On the second iteration, it will grab the second Infusion settings and Withdrawal settings, and so on.
So all you needed to do now is modify your code and remove all of that junk you had before + expand the arary of clusters and fill it out accordingly.
Here you go!
07-16-2012 06:20 PM
Thanks for providing the explanation.
Lynn