Problem with WebClient / http post

golu
2019-11-12
2021-08-19
  • golu - 2019-11-12

    Dear all,
    I have a problem while using the WebClient package for sending Data to a server.
    I have bought the WebClient library for sending Data via http.
    I created a function block for the use of the webclient function with Basic Authentification.
    Now, if I want to send the data (different temperature values) I have no problem to send the first data blocks, but after a various number of sent data I get a TCP INIT error. I have no explaination, why I get the TCP INIT error. I am using the same login data like in the function blocks before.

    Did anyone already had the same problem? Do you have any idea what could be the problem?

    Thank you very much for your help!!!

    IMG: screenshot_error.PNG

    IMG: Screenshot_Baustein.PNG

    IMG: screenshot_problem.PNG

     
  • bernie-bbq - 2021-08-19

    Hi,

    I have the ,exact same fault.... happens occasionally when sending API online via http & Jason.

    did anyone have an answer for this ?

    Thx

    BBQ

     
  • hermsen

    hermsen - 2021-08-19

    hi Bernie,

    You must read the outputs xDone, xBusy, xError & eError each cycle.
    after that you can use them to influence the Client function block, eg like this example pseudo code

    IF xError THEN
    eErrMsg := Client.eError; // Store error message for further use
    END_IF;
    xExecute := xDone AND NOT xBusy AND NOT xError; // NOT xExecute will probably reset the client? See FB help

     
    • bernie-bbq - 2021-08-19

      Hi,

      Thanks ... I am self taught and appreciate that help. But in the meanwhile
      I have come up with another possible fix which seems to have worked (so
      far). I discovered the error message 'hidden' in the Variables under
      WebClient 'xError' given as "TCP_INIT_ERROR'. Thus my Google search and I
      found the Codesys message below. This had been an ongoing (regular) fault
      which threatened to crash my home solar diversion project which is now 90 %
      complete. All I had to do was to change the input word "FALSE' to 'TRUE'
      !! If the solution below does not continue to work reliably I will utilise
      your code.

      Your help is much appreciated

      BernieBBQ

      On Thu, 19 Aug 2021 at 23:32, h-hermsen forge@codesys.com wrote:

      hi Bernie,

      You must read the outputs xDone, xBusy, xError & eError each cycle.
      after that you can use them to influence the Client function block, eg
      like this example pseudo code

      IF xError THEN
      eErrMsg := Client.eError; // Store error message for further use
      END_IF;
      xExecute := xDone AND NOT xBusy AND NOT xError; // NOT xExecute will
      probably reset the client? See FB help


      Problem with WebClient / http post
      https://forge.codesys.com/forge/talk/Engineering/thread/899dfc91dd/?limit=250#638b


      Sent from forge.codesys.com because you indicated interest in
      https://forge.codesys.com/forge/talk/Engineering/

      To unsubscribe from further messages, please visit
      https://forge.codesys.com/auth/subscriptions/

       
  • hermsen

    hermsen - 2021-08-19

    hi Bernie,

    You must read the outputs xDone, xBusy, xError & eError each cycle.
    after that you can use them to influence the Client function block, eg like this example pseudo code

    IF xError THEN
    eErrMsg := Client.eError; // Store error message for further use
    END_IF;
    xExecute := xDone AND NOT xBusy AND NOT xError; // NOT xExecute will probably reset the client? See FB help

     
  • hermsen

    hermsen - 2021-08-19

    hi Bernie,

    You must read the outputs xDone, xBusy, xError & eError each cycle.
    after that you can use them to influence the Client function block, eg like this example pseudo code

    IF xError THEN
    eErrMsg := Client.eError; // Store error message for further use
    END_IF;
    xExecute := xDone AND NOT xBusy AND NOT xError; // NOT xExecute will probably reset the client? See FB help

     
  • hermsen

    hermsen - 2021-08-19

    hi Bernie,

    You must read the outputs xDone, xBusy, xError & eError each cycle.
    after that you can use them to influence the Client function block, eg like this example pseudo code

    IF xError THEN
    eErrMsg := Client.eError; // Store error message for further use
    END_IF;
    xExecute := xDone AND NOT xBusy AND NOT xError; // NOT xExecute will probably reset the client? See FB help

     
  • hermsen

    hermsen - 2021-08-19

    hi Bernie,

    You must read the outputs xDone, xBusy, xError & eError each cycle.
    after that you can use them to influence the Client function block, eg like this example pseudo code

    IF xError THEN
    eErrMsg := Client.eError; // Store error message for further use
    END_IF;
    xExecute := xDone AND NOT xBusy AND NOT xError; // NOT xExecute will probably reset the client? See FB help

     

Log in to post a comment.