help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get serial data from USB using instrument control


From: Andrius Sutas
Subject: Re: How to get serial data from USB using instrument control
Date: Thu, 25 Oct 2012 00:54:46 +0100


On Thu, Oct 25, 2012 at 12:07 AM, jd <address@hidden> wrote:
I'm still getting inconsistent data from it.  Here is a  Screen Shot
<http://imgur.com/BzgcL>   of what I'm getting.  I have a terminal window
that shows the output from Screen (not running at the same time as Octave)
just to show that correct data is there somewhere.





--
View this message in context: http://octave.1599824.n4.nabble.com/How-to-get-serial-data-from-USB-using-instrument-control-tp4645575p4645705.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave

You are getting exactly what you are sending. 

In your case, a string "1\r\n", which translates to 49, 13, 10 in ascii. "1" is 49 in ascii, "\n" is a newline (ascii 10), in you screenshot, you get "1" per line, and not a line of 1s, "\r" (ascii 13) is carriage return, in you screenshot, see how 1's are aligned to the left? without \r they would be in new line by one space to right making "steps of 1".

Again, use char(srl_read(s, 3)) if you want strings and not bytes without any modification to sender.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]