Hello, I am presently attempting to run a Keithley 2612 sourcemeter in Matlab, but from the list of variables I obtain by the 'get' command I can't determine how to ask for data to be displayed in Matlab. Has anyone used this instrument?

3 views (last 30 days)
Hello, I am presently attempting to run a Keithley 2612 sourcemeter in Matlab, but from the list of variables I obtain by the 'get' command I can't determine how to ask for data to be displayed in Matlab. Has anyone used this instrument? The variables I am told about from the get command are the follows:
ByteOrder = littleEndian
BytesAvailable = 0
BytesAvailableFcn =
BytesAvailableFcnCount = 48
BytesAvailableFcnMode = terminator
BytesToOutput = 0
ErrorFcn =
InputBufferSize = 512
Name = Serial-COM4
ObjectVisibility = on
OutputBufferSize = 512
OutputEmptyFcn =
RecordDetail = compact
RecordMode = overwrite
RecordName = record.txt
RecordStatus = off
Status = open
Tag =
Timeout = 10
TimerFcn =
TimerPeriod = 1
TransferStatus = idle
Type = serial
UserData = []
ValuesReceived = 0
ValuesSent = 0
SERIAL specific properties:
BaudRate = 9600
BreakInterruptFcn =
DataBits = 8
DataTerminalReady = on
FlowControl = none
Parity = none
PinStatus = [1x1 struct]
PinStatusFcn =
Port = COM4
ReadAsyncMode = continuous
RequestToSend = on
StopBits = 1
Terminator = LF
  1 Comment
Md Naim Patoary
Md Naim Patoary on 27 May 2020
Hi,
were you able to solve the issue later on? I am using the same SMU. Can you please help me with the information of which list of commands does the sourcemeter takes from matlab? I am trying to find them online so far. I connected my matlab to smu using Visa USB connection.
Thank you

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 5 Jul 2017
None of those.
You have BytesAvailableFcnMode = terminator which hints that the communication with the device is probably in text form rather than in binary form (because in binary form, any given terminator byte value might occur accidentally.) If you want to see the data line by line you should use fgetl() on the device once per input line; if you are expecting a formatted block of numbers represented in text, then you would be more likely to use fscanf() on the device providing it with an appropriate format and size limit.
If you want data to be processed as it arrives you should set the BytesAvailableFcn property to the handle of a function that will read and process values.

Categories

Find more on Instrument Control Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!