SCPI Instrument with VISA remote system

I’m experimenting with a VISA Remote for a development test system. I’ve never done this, so I’m not 100% on the setup, but I’ve verified I can communicate with the DMM on the remote system via a simple C# program, so I’m reasonably confident it ‘works’.

The VISA remote/server is configured with NI-MAX. When I have the VISA Options > Enable finding resources on these remote systems box ticked and I try to create a new SCPI Instrument in Editor, I get the following error:

VisaDeviceDiscovery Detecting device addresses took longer than expected. This might be caused by a broken VISA installation.

The VISA Address drop-down eventually populates and includes the alias for the remote instrument, but when I try to use it with a test step (just a simple “*IDN?”), Editor hangs for a few seconds then crashes.

Any ideas on how I can get this working?

Hi @benstreek,

Unfortunately I don’t know much about NI-MAX, but I have seen this error before. What happens in OpenTAP is that there is a timeout when asking the resource manager for discoverable VISA addresses. At the moment the timeout is 2000ms. If it takes more time than that it will no longer ask the resource manager for addresses.

If you uncheck the VISA remote option, does the error disappear?

If you want, you could check out the opentap source code and modify the timeout to see if that helps. It’s inside the VisaDeviceDiscovery.cs file.

Hi, @rolf_madsen .

Yes, unchecking the remote option and restarting Editor stops the error message.

I couldn’t get Editor working in a locally built OpenTAP so I used TUI. I guess it doesn’t do the VISA discovery because I didn’t see the error even before changing the timeout.

I increased the timeout to 20s regardless and replicated the test plan that was failing in TUI. It too crashed out.

Stepping through the code, on stepping into ScpiInstrument.SetTerminationCharacter() Visual studio throws the following.

image

If I don’t step through and just run it, it goes into break mode with this exception:

Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x2f8cb562, on thread 0x446c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

Followed by

Object reference not set to an instance of an object.```

What bus is the DMM physically connected on?

What versions of NI-VISA do you have on the two systems?

Hi, @alan_copeland.

The DMM is connected to the server via USB.

Server has NI-VISA 2024 Q3 and Keysight VISA (IOLS 2024 U1)
Client has NI-VISA 2024 Q4 and Keysight VISA (IOLS 2023 U1)

I’ve tried setting the preferred VISA on both machines to NI and Keysight.