Keithley 708B Reference Manual page 168

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Models 707B and 708B Switching Matrix Reference Manual
When the response is a comma-delimited string, the individual return items can be identified by
iterating through the list using the comma delimiters. For example, the Lua code below will start at the
beginning of a string and break the string into individual items at each comma. The tonumber()
function is used on each item to determine if it is a number or not. In either case, the value is printed.
index1 = 1
index2 = 1
text = "123,abc,hello,4.56"
endIndex = string.len(text)
while index2 ~= endIndex do
index2 = string.find(text, ",", index1)
if not index2 then
index2 = endIndex
end
subString = string.sub(text, index1, index2 - 1)
if not number(subString) then
print(subString)
else
print(tonumber(subString))
end
index1 = index2 + 1
end
707B-901-01 Rev. A / August 2010
Section 5: Remote commands
5-7

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents