Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB Adress Setup VI for several Instruments

Hello,

 

I'm trying to setup 5 different measurement instruments for a project. What I want to do is to have a VI where I can select the GPIB adress for each of the instruments. 

 

Those adresses should be 'saved' so I can use my instruments for different measurements later. 

 

What is the best way to do this and how can I make a interface from this VI to other VI's.

 

Thanks!

0 Kudos
Message 1 of 10
(6,330 Views)

I like to use Action Engines to store my VISA Sessions and send/read from the instruments.  That has worked very well for me.

 

Depending on the current setup of the code, I may also save the VISA Sessions in a global variable.



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 2 of 10
(6,304 Views)
Think about using VISA aliases. They are much easier to read and remember.
0 Kudos
Message 3 of 10
(6,287 Views)

Hi,

 

it tried the Action Engines but the problem is, that every time that my Global Functional VI is called, the shift register is empty so I can't read what was stored in there the last time.

 

Do I have to adjust my memory setup? If yes, how?

 

See pictures attached:

 

Visa Setup is the VI where I can choose the different VISA adresses. When the VI is opened, I wan't to see the last VISA setup which was made on my indicators. 

 

GFV is my functional global variable VI with 6 functional globals - one for each instrument

 

EDIT: I figured out that it has something to to with the close function of the VISA_setup.vi. The data which is stored in the functional global is lost since the VISA_setup.vi is closed. How can I save the data after closing the VI?

Download All
0 Kudos
Message 4 of 10
(6,216 Views)

Bommelchen wrote:

Visa Setup is the VI where I can choose the different VISA adresses. When the VI is opened, I wan't to see the last VISA setup which was made on my indicators.


Are you talking about between runs of your program?  If that is the case, then you need to save your values to a file and then them at start up.



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 5 of 10
(6,195 Views)

My Menu VI is still up and runing. It opens the VISA_Setup VI as soon as the Button "Instrument Setup" is activated. After pushing the Safe & Exit Button in the VISA Setup VI, it closes itself and returns to the Menu.

 

Is it possible to somehow use the functional global in the Menu VI to store the data after the VISA_Setup is closed?

0 Kudos
Message 6 of 10
(6,192 Views)

How is the menu VI calling the other VIs?  As long as that Instrument Setup VI is still in memory, so should the VISA_Setup, allowing you to use it still.



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
Message 7 of 10
(6,188 Views)

I found a solution: I just added the functional global VI to the menu VI. Now it retains the data also when the sub VIs are closed. 

0 Kudos
Message 8 of 10
(6,186 Views)

Yep, you are dynamically calling the other VIs.  So when they are done running, they go out of memory, therefore you lose your FGV as well.

 

You really should look into using the Event Structure to call your VIs.  That way you aren't polling the buttons and using 100% of your CPU.

 

I would also put the FGV outside of the loop just so you aren't polling it constantly just to do nothing.



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
Message 9 of 10
(6,182 Views)

Thanks for the advice Smiley Wink

0 Kudos
Message 10 of 10
(6,171 Views)