From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-28-2019 05:24 PM
I've recently searched for information on using Boolean Refnums to pass Boolean values, such as switches from the main VI to sub VIs. The problem I'm having is that a terminal does not appear on the sub VI in the main VI to connect the reference to the input of the sub VI.
The example I downloaded from NI has a terminal on the sub VI in the main VI. Why is my sub VI missing this terminal? I've attached the example I downloaded from NI to help me understand passing Boolean addresses to sub VIs. They are labeled Main.VI and SubVI.VI below. What else needs to be done to add the terminal to the sub VI so I can connect it to the reference in the main VI?
I've attached my code thus far as well. init.VI is the main VI. Generic_BK1900B_Logic_Function(SubVI).VI is the function that I'm having an issue with. The final VI is a general commands sub VI that can be used for voltage and current commands.
Solved! Go to Solution.
08-28-2019 05:52 PM
When attaching multiple files, please put them in a single zip file, especially if you use common names like main.vi or init.vi. My downloads folder already has several old VIs with these same names, leading to crosslinking if I try to open your toplevel.
Thanks.
08-28-2019 05:59 PM - edited 08-28-2019 06:03 PM
Maybe start learning about building and assigning the connector pane?
Still, it is not clear why you even use references instead of the boolean directly. Any reason?
(And please, it is extremely annoying if every single VI opens maximised to the screen. We cannot efficiently inspect something if we only can see one VI at a time. Thanks!)
08-28-2019 06:03 PM
I apologize for making it somewhat annoying for you. I am fairly new to using the community resources section. I'll try and figure out the issue. Thanks.
08-28-2019 06:08 PM
BTW, I've tried to use a Boolean Control in the sub VI on the input of the application, but it does not show up on the VI in he main function. That's when I did some digging and found that I may need to generate a reference and copy it to the front panel of the sub VI. This was all based on past instructions of similar issues.
Shane
08-28-2019 06:54 PM
All you need is a boolean connector in and a boolean connector out (in the case of the simple example, see picture) and similar modification for your bigger things.
Typically all connection should be just by native value. Using references is only needed in certain very limited scenarios (e.g if you want to change the properties of a front panel object from within a subVI or if the subVI runs independently and you want to update something before the subVI returns.)
All you code gets called and returns right away.
08-29-2019 12:46 PM
Thanks for the tip. I did click on the link you provided in your initial email and was able to generate a terminal; thank you, that was quite helpful.
Quick question, does the error out normally pass a true or false when there is no error? It seems the error is passing a true out of the VISA serial configure VI (arg 8). What I don't get is that flow control is disabled, which is what the manual calls out for the Power Supply I'm using.
Shane
08-29-2019 01:31 PM
@Shane71 wrote:
Quick question, does the error out normally pass a true or false when there is no error? It seems the error is passing a true out of the VISA serial configure VI (arg 8). What I don't get is that flow control is disabled, which is what the manual calls out for the Power Supply I'm using.
If there is an error, the Status of the error cluster will be TRUE. If you are getting an error from the VISA Configure Serial Port, then you are probably using an invalid reference or a port that is already being used by something else (Putty, a previous run of your VI and you failed to close the port, etc).
08-30-2019 01:19 PM
AH HA! EUREKA! Thanks for your help. I'll add that code in!
Shane