<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to serial communication - document scanner.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/02db1084d8/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/02db1084d8/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/02db1084d8/</id><updated>2020-03-08T15:33:07.990000Z</updated><subtitle>Recent posts to serial communication - document scanner.</subtitle><entry><title>serial communication - document scanner.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/02db1084d8/?limit=25#601d" rel="alternate"/><published>2020-03-08T15:33:07.990000Z</published><updated>2020-03-08T15:33:07.990000Z</updated><author><name>ctrlsys</name><uri>https://forge.codesys.com/u/ctrlsys/</uri></author><id>https://forge.codesys.com570912e518ae3ceaf738f9974545cad56b6dd05a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;br/&gt;
I have a question about serial communication. I'm trying to get data from a document scanner that returns values on several lines. How to save data to variable (s). I am using the SerialComWithVisu example.&lt;/p&gt;
&lt;p&gt;comRead(xExecute:= TRUE, hCom:= hCom, pBuffer:= ADR(bReadBuffer), szBuffer:= SIZEOF(bReadBuffer));&lt;br/&gt;
        IF comRead.xDone THEN&lt;br/&gt;
            szRead:= comRead.szSize;&lt;br/&gt;
            //check if the Port has send something&lt;br/&gt;
            IF szRead &amp;gt; 0 THEN&lt;br/&gt;
                //the text from the read buffer is saved in the sReadText variable&lt;br/&gt;
            MEM.MemMove(ADR(bReadBuffer), ADR(sReadText), ANY_TO_UINT(szRead));&lt;br/&gt;
            MEM.MemFill(ADR(sReadText) + ANY_TO_UINT(szRead), 1, 0);&lt;br/&gt;
            xReadSuccess:= TRUE;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>