LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two pump combined and individual control

Solved!
Go to solution

Hey guys,

 

So I'm currently working on controlling two pumps simultaneously (specifically two Longer BT100-3J pumps). Both pumps are using external RS485 analog controllers and these go into an NI-DAQ. I've already got the controls working thoroughly but I also included a button labeled "Link Pumps" and the purpose of this button is to switch between combining the controls between both pumps, making pump1 settings dominant, and switch to independent controls for both pumps. In other words, combined vs individual control. This is supposed to happen even when both pumps are already running. If the code is running and they are running independently and the link is switched on during this process, pump2 should adjust itself to the settings of pump1 and any adjustments made thereafter in pump1 should be mirrored in pump2 (it would also be nice if pump2 is adjusted here that pump1 adapts to pump2 changes but this is extra steps and not too necessary). If they are running synchronized and the link is switched off during the process, pump2 should have pump1 control values but they should be independently adjustable thereafter.

 

The current issue is when I have the code running (both Run and Continuous Run) and I click the "Link Pumps" button, pump2 slightly adjusts itself to the settings of pump1 but quickly switches back to its own setting. So pump2 doesn't adjust to pump1 settings when linked. I thought I set it up correctly so I can't tell where my problem is aside from having a very basic While loop without events triggering what happens next but hopefully there's a way around this and just keeping it simple as is. 

 

I've linked my version and two older versions for whoever wants to check it out.

Any help/advice is much appreciated. Thank you in advance.

 

Kind regards,

PDB

0 Kudos
Message 1 of 5
(203 Views)

Hi PDB,

 


@PDBSteenhuisen wrote:

The current issue is when I have the code running (both Run and Continuous Run) and I click the "Link Pumps" button, pump2 slightly adjusts itself to the settings of pump1 but quickly switches back to its own setting.


Well, when the mechanical behaviour of the "Link pumps" button is set to "latched" then it will switch back upon/after reading!

Change to a "switch" behaviour…

 

To implement your behaviour I would slightly change the approach:

  • Have two inputs for pump1 and pump2 speed control.
  • have your "link pumps" button
  • now implement a routine (subVI) with 3 inputs, both speeds and link state. Inside this routine you can manipulate the speed data according to your requirements (linking, reacting on changes of both speed inputs).
  • that routine outputs 2 speed values, that are calculated from inputs and previous status

Your main VI now would look much cleaner…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(184 Views)

Hey GerdW,

Well, that's embarrassing haha! Thank you, that fixes it.

 

Another question I have is, I would like the pump2 in the front panel to adjust to pump1 when they are linked. Could you walk me through how I would tackle that? I'm thinking maybe adding references for the pump1 controls and using them at pump2 when the pumps link but if you have a simpler way of doing this, please let me know. 

Also, thank you so much for the tidiness advice. Always helps keeping stuff cleaner.

 

Cheers,

Paul

0 Kudos
Message 3 of 5
(159 Views)
Solution
Accepted by topic author PDBSteenhuisen

Hi PDB,

 


@PDBSteenhuisen wrote:

I'm thinking maybe adding references for the pump1 controls and using them at pump2 when the pumps link but if you have a simpler way of doing this, please let me know.


Don't start to use control references here.

I repeat from my last message:

 

  • now implement a routine (subVI) with 3 inputs, both speeds and link state. Inside this routine you can manipulate the speed data according to your requirements (linking, reacting on changes of both speed inputs).
  • that routine outputs 2 speed values, that are calculated from inputs and previous status

A simple small subVI with 3 inputs and 2 outputs…

 

To show the linked/"coerced" value on the frontpanel I would use locals (and write only on "value changed" && "linked").

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(137 Views)

Hey again GerdW,

 

Thank you so much! Will implement the changes and, for now, everything solved!

 

Much appreciated. Have a good one 🙂

 

Kind regards,

PDB

0 Kudos
Message 5 of 5
(131 Views)