Tsp-Net Versus Tsp-Link To Communicate With Tsp-Enabled Devices - Keithley 2651A Reference Manual

High power system sourcemeter instrument
Hide thumbs Also See for 2651A:
Table of Contents

Advertisement

Section 6: Instrument programming
4. Retrieve responses from the remote device using tspnet.read. The Model 2651A suspends
operation until data is available or a timeout error is generated. You can check if data is available
from the remote device using tspnet.readavailable().
5. Disconnect from the remote device using tspnet.disconnect(). Terminate all remote
connections using tspnet.reset().
Example script
The following example demonstrates how to connect to a remote non-TSP
and receive data from this device:
-- Disconnect all existing TSP-Net connections.
tspnet.reset()
-- Set tspnet timeout to 5 seconds.
tspnet.timeout = 5
-- Establish connection to another device with IP address 192.168.1.51
-- at port 1394.
id_instr = tspnet.connect("192.168.1.51", 1394, "*rst\r\n")
-- Print the device ID from connect string.
print("ID is: ", id_instr)
-- Set termination character to CRLF. You must do this on a per
-- connection basis after connection has been made.
tspnet.termination(id_instr, tspnet.TERM_CRLF)
-- Send the command string to the connected device.
tspnet.write(id_instr, "*idn?" .. "\r\n")
-- Read the data available, then print it.
print("instrument write/read returns: ", tspnet.read(id_instr))
-- Disconnect all existing TSP-Net sessions.
tspnet.reset()

TSP-Net versus TSP-Link to communicate with TSP-enabled devices

The TSP-Link
between the Model 2651A and another TSP-enabled instrument. The advantages of using the
TSP-Link network interface over using TSP-Net
Error checking: When connected to a TSP-enabled device, all errors that occur on the remote
device are transferred to the error queue of the Model 2651A. The Model 2651A indicates errors
from the remote device by prefacing these errors with "Remote Error".
For example, if the remote device generates error number 4909, the Model 2651A generates the
error string "Remote Error: (4909) Reading buffer not found within device."
Digital I/O triggering: TSP-Link connections have three synchronization lines that are available
to each device on the TSP-Link network. You can use any one of the synchronization lines to
perform hardware triggering between devices on the TSP-Link network. Refer to Hardware trigger
modes for more details.
6-62
Model 2651A High Power System SourceMeter® Instrument Reference Manual
®
network interface is the preferred communication method when communicating
®
commands include:
2651A-901-01 Rev. A / March 2011
®
enabled device, and send

Advertisement

Table of Contents
loading

Table of Contents