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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a VISA resource name from a vi to another vi

Solved!
Go to solution

Hi everyone,  I'm using a global variable to pass the VISA resource name from a initialisation vi to an execution vi of an application, the problem is that the resource name hardly ever appears on the execution vi even when the condition to go from the initialisation vi to the execution one is that in the first one there is a resource name. Any idea about this?

I'd appreciate every comment.

Best regards.

0 Kudos
Message 1 of 4
(2,664 Views)

This looks like a race condition. Are you sure that the execution vi really is executed aftr the initialisation vi?

Does the name come up in the global variable? And finally can you pass the vi or vi's with their main vi?

greetings from the Netherlands
0 Kudos
Message 2 of 4
(2,645 Views)
Solution
Accepted by topic author JEmmanuelH

The simple solution would be to not use the global variable and pass the resource reference out of the initialization VI and into the "execution" VI.  Then data flow will take care of the order.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(2,625 Views)

First of all, thanks for your comments.

I´ve realized that if I run the execution VI in Highlight Execution the VISA resource name is catched correctly. I'm going to try the option of crossrulz, anyway I'll leave the subVI's below just in case and if there is any reccomendation.

Thanks for all.

Download All
0 Kudos
Message 4 of 4
(2,611 Views)