Engee documentation

VISA software control

To operate the VISA software control functions in Engee, install the Hardware Operation Support Package by executing the following commands at command line img 41 1 2:

engee.package.install("Engee-Device-Manager")
using Main.EngeeDeviceManager

This page shows all available features of VISA programme management in Engee.

VISA methods

VISA.close_instrument(visa::Any, port::String)

Releases the bus for an instrument connected via VISA specification.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the device connected via the VISA specification. Can be obtained with the function VISA.get_ports(visa::Any).

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
VISA.create_instrument(visa, port)
VISA.close_instrument(visa, port)
VISA.close_session(visa::Any)

Closes the VISA session.

Arguments

visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object.

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
VISA.close_session(visa)
VISA.create_instrument(visa::Any, port::String)

Creates an instance of the instrument connected on the specified port.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via the VISA specification. Can be obtained with the function VISA.get_ports(visa::Any).

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
VISA.create_instrument(visa, port)
VISA.create_session(visa::Any, backend:String)

Creates a session for working with VISA.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • backend::String: hardware implementation of the VISA specification, e.g. "@py" or "@ni".

Examples

VISA.create_session(visa, "@py")
VISA.flush(visa::Any, port::String, flush_type::String)

Clears the I/O buffer of the instrument.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via VISA specification. Can be obtained with the function VISA.get_ports(visa::Any).

  • flush_type::String: purge type. For example: "flush_write_buffer" or "flush_transmit_buffer".

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
VISA.create_instrument(visa, port)
VISA.flush(visa, port, "flush_write_buffer")
VISA.get_ports(visa::Any)

Gets a list of available physical ports.

Arguments

visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object.

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
VISA.read(visa::Any, port::String, termination::String)

Reads data from the instrument.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via the VISA specification. Can be obtained with the function VISA.get_ports(visa::Any).

  • termination::String: instrument-specific read termination character. If not defined, leave empty "".

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
read_result = VISA.read(visa, port, "").data
VISA.readbinblock(visa::Any, port::String, size::Int64)

Reads binary data from the instrument.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via VISA specification. Can be obtained using the function VISA.get_ports(visa::Any).

  • size::Int64: buffer size for reading bytes, for example: 8.

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
bytes = VISA.readbinblock(visa, port, 8).data
VISA.visatrigger(visa::Any, port::String)

Sends interrupt commands to the device.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via the VISA specification. Can be obtained with the function VISA.get_ports(visa::Any).

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
VISA.visatrigger(visa, port)
VISA.write(visa::Any, port::String, message::String, termination::String)

Records messages in the instrument.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via the VISA specification. Can be retrieved using the function VISA.get_ports(visa::Any).

  • message::String: message with SCPI command. For example: "RST;:SYSTEM:LOCK OFF" to reset.

  • termination::String: instrument specific write termination character. If not defined, you must leave blank "".

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
VISA.create_instrument(visa, port)
numbytes = VISA.write(visa, port, "*RST;:SYSTEM:LOCK OFF", "").data
VISA.writebinblock(visa::Any, port::String, message::Vector{UInt8})

Writes binary data to the device.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via the VISA specification. It can be obtained with the function VISA.get_ports(visa::Any).

  • message::Vector{UInt8}: binary data to be written. For example: [0x01, 0x00].

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
numbytes = VISA.writebinblock(visa, port, [0x01, 0x00]).data
VISA.writeread(visa::Any, port::String, message::String, delay::Float64)

Writes in the instrument and reads the answer.

Arguments

  • visa::Any: VISA specification object. The command visa = VISA.Visa() is used to create the object .

  • port::String: port of the instrument connected via the VISA specification. Can be retrieved using the function VISA.get_ports(visa::Any).

  • message::String: message with SCPI command. For example: ":CHAN1:BASE:WAV?" will return the signal type in channel one.

  • delay::Float64: delay to receive a response from the instrument (optimal value 1.0, for older instruments up to 1.5). For more information about the response delay, please refer to the documentation of the instrument you are using.

Examples

VISA.create_session(visa, "@py")
ports = VISA.get_ports(visa).data
port = last(ports)
writeread_result = VISA.writeread(visa, port, ":CHAN1:BASE:WAV?", 1.2).data