From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

Issue with SDS 1104X-E with pyvisa

Go to solution


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\", 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)"



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


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?



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


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



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



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




0 Kudos
Message 1 of 3

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


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



It however creates this error?



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.


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





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
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.


It connected and my code worked


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