11-03-2023 04:33 PM
I have a VI that controls a series of valves. It uses a cluster of buttons to control the valves, and the VI can be seen in the attached png. The front panel of the VI is seen in the other png. I am attempting to control the front panel of this VI with another, but I am having trouble with how do access the individual buttons as they are currently in a cluster together.
My current idea is to create two subVis that will connect the two VIs. One to read the status, and a second to read through the button names and determine if their status has changed in the second VI. I am fairly new to LabView and unsure if this is a good idea, and if so how I would read out the properties of the button cluster.
11-03-2023 09:00 PM
Hi. Welcome to the Forums. You posted two "pictures" of LabVIEW code. What would you like us to do with them? If you had attached actual VIs (and if you knew enough about LabVIEW to realize that if you are a new LabVIEW user running the latest version of LabVIEW, i.e. LabVIEW 2023, that many of the "experienced" LabVIEW participants in the Forums might be using a version 2-4 years earlier, so you should "Save for previous version" and specify LabVIEW 2019 or LabVIEW 2021), I would (perhaps) have understood what you are trying to do, and suggested how I would have done it. [I actually have a program where I have 24 stations that I'm monitoring, represented by 24 Boolean buttons that serve two functions -- if I push one, it brings up a detailed display of that Station, and the color of the Button tells me if the station is Running, is "doing something interesting", has errorred out, or has closed itself "normally"].
I'll wait until you post LabVIEW code that (a) I can read, edit, perhaps even execute, and (b) enable me to understand your question so I can make a reasonable response. I'm using LabVIEW 2019, so will not be able to open your code if you post it using LabVIEW 2023.
Bob Schor
11-06-2023 06:41 AM
I put together a demo (LabVIEW 2018) based on the structure of your DAQmx code.
ValveVI-SM.vi - Represents your while loop without the DAQmx code
Remote Valve Control.vi - Can selectively control ValveVI-SM
Valve FGV.vi - Self initializing Functional global that ties them together (see notes inside)
You can still run ValveVI-SM standalone.
When Remote Valve Control is running, press the Local button to start remote control mode.
Not that you would, but you can switch back and forth from local to remote control.
Notes: It's a small amount of data so all values are sent. No need to hassle with each control.
I did not type define the clusters which would be a good idea.
----
Also note that this is not how I would structure the code.
For the DAQmx stuff I would use a State Machine (SM) controlled by an event structure
(producer consumer with events). I would only send an array of Booleans to the SM (plus State).
User events would be used to communicate between VIs (less polling and more flexible).