Instrument Control: Communication via GPIB - Problem with replacement of line feed character

Hi,
I am experiencing a problem when communicating with a device via GPIB using Matlab (2008b 32bit). Connecting to the device and simple commands work fine. Now, the problem shows up when I try to send a command that includes a line feed '<LF>' as part of the programming syntax, e.g:
:SEQUENCE:DEFINE: "A.SEQ", #223WAVE1.WFM,1<LF>WAVE2.WFM,1
In Matlab code:
  • Loading without line feed works (one file only):
fprintf(Dev, ':SEQUENCE:DEFINE: "A.SEQ", #211WAVE1.WFM,1');
  • Loading with line feed does not work:
fprintf(Dev, [':SEQUENCE:DEFINE: "A.SEQ", #223WAVE1.WFM,1' '\n' 'WAVE2.WFM,1']);
I recorded the communication over the GPIB controller and compared with a working Labview program. The problem it seems is that Matlab removes the line feed ('\n' or char(10)) from the string send to the device.
In a manual for the instrument control toolbox I read that all line feed commands in a string send via fprintf to the GPIB controller are replaced by the EOSCharCode, if the EOSMode is set to 'Read' or 'Read&Write'.
In my case the EOSMode is set to 'none', so I expect that line feeds are not replaced. Instead Matlab just removes the line feeds without subsitute.
Is there a way around this problem - to tell Matlab to keep the line feeds untouched.
Thanks
Best Regards

Answers (0)

Categories

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

Asked:

on 19 Mar 2012

Community Treasure Hunt

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

Start Hunting!