I’ve been intrigued by the possibility to control the bench multimeter PeakTech’s 4095 remotely via SCPI commands. After unboxing the device, it seems it does not support DHCP, so one has to set the IP address manually. Furthermore, one has to enable network access manually after each power cycle.
Using the easy_scpi
library, one can connect to the device with a pyvisa
string. An example, how to accomplish this with P4095 is shown below.
import easy_scpi as scpi
ip_address = "192.168.1.2"
port = 3000
instrument = scpi.Instrument(f"TCPIP::{ip_address}::{port}::SOCKET",
port_match=False,
read_termination="\n",
write_termination="\n")
SCPI commands allow to change the primary and secondary measurement quantities. However, a quirk in the protocol requires the function to be enclosed in double quotes. The following lines show how to set the primary measurement mode to AC voltage and the secondary to frequency.
instrument.sens.func1('"VOLT:AC"')
instrument.sens.func2('"FREQ"')
Using easy_scpi
provides a versatile way to control arbitrary SCPI devices.
However, it would be great to have a library aware of the specific device
providing an interface with only valid commands and valid arguments.
This might also interest you