Created
November 13, 2025 23:47
-
-
Save xkstein/8210dec8c9b13d63da46315e3861eed2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| This is an example connecting to the Yokogawa AQ6375-AQ6376 with LAN/pyvisa | |
| Our versions of these devices do not support VXI-11, so you have to use socket. | |
| This means you gotta have the @py backend for pyvisa and and address with format | |
| `TCPIP::<IP address>::<Port>::SOCKET` | |
| And you gotta add terminators. | |
| You also need to log into these devices by sending: | |
| `open "anonymous"` | |
| OSA Response: `AUTHENTICATE CRAM-MD5.` | |
| and a black ` ` space | |
| OSA Response: `ready` | |
| ''' | |
| import pyvisa | |
| rm = pyvisa.ResourceManager('@py') | |
| inst = rm.open_resource('TCPIP::192.168.0.76::10001::SOCKET') | |
| inst.write_termination = '\n' | |
| inst.read_termination = '\n' | |
| inst.timeout = 5000 | |
| print(inst.query('open "anonymous"')) | |
| print(initmsg := inst.query(' ')) | |
| assert initmsg.strip() == 'ready', 'Authentication/connection error' | |
| # Add normal osa code here | |
| inst.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment