Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Sub VI does not receive main VI's VISA resource address

I wrote a program that makes calls to two sub VI's also written by me and saved in the same directory as the main VI. Even though I wired the main VI's VISA resource selection control as inputs for both sub VIs, the sub VIs do not receive the VISA resource name information from the main VI when I run an executable of the main VI on a different computer. The only way I found to make the program work is to have the main and sub VIs as startup files so that all of their front panels pop up and then select the appropriate VISA resource in each window. Why I can't make the program work with only one front panel?

The VI's are attached below (Main VI = FSP channel power.vi)

Thanks,


Ricardo
0 Kudos
Message 1 of 6
(3,495 Views)
Your attachments did not make it. If you click the 'Preview Post', the attachments get deleted and you have to re-attach.
0 Kudos
Message 2 of 6
(3,494 Views)
Sorry about that. Here are the attachments.
0 Kudos
Message 3 of 6
(3,491 Views)
I can't run it because the R&S functions are missing and the link on the download page doesn't seem to work but what you could do is put the terminal for the resource name inside the loop that waits for the start button to be pressed. Since an exe by default is set to run when opened, the default empty resource name may be getting passed to the rest of the program before you have a chance to set it on the front panel.
0 Kudos
Message 4 of 6
(3,481 Views)
At least for one of the subvi's (FSP NTSC Config1 it is clear why they don't get the visa name right.
It is not called from the main program !
Maybe it is called from one of the subvi's that you did not supply, but sure this is the reason.

I did not test the other vi.
Furthermore I advise you to modularize your code, this has not only the look but is spaghetti code although I have seen worse.
Please do not use stacked sequence frames and try to call your instruments from an IO subvi.

One of the first things to strive for is to keep your program within the bounds of a reasonable screensize.
One of the methods is subvi's
greetings from the Netherlands
0 Kudos
Message 5 of 6
(3,476 Views)
" At least for one of the subvi's (FSP NTSC Config1 it is clear why they don't get the visa name right. It is not called from the main program !"


The attachments are named incorrectly.  The 1 in all of the attachment names are not in the filenames on my pc. I am not sure how the 1's ended up in the attachment.

Maybe that is why you say the sub VI's are not called from the main program?

I decided to do some organization as suggested and ended up pretty much re-doing the entire program. The end result was a functional program. Thank you Dennis and Albert for the help.


--Ricardo
0 Kudos
Message 6 of 6
(3,449 Views)