10-09-2025 05:08 AM
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
Solved! Go to Solution.
10-09-2025 05:39 AM - edited 10-09-2025 05:40 AM
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:
Your main VI now would look much cleaner…
10-09-2025 06:25 AM
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
10-09-2025 07:30 AM
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:
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").
10-09-2025 07:38 AM
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