11-27-2007 11:40 AM
11-27-2007 07:14 PM
11-28-2007 03:17 AM
Thank you very much for the advice. I will put something together to send this morning, as we are still working on the first stages of this project and there have only been simulations so far.
Alastair
11-28-2007 05:08 AM
Ok, this has taken me by surprise. I have knocked together an example of what I am trying to do. I thought that the excessive use of while loops would cause the relays to operate repeatedly when auto control of VISA write is enabled, but for some reason this .vi works perfectly! Thank you again for your help, and I realise that now things are working I don't need any more help (until the next problem!) but if you have a moment, could you suggest why the relays now operate once when asked rather than as quickly as Labview can switch them?
Sorry for the v8.0 .vi, I am using v8.2 and this is the only older version it will save as. All the gear, no idea. I apologise for my lack of knowledge, but I am a scientist rather than an engineer or programmer!
Thank you,
Alastair
11-28-2007 06:42 AM - edited 11-28-2007 06:46 AM
somebody once said:
"using the abbort button to stop a vi is like stoping a car with a tree. it will work, but there might be consequences". original poster please remind me who it is ![]()
to the point:
- none of your loops includes a stop button.
- there are 2 loops which spins like there is no tomorow: they need a small wait time in there
- the first loop iteration time will be the longest delay time. in your case every pump/mixer should be independant if i understand correctly what you are trying to do (you will loose phase tough. and since you claim the system is working perfectly, i suspect what you intended to do differ from what is observed on the front panel. if you want single timing of all pumps, maybe one single control is enough then).
- since the open/close time in your pumps is in seconds, you might want to write to visa only when there is actual change of state. then simply queue the commands to send out. the whole thing could be set in a single loop.
just my 2 euro cents (worth much more these days
)
11-28-2007 06:45 AM
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.![]()
thats the signature of Ed Dickens i just remembered. but i suspect he asked somebody the right to use it. Ed?
11-28-2007 09:02 AM
Thanks. I appreciate that there are no stops on the loops, but I get so sick of the huge quantity of them accumulating and having to hide them somewhere on the front panel. I have tried before to make a master stop switch with local variables but it doesn't seem to work. I guess there is an easy way but my lack of experience is obviously showing.
You are absolutely right about the sequence structures sharing the while loop, I realised this when demonstrating it to a colleague and have since put them in individual while loops. The seconds timings are just for demonstration. I think the real process will be operating at least the pumps on a roughly hourly basis for a few minutes each time, the mixers will be subject to a wider range of experimentation periods from maybe one minute per hour to permanently on (for which I would by-pass the timing for a switch arrangement).
Your input was certainly worth more than 2 cents,
Many thanks,
Alastair
11-28-2007 09:08 AM
If you used multiple stop buttons, one for each loop, hiding them on the front panel kind of defeats the purpose of having them. ![]()
You only need one stop button. Make copies of a local variable of it to wire into the conditional terminals of the other loops. Because it has local variables, you won't be able to use the latching mechanical action which allows the button to pop back up once it has been read. You will need the switching action. But you can add a final sequence to your code that writes a false to the local variable after all loops have ended so it will appear to behave like a latching button resetting itself once the program ends.
11-28-2007 09:51 AM
That would explain my lack of success. I am still trying to get used to local variables, and most other things in the software.
Thanks again,
Alastair