News:

  • December 01, 2026, 01:02:16 PM

Login with username, password and session length

Author Topic: HTTPCMD post fails when buffer file is > 10,000 bytes  (Read 564 times)

pjkramlinger

  • Newbie
  • *
  • Posts: 2
HTTPCMD post fails when buffer file is > 10,000 bytes
« on: November 19, 2026, 11:28:43 AM »
An HTTPCMD instruction configured as a post to send data to an API has a numeric buffer file set up for 65,000 bytes (the documented capacity of the instruction).
It works well until the buffer is over 10,000 bytes when it consistently fails. Any ideas?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3859
    • Host Engineering
Re: HTTPCMD post fails when buffer file is > 10,000 bytes
« Reply #1 on: November 19, 2026, 12:43:29 PM »
You can temporarily turn on some detailed diagnostic messages that get sent out by the PLC and monitored by DmLogger utility.
Debug->Do-more Logger

Look at Help Topic  DMD0283 Do-more Logger (Network Message Viewer)
Turn on Level 2 logging (remember to turn it off!!!)

Post what you see back here

pjkramlinger

  • Newbie
  • *
  • Posts: 2
Re: HTTPCMD post fails when buffer file is > 10,000 bytes
« Reply #2 on: November 27, 2026, 11:50:15 PM »
franji1, thanks for your direction - I hadn't used the DMLogger before.
The attached "DMLogger - Buffer greater than 10000 bytes.csv" shows that the HTTPCMD timed out at a buffer size of 10937.

I put in an accumulating timer to capture the run time of the instruction from initiation until completion with a "success" or "error" bit.
I was looking to see if the run time increased by the size of the buffer until hitting some kind of limit.
Turns out from the data below that the run time for "successful" runs was approximately steady around an average of 3 seconds.
"Error" runs with buffer sizes starting around 10000 bytes seemed to choke the instruction and time out after 30 seconds of run time.
Any ideas what is could cause this error? Could this be caused by a bug in the HTTPCMD instruction code? Comm problems with the API?

The results for running successively larger files by approximately 500 bytes are:
Run #   File size    Success    Error    Run Time (secs)
1          1482         *                          3.548
2          1964         *                          2.508
3          2440         *                          2.698
4          2919         *                          3.658
5          3398         *                          3.293
 |            |             |                            |       (similar data for runs 6-14)
15        8195         *                          2.481
16        8676         *                          3.303
17        9157         *                          2.734
18        9638                      *           30.031
19      10120                      *           30.039
20      10602         *                          4.248
21      11084                      *           30.042
22      11566                      *           30.043
23      12048                      *           30.037
24      12530                      *           30.080
25      13012                      *           30.031

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 271
    • Host Engineering, Inc.
Re: HTTPCMD post fails when buffer file is > 10,000 bytes
« Reply #3 on: Today at 12:54:53 PM »
Failing at the 30 second mark looks a bit suspicious. In the past we've seen servers terminate a TCP connection at 30 seconds due to inactivity. If the connection is using HTTPS then the BRX CPUs encryption engine is being used, but by default it does not run to completion on one scan because that could cause huge swings in scan time, so it runs in a time slice on successive scan to completion. You can allocate more time per scan by setting DST68 ($TLSTimeSlice) which is the amount of time (in microseconds) the SSL / TLS encryption engine is allowed to run on each scan when trying to establish an encrypted connection to a server.

You might try bumping that up to a really big number to see if that changes the problem so that you know where the problem is coming in.

Another thing is if the HTTPCMD instruction itself is in a program code block, that too could be getting time-sliced ... try moving it to the Main program and see if that changes anything as well.
Good design costs a lot. Bad design costs even more.