<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hello Philipp,<br>
Thanks for the device pointer: very helpful to help you.<br>
<br>
Le 16/08/2016 16:27, Philipp Mühlmann a écrit :<br>
</div>
<blockquote
cite="mid:CACf7ODu3UkFk0j5qOvF4D9EMW=ja1fzeHJsN3gExPNxadfksRg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>OK,</div>
<div><br>
</div>
<div>it seems I need stopbit = 2; // at leas a working C-code
has this setting</div>
<div><br>
</div>
<div><br>
</div>
<div>so:</div>
<div><br>
</div>
<div> h = openserial(1," 9600,n,8,2");</div>
</div>
</blockquote>
.<br>
Beware about the leading space: ," 9600,n,8,2" or "9600,n,8,2"?<br>
<blockquote
cite="mid:CACf7ODu3UkFk0j5qOvF4D9EMW=ja1fzeHJsN3gExPNxadfksRg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>but with this, I get as a result the command back as a
string when I use "readserial()"</div>
<div><br>
</div>
<div><br>
</div>
<div>Example:</div>
<div><br>
</div>
<div>h = openserial(1," 9600,n,8,2");</div>
<div><br>
</div>
<div>ret = writeserial(h, " *A_r_106_0 " );<br>
</div>
</div>
</blockquote>
.<br>
Same remark: there should not be any leading and trailing space:
"*A_r_106_0"<br>
Moreover:<br>
<ul>
<li>leading "*": in the doc, it is not clear whether this char
must be explicitly prepended to the actual command, or if it is
always automatically prepended. Or if it must be sent apart,
alone, before the actual command.<br>
You may try each method.<br>
<br>
</li>
<li>trailing "§": AFAIU the doc, it looks necessary to append "§"
to each command. For many devices, ascii(10)==\n is used, but
for this device, it looks to be "§". You may try with it.<br>
</li>
</ul>
<blockquote
cite="mid:CACf7ODu3UkFk0j5qOvF4D9EMW=ja1fzeHJsN3gExPNxadfksRg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
result = readserial(h);</div>
</div>
</blockquote>
.<br>
Before reading, you may try inserting a sleep(..) to wait the answer
before reading it. When not waiting, usually we get nothing in the
output buffer. Noticeably because here the connection here is slow
(9600 bauds)<br>
Try first with a quite long sleep -- say 1 second -- and when you
will have the connexion and a proper answer, you will be able to
decrease and tune this wait time.<br>
<br>
HTH <br>
Samuel<br>
<br>
</body>
</html>