MATLAB: Am I not able to use the Photo Research PR-650 colorimeter with the SERIAL function in MATLAB 7.1 (R14SP3)

MATLABpr705

I would like to access my Photo Research device using the serial port. However, after requesting measurements from the device using the following code:
s = serial('COM1')
fopen(s)
fprintf(s,'E')
fprintf(s,'M')
PR650resp = fscanf(s)
close(s)
I receive the following warning:
Warning: A timeout occurred before the Terminator was reached.
PR650resp =
''

Best Answer

As the warning message indicates, the serial read timed out. This has two probable causes:
1. The serial connection is not configured properly. Photo Research Remote Mode uses communications parameters and commands that vary by model. Please refer to your device documentation for flow control and terminator settings and exact command syntax.
For example, in this instance the commands should have been specified as:
s = serial('COM1')
fopen(s)
cmd = ['S1,,,,,0,1,1\n']
fprintf(s,'%s\n', cmd)
fprintf(s,'E\n')
fprintf(s,'M\n')
m=fscanf(s)
close(s)
2. Some measurements take longer than the default 10 second timeout on serial objects. You can adjust this timeout using the TIMEOUT property:
s.Timeout = 30