CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Mar 19, 2019 7:51 pm

All times are UTC+01:00

Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Mar 09, 2018 9:56 pm 

Joined: Sat Jul 25, 2015 7:41 pm
Posts: 1
Hello all,
I have a problem , I want to delete the buffer because when I receive the next message it will simply overwrite the previous message and not entirely delete it.
I tried to follow the example from CAA library but it is the same as use UDP_Receive function.

UDPPeer(xEnable:= xEnable, ipAddr:= IPAddress, uiPort:= uiPort, hPeer=> Peer);
CASE eState OF

   0: // Init
      IPAddress.sAddr:= ''; // IP Adress where Codesys application is running
      uiPort:= 1202;
      xEnable:= TRUE;
      eSTATE := 10;

   10: // Start listening
      IF UDPPeer.xActive THEN
            IF UDPReceive_Buffer.xReady THEN
               SBM.ENQueueBuffer(hQueue:= hqueue, hBuffer:= UDPReceive_buffer.hBuffer);
               hqueue1:= SBM.DeQueueBuffer(hQueue:=hqueue,peError:=CAA.gc_hINVALID);
               udpData :=   sReceived; // Data from UDP-stream
               ctRecAnswers := ctRecAnswers + 1; // Number of UDP calls
               sReceived := ' ' ;
               SBM.DeleteBuffer (hBuffer:=hqueue1);
            ELSIF UDPReceive_Buffer.xError THEN
               eState:= 20;
         eState:= 20;

   20: // Error

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited