General functions

InstrumentConfig.initializeFunction
initialize(model::Type{Instrument})
initialize(model::Type{Instrument}, address::String; GPIB_ID::Int=-1)

Initializes a connection to the instrument at the given (input) IP address.

Arguments

  • model::Type{<:Instrument}: The device type you are connecting to. Use help> Instrument to see available options
  • address (optional): The ip address of the device. Ex. "10.3.30.23". If not provided, TcpInstruments will look for the address in the config file

Keywords

  • GPIB_ID: The GPIB interface ID of your device. This is optional and doesn't need to be set unless you are using a prologix controller to control it remotely

Returns

  • Instr: An instrument of the specified model connected to the given IP address.

Throws

  • 'Instrument was not found in your .tcp_instruments.yml file' if the specified model is not listed
source
InstrumentConfig.terminateFunction
terminate(instr::Instrument)

Closes the TCP connection.

Arguments

  • instr::Instrument: The device to close the TCP connection
source
TcpInstruments.infoFunction
info(instr::Instrument)

Asks an instrument to print model number and other device info.

Arguments

  • obj: Specified instrument to get device info
source
TcpInstruments.scan_networkFunction
scan_network(; network_id="10.1.30.0", host_range=1:255)

By default, report all found devices between addresses 10.1.30.1 to 10.1.30.255.

Searches for devices connected on port:

  • 5025 (scpi)
  • 1234 (prologix)

Keywords

  • network="10.1.30.": IP address
  • host_range=1:255: range for IP address

Returns

  • Array: IP Addresses
source
TcpInstruments.saveFunction
save(data)
save(data; format=:matlab)
save(data; filename="custom_file_name.ext")

Save data to a file

By default saves to julia format (.jld2) but can also export data to matlab by using the format=:matlab keyword argument

Arguments

  • data: data to be saved to file

Keywords

  • filename = "": default file name
  • format = :julia: default julia format
source
TcpInstruments.loadFunction
data = load("function load(filename)
")

Loads saved data from a file

Arguments

  • filename: name of file

Returns

  • Dict: data from file
source