LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Swapping valves when requested

Title: Swapping valves when requested

 

This program is supposed to turn the valves to position 2 ("GO2" in the case structure) then trigger the pump to push all the liquid in, then after all the liquid is finished being pumped, the valves need to switch to position 3, then the closing subvi gets triggered and it waits for user input before closing the whole thing.

 

I am having a lot of trouble getting the valve to turn to position 3 at the end before triggering the closing vi. I suspect its something in the order the loops are going, but I cannot figure out what it is. The program previously turned the valves to 2 and started the pump simultaneously, but that lead to liquid getting to the wrong destination, so I changed it to only start pumping after the program confirms the valves actually reach the requested spot. And even then the ending switch wouldn't occur consistently, but at least it WOULD happen. But now the switch to position 3 simply refuses to occur and I have no idea why. I've tried using channels, variables, switching the trigger command for position 3 between all the major loops and nothing seems to work.

 

The push water program is what I currently have. Push saline is one of the older iterations with the trigger command occurring both during the primary loop before it's supposed to close AND during the final loop when the closing subvi gets requested.

0 Kudos
Message 1 of 11
(951 Views)

This program is supposed to turn the valves to position 2 ("GO2" in the case structure) then trigger the pump to push all the liquid in, then after all the liquid is finished being pumped, the valves need to switch to position 3, then the closing subvi gets triggered and it waits for user input before closing the whole thing.

 

I am having a lot of trouble getting the valve to turn to position 3 at the end before triggering the closing vi. I suspect its something in the order the loops are going, but I cannot figure out what it is. The program previously turned the valves to 2 and started the pump simultaneously, but that lead to liquid getting to the wrong destination, so I changed it to only start pumping after the program confirms the valves actually reach the requested spot. And even then the ending switch wouldn't occur consistently, but at least it WOULD happen. But now the switch to position 3 simply refuses to occur and I have no idea why. I've tried using channels, variables, switching the trigger command for position 3 between all the major loops and nothing seems to work.

 

The push water program is what I currently have. Push saline is one of the older iterations with the trigger command occurring both during the primary loop before it's supposed to close AND during the final loop when the closing subvi gets requested.

0 Kudos
Message 2 of 11
(845 Views)

If you save your vis in an older version (LV20?) you would have more people that can look at this.

You probably want to include all the vis. Sounds like your are using 3rd party drivers in your application (KD Scientific Legato pumps?)

 

Good luck

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 3 of 11
(863 Views)

attached is the saved version LV 20, let me know if you have any troubles viewing. 

0 Kudos
Message 4 of 11
(858 Views)

@Manny904 wrote:

attached is the saved version LV 20, let me know if you have any troubles viewing. 


We cannot download because of the broken virus scan. Can you place all files into a zip file before attaching?

0 Kudos
Message 5 of 11
(844 Views)

Attached VI zip file...

0 Kudos
Message 6 of 11
(836 Views)

We are missing the "done button.vi", but from a casual inspection, there are a lot of things wrong, probably due to inexperience with LabVIEW. There is a lot of "code smell".

 

  • Valve B gets the same string in both of the switch cases, so why is that even in the case structure (upper loop)?
  • I am pretty sure your boolean feedback node (lower loop) got auto-inserted because of a dataflow violation. Make sure it really does what you want. (See also)
  • Writing to a terminal and to a local variable of that same terminal is just plain silly ("both" in upper loop and "done" in the last loop. etc...).
  • It you set the execute option to clear indicators when called, you would not even need the "done" locals. It is also pointless to write false to it with every iteration of the loop, it cannot change during that loop.
  • There are glaring race conditions due to blatant overuse of local variables. For example the "go a" local in the upper loop will probably get read way before the indicator gets updated. Just eliminate the local and wire it by branching the wire going to the indicator! Same for "go b"!
  • Never hide terminal labels on the diagram.
  • etc.
0 Kudos
Message 7 of 11
(826 Views)

Done VI should be in the zip folder now. 

0 Kudos
Message 8 of 11
(818 Views)

Thanks. Maybe you want to correct some of the glaring mistakes mentioned before giving us another look.

Do you understand most of my points?

0 Kudos
Message 9 of 11
(811 Views)

Deciphering now!!!!

0 Kudos
Message 10 of 11
(808 Views)