Okay, I believe I fixed it. I cannot explain why this works... here is the command history as well as the output. Basically I had to assert DTR low, open the connection, assert DTR high then begin. Any reason why this might be?
EDU>> serialObject = serial('COM4')
Serial Port Object : Serial-COM4
Communication Settings
Port: COM4
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: closed
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
EDU>> set(serialObject, 'BaudRate', 9600);
set(serialObject, 'Parity', 'none');
set(serialObject, 'ReadASyncMode', 'continuous');
set(serialObject, 'StopBits', 2);
set(serialObject, 'Timeout', 5);
set(serialObject, 'RequestToSend', 'off');
set(serialObject, 'DataTerminalReady', 'off');
set(serialObject, 'FlowControl', 'none');
EDU>> get(serialObject)
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 = closed
Tag =
Timeout = 5
TimerFcn =
TimerPeriod = 1
TransferStatus = idle
Type = serial
UserData = []
ValuesReceived = 0
ValuesSent = 0
SERIAL specific properties:
BaudRate = 9600
BreakInterruptFcn =
DataBits = 8
DataTerminalReady = off
FlowControl = none
Parity = none
PinStatus = [1x1 struct]
PinStatusFcn =
Port = COM4
ReadAsyncMode = continuous
RequestToSend = off
StopBits = 2
Terminator = LF
EDU>> fopen(serialObject)
EDU>> get(serialObject)
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 = 5
TimerFcn =
TimerPeriod = 1
TransferStatus = idle
Type = serial
UserData = []
ValuesReceived = 0
ValuesSent = 0
SERIAL specific properties:
BaudRate = 9600
BreakInterruptFcn =
DataBits = 8
DataTerminalReady = off
FlowControl = none
Parity = none
PinStatus = [1x1 struct]
PinStatusFcn =
Port = COM4
ReadAsyncMode = continuous
RequestToSend = off
StopBits = 2
Terminator = LF
EDU>> set(serialObject, 'DataTerminalReady', 'on')
EDU>> fprintf(serialObject, '*IDN?')
EDU>> fscanf(serialObject)
ans =
HEWLETT-PACKARD,34401A,0,11-5-2
EDU>> fclose(serialObject)
EDU>> delete(serialObject)