<div dir="ltr"><div>small update:</div><div><br></div><div>1st: thanks for all commands.</div><div><br></div><div>2nd: There must be two leading "*" symbols for Synchronisation.</div><div><br></div><div>3rd: the command (e.g. "A_r_106_0") can not be written in one single string. Instead each symbol of the command must be send separatly.</div><div><br></div><div><br></div><div>example:</div><div><br></div><div>writeserial(h,"**A"); // **A is the only part of the command that can be send in one string</div><div>xpause(echotime);</div><div><br></div><div>writeserial(h,"_");</div><div>xpause(echotime);</div><div><div>writeserial(h,"r");</div><div>xpause(echotime);</div></div><div><br></div><div>...etc</div><div><br></div><div>// to end the command</div><div>writeserial(h,ascii(21));</div><div>xpause(echotime);</div><div><br></div><div><br></div><div>buf = readserial(h);</div><div><br></div><div>// buf contains the echo of the command a . -Symbol and the answer</div><div><br></div><div>// e.g. A_r_106_0 .value</div><div><br></div><div><br></div><div>Greetings,</div><div>Philipp</div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-16 17:08 GMT+02:00 Samuel Gougeon <span dir="ltr"><<a href="mailto:sgougeon@free.fr" target="_blank">sgougeon@free.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hello Philipp,<br>
Thanks for the device pointer: very helpful to help you.<span><br>
<br>
Le 16/08/2016 16:27, Philipp Mühlmann a écrit :<br>
</span></div><span>
<blockquote 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></span>
.<br>
Beware about the leading space: ," 9600,n,8,2" or "9600,n,8,2"?<span><br>
<blockquote 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></span>
.<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 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><span class="HOEnZb"><font color="#888888">
Samuel<br>
<br>
</font></span></div>
<br>______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank" rel="noreferrer">http://lists.scilab.org/<wbr>mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.</div><div><br></div><div>There we have the salad.</div></div></div>
</div>