09-30-2014 03:05 AM
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!
09-30-2014 06:27 AM
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.
09-30-2014 09:21 PM
10-09-2014 03:45 AM - edited 10-09-2014 04:14 AM
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?
10-09-2014 04:40 AM
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.
10-09-2014 04:47 AM
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?
10-09-2014 05:00 AM
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.
10-09-2014 05:02 AM
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.
10-09-2014 06:08 AM
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.
10-09-2014 09:14 AM
Thanks for the advice ![]()