If you can communicate with the Keithley 2400 using NI-MAX, it will also be possible using SweepMe!.
The first thing that comes to my mind is that you are using the port COM4 with a Prologix adapter which probably leads to some conflicts.
The Prologix adapter is a GPIB adapter that receives commands via a serial COM port. Once the COM port is registered in SweepMe! to be used with the Prologix adapter, it can not be used for normal COM port communication. Thus, I recommend to unregister/remove the Prologix adapter. This can be done via menu “File” → “Options” → tab “Ports”:
In a next step you can set back the port configuration to default in the window Ports:
The SweepMe! driver for the Keithley 2400 uses the factory default settings being baudrate 9600, terminator \r.
You can cross-check this in our GitHub repository of the instrument drivers here:
or when you open your local installation of the instrument driver.
Now it should be possible that you find “COM4” as port in the field “Port” of the SMU module.
If you start a measurement and there is still an error, please send the a screenshot of the Debug widget or attach the debug.log file to your response.
If you see something like:
serial.serialutil.SerialException: could not open port ‘COM4’: PermissionError
then another application seems to have access to the COM port at the same time. In this case try to close other applications that might use COM4 as well. Further, you can try to restart the computer or SweepMe!. Further you can try to reconnect your USB-RS232 adapter to create a fresh connection.
If the error still persists, we would need to check in more detail which application holds access to COM4 on your computer.
Thank you for your quick and complete response. I did everything and the problems persist.
I attach the error message and the debug log.
Thanks
SweepMe! version 1.5.6.11
Debug: 23.5.2024 13:41:12 Run started
Time: 23.5.2024 13:41:12
Python Error:
Traceback (most recent call last):
File “pysweepme\PortManager.py”, line 175, in get_port
File “pysweepme\Ports.py”, line 250, in get_port
File “pysweepme\Ports.py”, line 569, in open
File “pysweepme\Ports.py”, line 1040, in open_internal
File “serial\serialwin32.py”, line 64, in open
serial.serialutil.SerialException: could not open port ‘COM4’: PermissionError(13, ‘Acceso denegado.’, None, 5)
Debug: 23.5.2024 13:41:12 Run stopped
Debug: 23.5.2024 13:41:54 Run started
Time: 23.5.2024 13:41:54
Python Error:
Traceback (most recent call last):
File “pysweepme\PortManager.py”, line 175, in get_port
File “pysweepme\Ports.py”, line 250, in get_port
File “pysweepme\Ports.py”, line 569, in open
File “pysweepme\Ports.py”, line 1040, in open_internal
File “serial\serialwin32.py”, line 64, in open
serial.serialutil.SerialException: could not open port ‘COM4’: PermissionError(13, ‘Acceso denegado.’, None, 5)
A permission error is a very early error that happens even before the first message is sent, just when SweepMe! tries to open the COM port which already fails.
SweepMe! uses the Python library pyserial for COM port communication. If you search the internet for “pyserial permission error” you can find many cases where people have the same error independent whether they use SweepMe! or any other Python based software.
The typical problem is that some program or process on your computer already opened the COM port and because the access to COM ports is exclusive it is not possible to open them again from another process. What I read so far is that most people struggle to find straight-forward solution.
So what can be done?
You could change the COM port number:
Go to “Advanced…” in the COM port properties of the Windows Device Manager and select a higher COM port number. Maybe there is a process on your computer that tries to connect to COM4 and you can solve it if you switch to another number.
Try to update a newer hardware driver for the Prolific USB-to-Serial adapter in the Windows Device Manager
Try to find a process on your computer that is opening COM4 and close it.
So far COM port communication is handled via the library pyserial in SweepMe!. We could release an update of SweepMe! that allows you to connect to a COM port via the visa runtime (similar to NI-MAX). The resource would then have the name ASRL4. If the above steps do not help, I can provide a test script to check whether communication via visa runtime helps in your case.
I finally changed the computer and now everything works. Maybe software problems were the problems. Thanks for your support.
Just one last question. I want to measure only voltage with the Keithley SMU 2400 (without current). I set up a tree with Makefile, loop and SMU (current sweep mode, sweepEditor from start 0 to end 0). The problem is that I think the current source is sending current because the voltage value increases progressively.
your approach is already the correct one. When an SMU is used in current source mode with a set value of 0A, it is become a “voltmeter”.
SweepMe! still measures the current at the same time as the Keithley 2400 driver always returns both, measured voltage and measured current. So even if you source a current of 0A, you can measure the real current flow and you could check whether there is something strange with the current.
Another problem could occur if your compliance is not large enough. If you source a current, the compliance must be selected in Volt. In case your measured voltage is larger than the compliance, it could happen that the SMU automatically adapts the current flow to keep voltage below the compliance value.
In the above screenshot, a compliance of 10 V is selected. The compliance depends on the sweep mode. In case of sourcing a voltage, the compliance is in A. In case of sourcing a current, the compliance is entered in V.
If it still does not work, feel free to create a new topic and send some plots of current or voltage over time to describe the observed behavior in more detail.