Hello
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.
comRead(xExecute:= TRUE, hCom:= hCom, pBuffer:= ADR(bReadBuffer), szBuffer:= SIZEOF(bReadBuffer));
IF comRead.xDone THEN
szRead:= comRead.szSize;
//check if the Port has send something
IF szRead > 0 THEN
//the text from the read buffer is saved in the sReadText variable
MEM.MemMove(ADR(bReadBuffer), ADR(sReadText), ANY_TO_UINT(szRead));
MEM.MemFill(ADR(sReadText) + ANY_TO_UINT(szRead), 1, 0);
xReadSuccess:= TRUE;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
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.
comRead(xExecute:= TRUE, hCom:= hCom, pBuffer:= ADR(bReadBuffer), szBuffer:= SIZEOF(bReadBuffer));
IF comRead.xDone THEN
szRead:= comRead.szSize;
//check if the Port has send something
IF szRead > 0 THEN
//the text from the read buffer is saved in the sReadText variable
MEM.MemMove(ADR(bReadBuffer), ADR(sReadText), ANY_TO_UINT(szRead));
MEM.MemFill(ADR(sReadText) + ANY_TO_UINT(szRead), 1, 0);
xReadSuccess:= TRUE;