07-04-2015 04:50 PM
I am trying to communicate with a Lakeshore 331 Temperature Controller via RS-232 serial interface. I would like to query the instrument's identification information and current temperature reading. I am using the following code, but the output comes back jarbled:
lakeshore331 = visa('ni','ASRL3::INSTR'); set(lakeshore331,'InputBufferSize',3000000,'Timeout',5.0); fopen(lakeshore331);
iden = query(lakeshore331,'*IDN?')
temp = query(lakeshore331,'KRDG?')
fclose(lakeshore331); delete(lakeshore331); clear('lakeshore331');
Here's the output that results:
iden =
LÓCI,ÍOÄEL³³1E,³°¶°¶1,°³2³°1 Š
temp =
«7¹®¹¹8 Š
Do you have any suggestions for how to clean up the output?
07-04-2015 06:32 PM
07-05-2015 04:24 AM - edited 07-05-2015 04:25 AM
I have checked that the computer can communicate via the serial port in both MAX and PuTTy. The "3" in lakeshore331 = visa('ni','ASRL3::INSTR'); sets the port number to COM3. The output is still coming in distorted from the instrument.
07-05-2015 05:55 AM