From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with SDS 1104X-E with pyvisa

Solved!
Go to solution

Hello,

So I've been working on automating a signal generator and an oscilloscope in tandem. Most recently I got my Agilent 83630B to run and take commands. When I tried to run my code with both devices the scope started giving an error I should say that this is the error I get when I changed my USB driver I will show the original error after I change drivers and restart my computer.

"File "C:\Users\99101\AppData\Local\Programs\Python\Python39\lib\site-packages\serial\serialwin32.py", line 64, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM4': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)"

peteanater_6-1624469654160.png

 

My first thought was that this was some driver issue so I set it to (WinUSB (v6.1.7600.16385)). This didn't correct the issue and gave me the error above. I then went to check the keysight connection manager and other things

peteanater_0-1624469232362.png

The keysight manager displays the scope and seems like it can register a visa address. When I use the IO application to test the commands it outputs the IDN command? which makes me think it is connecting?

peteanater_1-1624469333246.png

 

When I run this same command through these various addresses I get that error that I mentioned above.

peteanater_2-1624469370286.png

I don't see how it can send commands through the application but not through my python script?

 

Here you can see my computer sees the scope in my device manager

peteanater_3-1624469444472.png

 

For some reason the NI max and NI visa do not see the device though and create this error as well?

peteanater_4-1624469497393.pngpeteanater_5-1624469619173.png

 

I will update this in a moment with the other driver errors and it's unique issues.

 

 

 

0 Kudos
Message 1 of 3
(1,381 Views)

Ok so I will now show the errors with the USB driver that I was using for the signal generator.

peteanater_0-1624470578530.png

So here we have the USB serial driver. When this driver is installed it now registers the devices on the NI max software

peteanater_1-1624470640981.pngpeteanater_2-1624470649747.png

 

It however creates this error?

 

peteanater_3-1624470705448.png

And this is new it seems like it's able to see the device in the keysight software? It wasn't doing this a moment ago.

peteanater_4-1624470761476.png

It however is not able to take the IDN command and gives this error unlike the other driver.

Here is my python code and the errors I get from that

peteanater_6-1624470845309.png

 

peteanater_5-1624470825869.png

 

Any help is greatly appreciated I'm not sure what to do because the capabilities change so much based on these USB drivers? but neither does fully what I want it to do which is control the device through python.

 

 

0 Kudos
Message 2 of 3
(1,375 Views)
Solution
Accepted by topic author peteanater

I hate to do this.

I switched out the scope yesterday and it wasn't working and changed my backend configuration line of code from this

"rm = pyvisa.ResourceManager('@py')"

to this which should automatically change the backend to something desirable
"rm = pyvisa.ResourceManager()"
then I come in today and turn everything on.

peteanater_0-1624548897423.png

It connected and my code worked

peteanater_1-1624548921311.png

I don't remember changing anything besides switching out the scope and that backend line of code. To people in the future I do recommend changing the line of code I think that's what had this affect.

 

0 Kudos
Message 3 of 3
(1,331 Views)