Skip to content

Navigation Menu

Sign in
Sign up

How to send an IEnumerable<IApiRequest>as one Http post? #143

Answered by KircMax
usingnamespaces asked this question in Q&A
Discussion options

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?

You must be logged in to vote

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

Comment options

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.

You must be logged in to vote
1 reply
Comment options

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.

Answer selected by KircMax
Comment options

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.

You must be logged in to vote
4 replies
Comment options

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.

Comment options

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.

Comment options

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?

Comment options

Yes, those are exactly the reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /