Instin functions reference¶
This page contains the details of each instin.py function.
-
instin.close_term(IP: str, PORT: int) → None¶ This reboots the gateway
- Parameters
IP – Gateway’s IP
PORT – TCP port
-
instin.fillp2(path: str) → int¶ Auxiliary function for file transfer.
Expands the file of the input path to have a size multiple of 512
- Parameters
path – Input file path
- Returns
The new input file lenght
-
instin.open_inst(IP: str, PORT: int, VISA: str) → int¶ For opening instruments in the Gateway.
The instrument whose VISA address is VISA is opened in the Gateway The IP and the PORT are needed as always. An example of VISA address:
USB0::0x0957::0x179B::MY51250760::INSTR- Parameters
IP – Gateway’s IP
PORT – TCP port
VISA – Instrument’s VISA address
- Returns
The integer identifier the Gateways has associated to the instrument.
-
instin.query(IP: str, PORT: int, InstID: int, command: str) → str¶ To send SCPI commands and wait for an answer
- Parameters
IP – Gateway’s IP
PORT – TCP port
InstID – Integer identifier the Gateway associated to the instrument when it was opened with
open_instcommand – SCPI command to send to the Gateway
- Returns
The string answered by the instrumentation when sending the selected SCPI command.
-
instin.send_program(IP: str, PORT: int, NAME_IN: str, *NAMEs_OUT: str) → None¶ Can be used to send an entire program to the Gateway.
This enables the standalone mode, where all the measurement orders are coded in a program that is sent to the Gateway and launched. The host waits for receiving the files with the results of the measurement.
- Parameters
IP – Gateway’s IP
PORT – TCP port
NAME_IN – The name of the file with the program to be sent to the Gateway
*NAMEs_OUT – Name(s) of the file(s) that are going to be generated by the NAME_IN program and sent to the host
-
instin.sincro(IP: str, PORT: int) → None¶ Sends the time to the Gateway.
Sends
time.strftime('%m%d%H%M.%S')to the Gateway in the IP through the PORT.- Parameters
IP – Gateway’s IP
PORT – TCP port
-
instin.write(IP: str, PORT: int, InstID: int, command: str) → None¶ To send SCPI commands without waiting for an answer.
- Parameters
IP – Gateway’s IP
PORT – TCP port
InstID – Integer identifier the Gateway associated to the instrument when it was opened with
open_instcommand – SCPI command to send to the Gateway