Hello all,
I am looking to set up my 6221 current source to be controlled via ethernet. I can successfully ping the device and validate it's existence using NI-VISA configuration.
I am however unable to control the device using visa commands (via pyvisa wrapper). An example snippet of python code:
import visa
visa.get_instruments_list()
# Does not return keithly connected via ethernet
keithly = visa.instrument('keithly_6221') # currently using pyvisa pre-dating 1.5.. this is the alias I defined in MAX.
keithly.ask('*IDN?')
... And then get a timeout error.
I have read this maybe a problem with termination characters. I am not sure how to use these and could find very little information on them. I have tried sending various strings:
keithly.ask('*IDN?\n')
keithly.ask('*IDN?<CR>') and so on..
But to no avail.
If anyone has any experience with this your help would be much appreciated.
EDIT:
Using the VISA test panel I can successfully write '*IDN?\r' to the instrument and then read it. But the same command does not work using python.
Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.
6221 ethernet control with Pyvisa
-
- Keithley Applications
- Posts: 1263
- Joined: October 15th, 2010, 10:35 am
- Country: United States
- Contact:
Re: 6221 ethernet control with Pyvisa
Assuming IP address of instrument is 10.10.10.10, try this:
keithly = visa.instrument("TCPIP::10.10.10.10::1394::SOCKET")
keithley.term_chars = "\n"
keithley.ask("*IDN?")
Modify for your IP address.
keithly = visa.instrument("TCPIP::10.10.10.10::1394::SOCKET")
keithley.term_chars = "\n"
keithley.ask("*IDN?")
Modify for your IP address.
Re: 6221 ethernet control with Pyvisa
Brilliant thanks - this worked!
Could of sworn I tried this but must of used a different termination character!
Could of sworn I tried this but must of used a different termination character!
Who is online
Users browsing this forum: No registered users and 2 guests