-
Notifications
You must be signed in to change notification settings - Fork 31
How to send an IEnumerable<IApiRequest>as one Http post? #143
Looking at the implementation of IApiRequestHandler.ApiBulkAsync for each element a post ist sent.
According to the siemens manual (11/2024, A5E53797639-AA) example 3 on page 81 it can be sent as one bulk request.
For me it seems this would be more efficient.
Does the library support this?
All reactions
-
👀 1
I disagree that for each element within the ApiBulkAsync a post request is sent.
The webserver has a limit for these post requests.
I thought users didnt want to take care that their bulk request does not exceed the limit, therefore we implemented a splitting mechanism for the post requests that exceed the according limit.
The ApiBulkAsync will only chunk the messages into these pieces using the MessageSplitter ->
Then send those to the plc and build those all together.
Replies: 2 comments 5 replies
I disagree that for each element within the ApiBulkAsync a post request is sent.
The webserver has a limit for these post requests.
I thought users didnt want to take care that their bulk request does not exceed the limit, therefore we implemented a splitting mechanism for the post requests that exceed the according limit.
image
The ApiBulkAsync will only chunk the messages into these pieces using the MessageSplitter ->
image
Then send those to the plc and build those all together.
All reactions
So the requests themselves should be sent as a single bulk as long as they do not exceed the limit and as 2 bulks once the limit is exceeded, as 3 bulks once the limit is exceeded by factor 2 and so on.
If it is not that way that'd be a bug and could be tracked in an issue.
All reactions
Sorry, I missed that part. It's working fine.
I was searching for ways to improve the speed of reading the variables.
Using a S7-1510SP, reading multiple variables is slower than put/get.
So, I was wondering how to speed it up and thought it might be something in the library.
All reactions
I see - yes, a bulk is the only way to speed it up a bit but apart from that I don't think there's much you can do...
And put/get is not a good comparison from my point of view since it is unencrypted (and unauthorized) and the web-api calls are encrypted + authorized. But it's always not nice to have a worse performance - that I can understand.
All reactions
I agree. Encryption, authorization and to access optimized DBs were main points to try the S7 web API.
So we don't have to allow everybody access to the PLC.
Maybe this is an other topic, but is there a way to keep the certificates up to date with this API.
I only found the ways to refresh it over TIA Portal or OPC UA. And both solutions are not an option.
The communication also works with an expired certificate when I deactivate the check in my code but it would be nice to have always a valid certificate.
All reactions
Refreshing certificates is currently not supported via the web api.
I guess Tia is not an option because you need to handle it in an automated manner and OPC UA because of the license?
Or what are the reasons?
All reactions
Yes, those are exactly the reasons.