Products > Test Equipment

open source GPIB adapter

<< < (28/42) > >>

dazz1:

--- Quote from: coromonadalix on December 10, 2023, 04:12:01 pm ---Rhode Schwartz visa package is small and efficient, you have rs tools in it to send and read commands ...

--- End quote ---

I have installed R&S visa, now I am just started reading through the manual to get it to work.  I have not used GPIB, visa or Python before.

dazz1:

--- Quote from: caiser01 on November 14, 2023, 02:40:35 pm ---Finally, if you're familiar with Python, here is a simple script that can be used to read from the HP 3478A you mentioned in your earlier post. Please note: Your VISA resource string will be different because your adapter will have a different serial number to mine.


--- Code: ---# HP 3478A Multimeter simple read test

import pyvisa

rm = pyvisa.ResourceManager()

multimeter = rm.open_resource('USB0::0x03EB::0x2065::GPIB_23_3423331363435161F191::INSTR')

# Set function to DC volts
multimeter.write('F1')

try:
    while True:
        print(float(multimeter.read().strip()))
except KeyboardInterrupt:
    multimeter.clear()
    multimeter.close()
    rm.close()

--- End code ---

--- End quote ---

Hi
where do I find the VISA resource string ?

coromonadalix:

import pyvisa

rm = pyvisa.ResourceManager()

multimeter = rm.open_resource('USB0::0x03EB::0x2065::GPIB_23_3423331363435161F191::INSTR')

caiser01:

--- Quote from: dazz1 on December 13, 2023, 10:25:20 am ---Hi
where do I find the VISA resource string ?

--- End quote ---

There's a couple ways to find it. Since you say you haven't used Python before, let's stick to R&S VISA for a start to keep things simple.

With your instrument connected to the PC with the USB->GPIB adapter, open the R&S Tester app (just called Tester on Windows, RsVisaTester on Mac/Linux). On the menu bar, click Find Resource. In the window that opens, click the big refresh button in the upper left corner. The available VISA resources will show up in the list on the right of that window. In the list, find the resource for your connected instrument ('USB0::0x03EB::0x2065::nnnnn::INSTR') and double click it. This will take you back the main window of the Tester app. From there, you can click the Connect button and try sending your instrument some commands. For the HP3478A, try writing F1, F2, F3, etc and observe whether the meter function is changing.

If everything looks good, just copy the VISA resource string from the Tester app window and paste it over the resource string in my example Python script. Close the Tester app and try running the Python script.

dazz1:

--- Quote from: caiser01 on December 14, 2023, 11:21:55 pm ---
There's a couple ways to find it. Since you say you haven't used Python before, let's stick to R&S VISA for a start to keep things simple.
...

--- End quote ---
I found the resource string using pyvisa on the command line.  I haven't tried R&S visa or your script yet.  Getting there.
I have been programming unprofessionally for around 45 years so I am reasonably relaxed about learning python.

Edit 17 Dec 2023:
A real resource string looks like this:

--- Code: ---('USB0::0x03EB::0x2065::GPIB_02_24238323232351C01171::INSTR', 'ASRL1::INSTR')
                             ^^

--- End code ---
It appears to be a constant that is unique to each adapter except for the GPIB instrument address.  In this case "02" marked with ^^.
If you have a list of instruments with their GPIB addresses, it should be possible to read the GPIB address from the resource string to figure out which code should run for that instrument.
This would avoid the need to identify specific adapters.  You would be able to plug in any adapter to any instrument. 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod