<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Communication with USBRLY82]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I am trying to connect to a USBRLY82 (RobotElectronics) board over serial port (ttyACM0).</p>
<p dir="auto">I have no problem sending commands to the board and action relays on it. Where I am facing issues is reading the DI status from the board and that is because to read the state of those DI’s I need to first Write() to the board and the board will send back the status once it receives the command. The value returned by the board is the value that I am trying to get. I can not get it through Read() since the Write() is non-blocking and by the time it get’s executed, the data sent by the USBRLY82 board as an answer, is not there anymore.</p>
<p dir="auto">Is there anything that can help me with this? The read and write commands in REXLANG C-like are non-blocking. Can you please let me know if there is anything that I can do about it?</p>
<p dir="auto">Best regards,<br />
George</p>
]]></description><link>https://forum.rexygen.com/topic/386/communication-with-usbrly82</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 08:34:10 GMT</lastBuildDate><atom:link href="https://forum.rexygen.com/topic/386.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Jul 2023 13:02:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Communication with USBRLY82 on Thu, 13 Jul 2023 13:16:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi George,</p>
<p dir="auto">Thanks for your question. You need to create a kind of state machine which basically does the following (one line = one task period):</p>
<ul>
<li>Write() - send a read request to the device</li>
<li>Read() - save received data and length into a global buffer/variable and distinguish if the received message is complete</li>
<li>Retry and repeat Read() if the previously received message was not complete</li>
</ul>
<p dir="auto">You will need to introduce a timeout - it can happen that you lost some data so there should be some timeout when you say "Message incomplete, resend the read request".</p>
<p dir="auto">Cheers,<br />
Tomas</p>
]]></description><link>https://forum.rexygen.com/post/1277</link><guid isPermaLink="true">https://forum.rexygen.com/post/1277</guid><dc:creator><![CDATA[cechurat]]></dc:creator><pubDate>Thu, 13 Jul 2023 13:16:24 GMT</pubDate></item></channel></rss>