05-29-2019 11:22 AM
how do i have only one VISA session going through multiple vi using a front panel?
my VISA session keep changing instead of GPIB::20 into (1) and so forth
05-29-2019 01:08 PM
You coded something incorrectly.
05-29-2019 02:39 PM - edited 05-29-2019 02:41 PM
Well without seeing your code all we can say is "you are doing it wrong".
But I am guessing that you are not using a proper program architecture and that is why you are finding it difficult.
Basically you should be doing this:
05-30-2019 08:19 AM
Don't bother attaching a picture of your code (well, you can, but you should also attach the VI or VIs in question, as they are the most useful items for us to examine -- we can tell what version of LabVIEW you are using, we can "see" all the elements of a Case structure, we can edit and run your code, etc. Can't do any of those with a picture ...
Bob Schor
05-30-2019 09:35 AM
The best way to learn to code is to look at well written code as an example. Luckily NI provides a lot!
Open up the "HELP\Find Examples" from your VI. Search for 34401. This is an instrument driver that uses VISA to communicate with a Keysight DMM. Take a look at how they pass the GPIB Instrument reference (and Error) wire in and out of the subVIs. You should emulate this technique in your code.
Then on your front panel VI you can use "Edit\Make Current Values Default" to save the GPIB address of your current instrument. This way your front panel will at least remember the address each time its loaded.
Hope that helps.
Craig