IFgCmdExecDoneTHEN
          strCmdDone:=DELETE(strRecv, 2, iPos);
          strSendDone:=CONCAT(strCmdDone,',DONE');
          strSendDone:=CONCAT(strSendDone,'$R$N');      (* $R$N = <CR><LF> *)
          gStrSend:=strSendDone;
          diSent:=TcpSendData(Client.diSocket, ADR(strSendDone), SIZEOF(strSendDone), 50);
          IFdiSent<=0THEN(*Problemoccured*)
            CloseSocket(ADR(Client.diSocket));
            Client.stIPAddress:='';
            LifeSignTimeoutTimer(IN:=FALSE);
          ELSE
            bSent:=TRUE;
            LifeSignTimer(IN:=FALSE);
            strSendDone:='';
            SysMemSet(dwDest:=ADR(diSent), bCharacter:=0, dwCount:=SIZEOF(diSent));
          END_IF
           END_IF
The response marked red above is what bothers me. Meaning that a trace of old response (Response 1) is still there and was send together with (Response 2).
I've tried SysMemSet and SysMemFree but to no avail.
Is the response saved into any of the PLCs memory?!? If yes, how can i access them and clear after every reponse being received?
Thank you in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the string is not complete send it is still in memory giving this type.
i can not read all of your code as i am missing all the commands and functions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
I've created a program to communicate with a Festo PLC using Hyper Terminal.
When I send a command, it sometimes response with a correct response but with an addition of "previous" response.
For example:
Command1: Timeout=t#20s<cr><lf>
Response1: Timeout=t#20s,DONE<cr><lf></lf></cr></lf></cr>
Command2: Get<cr><lf>
Response2: Get,DONE<cr><lf>20s,DONE<cr><lf></lf></cr></lf></cr></lf></cr>
An extract of the program looks like this:
The response marked red above is what bothers me. Meaning that a trace of old response (Response 1) is still there and was send together with (Response 2).
I've tried SysMemSet and SysMemFree but to no avail.
Is the response saved into any of the PLCs memory?!? If yes, how can i access them and clear after every reponse being received?
Thank you in advance
If the string is not complete send it is still in memory giving this type.
i can not read all of your code as i am missing all the commands and functions.