Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connections issues with device #22

Open
sebaleme opened this issue Sep 2, 2024 · 0 comments
Open

Connections issues with device #22

sebaleme opened this issue Sep 2, 2024 · 0 comments

Comments

@sebaleme
Copy link

sebaleme commented Sep 2, 2024

Hi,
I would like to report 3 problems that I have when using the RsInstrument package.

  1. VI_ERROR_RSRC_BUSY when trying to contact device
  2. Device is not replying after some time
  3. HisLip connection not working

=============================
Problem 1:
The python interface throws the following error quite often when I try to access the device. Feeling is that this is a transient error: VI_ERROR_RSRC_BUSY
I have implemented a workaround, which is looping until the device accept the connection, but maybe there is a nicer way to do it?

My config:

  • OS: "Ubuntu 20.04.6 LTS"
  • rsvisa/now 5.12.9 amd64
  • RsInstrument: 1.82.1

I am accessing a HMC 8041 power supply

My code looks like this:

if __name__ == "__main__":
    args = parse_args()
    instr = None
    # Try at least several times before giving up.
    value = 0
    error_msg = str()
    while value<MAX_RETRY:
        try:
            instr = RsInstrument(RESSOURCE_IP, id_query=True, reset=is_reset_needed(args.command))
            #idn = instr.query("*IDN?")
            break
        except Exception as e:  # pylint: disable=W0703
            error_msg = str(e)
            print("attempt failed, will retry...")
            time.sleep(3)
            value = value + 1
            pass
    if(value <MAX_RETRY):
        options[args.command](instr)
        instr.close()
    else:
        print("operation failed: ",error_msg)
    exit(0)

Here are the kind of error I am getting:
Error message: VI_ERROR_RSRC_BUSY (-1073807246): The resource is valid, but VISA cannot currently access it.
or
Error message: 'TCPIP::192.168.2.200::INSTR': Instrument error detected: -410,"Query INTERRUPTED"

Like I said, this code works, I am getting the connection, but only after several attempts, which is annoying. As workaround, I only use "*_with_opc" commands, but it did not bring anything.

======================================
Problem 2:

Another error, which is more serious, is that after a certain time, the power supply stop accepting connections and I always get the following exception:

operation failed:  Insufficient location information or the requested device or resource is not present in the system.
Library: Visa Library at /usr/lib/librsvisa.so
Manufacturer: Rohde & Schwarz GmbH
Resource Name: 'TCPIP::192.168.2.200::INSTR'

There is only one solution, restart the power supply manually. And some time, it can be every 20min, depends.

======================================
Problem 3:

I am not able to connect with the high speed connection.
TCPIP::192.168.2.101::INSTR' ==> Working
TCPIP::192.168.2.101::hislip0' ==> Not working (resource is not present in the system.)

I also tried with the following, not working either:
TCPIP::192.168.2.101::hislip
TCPIP::192.168.2.200::hislip0::INSTR

Sebastien

@sebaleme sebaleme changed the title Always getting VI_ERROR_RSRC_BUSY when trying to contact device Connections issues with device Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant