11-28-2024 04:56 AM - edited 11-28-2024 05:06 AM
If you did the auto-assign procedure as detailed in the Bronkhorst manual for your controller type for each controller, they should all have their own unique node address now.
You can use FlowSuite to see what controllers it can detect. In there you can also select an individual controller and have it Wink (blink one of the Leds) for you to learn which node address corresponds to which physical controller.
In LabVIEW you initialize the serial port with the Bronkhorst FLOW-BUS.lvlib:Initialize.vi and then you use the according VISA resource with the other VIs to control the setpoint or read the current value and other stuff. For each controller you want to set the setpoint, you call the Bronkhorst FLOW-BUS.lvlib:Configure Setpoint (Direct).vi and the according node address connected to the "Node" terminal. To read its current flow you use Bronkhorst FLOW-BUS.lvlib:Read Measure (Direct).vi with the according node address wired to its "Node" terminal. There is also a VI Bronkhorst FLOW-BUS.lvlib:Wink.vi that will blink the Led on the according controller.
The "Node" terminal on the Initialize VI is only used if you select to have it also reset the controller and in that case should be the node address of the device that is directly connected to your computer. But usually you would not need that.
If you want to control all 4 controller you would need to call the Configure Setpoint.vi 4 times each time with the according node address and setpoint value. If you only want to control one controller you only call the Configure Setpoint.vi once with the correct node address. Same for reading the current value. Your program will need to have some logic to decide on whatever criteria your application has, to talk to either 1, 2, 3, or 4 controllers and set the others to inactive (no flow) or something.
As to learning to use LabVIEW itself: That is not something anyone could teach you with a post here. That's serious learning business and you should go through some of the tutorials pointed out on the main page of this forum at the top as learning resources. You have to learn to walk (understanding how LabVIEW works) before you can attempt to run (writing your own application). If you are at an educational institution, try to find out if there is a group or similar of other LabVIEW users who might have individuals that are willing and able to mentor you.
01-21-2025 08:50 AM
Hello Mr. Kalbermatter,
Yes, you are right. By using bronkhorst labview subvi, I created a loop to read a value for only 1 mass flow rate controller. Understanding of me, I have to do copy-paste this scheme 3 times more, then, I can control 4 different mass flow rate controller. Am I correct?
I will use one of them for each mass flow rate value. So, I do not need work with them simultaneously. For this purpose, I can do copy-paste 3 times more, can't do?
How my subvi looks like?(attached picture) Do you have any recommendation for me?
sincerely.
01-21-2025 12:25 PM - edited 01-21-2025 12:28 PM
Well, message queue based architecture is a design pattern with specific elements. There is an Initialize case for a reason. It should most likely call the Initialize method for the Flowbus, don't you think that sounds logical? That should not be called each time you want to talk to one of the controller!
Second, do you really need to query all the information for each flowbus controller each time again? The Unit really won't change between subsequent reads and unless you do a setpoint write, that setpoint value won't change either.
So you will likely do some stuff in your Initialize method to read those constant settings and then only do a read for the current value and maybe setpoint for each controller. And no you do not copy paste the entire chunk for each of your controllers, you better process them in a loop. Loops are the programming construct to do certain operations multiple times, not copy pasting code unnecessary!
It would seem you still did not go through the tutorials I had been pointing out earlier. Programming is not just copy-pasting some random code but logical thinking, even though some ChatGPT fanboys claim otherwise.
01-22-2025 06:45 AM
Hello Dear Mr. Kalbermatter,
Thank you for your answer.
For initialize icon, I called it for each mass flow rate controller that means 4 times. I also called rest of the icons 4 times (configure set point, read set point, read measure, read temperature, and close.
Then, I called 4 times setpoint controller because I can change mass flow by using it. Also, I gave them a separate node number (3-4-5). Also, I have to define them different VISA Resource Name such as COM1, COM2, COM3, COM4).
Then, I connected all of them to the message queue.
However, I am not sure whether this configuration works or not. Even though it works, I am not sure how I will control/change which mass flow rate controller should be run while doing experiments. For example, for mass flow rate of 5 kg/s, I will use my first mass flow rate controller, while I will be using my second mass flow rate controller for mass flow rate of 10 kg/s. I am not sure how I will do this process.
However, at least I want to understand how I can design a block diagram at least for one of them....
I also watched tutorials but okay I can check them again..
01-22-2025 07:24 AM - edited 01-22-2025 07:25 AM
The Initialize function initializes the serial port on the computer which is connected to one of your controllers. Executing it 4 times simply does it 4 times, pretty useless and time consuming. Also it is a pretty lengthy process so doing it every time before trying to talk with one of your controllers is even more useless and time consuming. Once the serial port is initialized it stays initialized until you close it or stop your application!
Copy pasting code to do the same thing multiple times is bad coding, unnecessary code duplication and totally bad for later maintenance too. If you find that something needs to be changed you have to make that change in every copy of your code. There are better causes to spend your time for. It also has the potential for race conditions since you try to communicate over the same resource (your serial port) in parallel, so depending on the underlaying driver architecture you can end up sending command "Device 4: Read Setpoint" and receive the response for "Device 1: Read Unit". Very helpful for your application, NOT!
And last but not least, those Units really absolutely and definitely won't change on the fly for any of these controllers. So why would you read them every time? Those communications are over a serial line and every information queried and returned takes time, slowing down your loop iteration even more, although granted, adding the Initialize before each cycle is most likely increasing the delay more than a few Read Unit calls.
01-22-2025 07:45 AM
Dear Mr. Kalbermatter,
If I dont put initialize section for each of them, I dont have VISA and Node address. How would I distinguish which mass flow rate controller works? Therefore, I put them.
***You mean that I can use only one initialize VI, and I can connect it parallelly to each of mass flow rate controller section?
I understand that I have better coding architecture but I thought I need somehow 4 times read and measure section for each of my mass flow rate controllers. For this reason, I put them. However now, I am not sure how I can control them without putting 4 times indeed.
I only put "Capacity Unit, " Counter Unit", "Counter Value", and "Analog Input Value" for the first mass flow rate controller section. I read their explanations and I was not sure whether I will need them or not, that is why I put. Actually, I need only mass flow rate value and temperature. Thas it actually for my each mass flow rate controller.....
01-22-2025 09:02 AM
@Exchanging7878 wrote:
Dear Mr. Kalbermatter,
If I dont put initialize section for each of them, I dont have VISA and Node address. How would I distinguish which mass flow rate controller works? Therefore, I put them.
***You mean that I can use only one initialize VI, and I can connect it parallelly to each of mass flow rate controller section?
No! Not parallel but sequential! And since you have 4 times the same thing but for different controllers, you don't need to place the Read function 4 times behind each other but only once inside a loop that executes 4 times!
You initially showed a message queue based architecture. That's the whole magic. In there you can send multiple messages to configure (initialize) your engine, to change setpoints and to read the current process values. Something like this:
01-24-2025 01:55 AM
Hello Mr. Kalbermatter,
You did a loop for message queue and you have only one VISA address, but how will you set mass flow rate for different controllers and read them for different controllers?
I am very confused. I did not understand whether I can control my mass flow rate by my own design or not...
Also, why I am using capacity unit read because after setting my mass flow rate by using configure set point direct, I do not know which unit I will be using to set mass flow value, so I wanted to see in case I may need some calculation such as from kg/s to l/min.
Configure set point VI will set my mass flow directly how mass flow controller was set before, will not? For example, if datasheet of a my mass flow rate controller shows its range as lt/min, Configure set point VI will set my mass flow rate in terms of lt/min. That is why you told that I dont need read capacity unit, do you?
01-24-2025 04:00 AM - edited 01-24-2025 04:03 AM
@Exchanging7878 wrote:
You did a loop for message queue and you have only one VISA address, but how will you set mass flow rate for different controllers and read them for different controllers?
Ok, you haven't really explained your hardware setup. Bronkhorst controllers have a remote control port that (depending on ordered options contains an analog/digital interface and/or an RS-232 interface). In addition they usually, but not always contain an extra communication bus connection on the top such as Profibus, Modbus, or their own special Flowbus.
Pretty much every Bronkhorst setup I have done so far used controllers and meters with the Bronkhorst Flowbus as an interface. With this you usually setup one of the controllers to have a serial port connection with the computer and connect all the other controllers together over the Flowbus (with other industrial busses it works the same). In this way you only have one single serial port and there are no COM1, COM2, COM3 and COM4 for your controllers, it's all over the same serial port.
If you connect each flow controller through its own serial port to the computer, you do indeed need one VISA resource per controller, but then you should not use the Flowbus connection. You initially indicated that you were using the Flowbus but maybe you reconsidered and got 4 serial ports in your computer installed?
If you use the Flowbus wiring, all messages go through the single controller connected to your computer. There is only one single serial port connected to your Flowbus system and initializing it multiple times with the same VISA resource name makes absolutely no sense and initializing it with different VISA resource names even less.
I am very confused. I did not understand whether I can control my mass flow rate by my own design or not...
Also, why I am using capacity unit read because after setting my mass flow rate by using configure set point direct, I do not know which unit I will be using to set mass flow value, so I wanted to see in case I may need some calculation such as from kg/s to l/min.
Configure set point VI will set my mass flow directly how mass flow controller was set before, will not? For example, if datasheet of a my mass flow rate controller shows its range as lt/min, Configure set point VI will set my mass flow rate in terms of lt/min. That is why you told that I dont need read capacity unit, do you?
This mostly makes no sense to me. Sorry! You showed initially a message queue based image and I was assuming you understood a bit how that works. If you don't you have a steep learning curve in front of you. Why don't you look for an actual classroom teaching course about LabVIEW at your institution or similar? You really will need it if you want to finish this project.
01-24-2025 04:14 AM
Hello Dear Mr. Kalbermatter,
Yes, I will use flowbus system, and I will connect them to my computer only one serial connector because it is shown in manual of bronkhorst. So Okay, using only 1 "initiliaze VI" and connect it to 4 different loop will be enough to control 4 different mass flow controller.
Yes, I will use message queue to control my whole system on labview, I will look on it more and more. Hopefully, I can present appropriate labvew design in next days.
Thank you