Create ByteString of 30M

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
franck.etienne
Sr. Member
Sr. Member
Posts: 16
Joined: 01 Jun 2016, 13:08

Create ByteString of 30M

Post by franck.etienne »

Hi,

With SDK 1.7.9, we construct an OPCUA server which must offer a ByteString of 30~40Mb.
The OPCUA client doesn't want to implement FileType !

I modify the ServerConfig.xml (part Serializer):
- up MaxAlloc to 40000000
- up MaxByteStringLength to 40000000
- up MaxMessageSize to 40000000

Same on UaExpert.

I recompile server and relaunch UaExpert.
But I have the error on UaExpert:
[uastack] OpcUa_SecureStream-AppendInput: Expected sequence number 1805 but received 1806!
~12s~
[uastack] OpcUa_Channel_ResponseAvailable: Request failed! (0x800A0000)
Read attributes of node 'NS2|string|BigByteString' failed [ret = BadTimeout]

The ByteString represent a file available on server.
This object work well with a 16Mb file.
But we are over MaxByteStringLength which is set to 16646145.

franck.etienne
Sr. Member
Sr. Member
Posts: 16
Joined: 01 Jun 2016, 13:08

Re: Create ByteString of 30M

Post by franck.etienne »

With UaExpert, I check if serializer part is taken in account, in Server->ServerCapabilities-MaxByteStringLength, I could observe the increase from 16646145 to 40000000.

But in code opcua_config.h, there is:
#ifndef OPCUA_DECODER_MAXBYTESTRINGLENGTH
# define OPCUA_DECODER_MAXBYTESTRINGLENGTH ((OpcUa_UInt32)16646145)
#endif /* OPCUA_DECODER_MAXBYTESTRINGLENGTH */

But OPCUA_DECODER_MAXBYTESTRINGLENGTH is overwritten by Server->ServerCapabilities-MaxByteStringLength while execution of server ?????

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: Create ByteString of 30M

Post by Support Team »

Hi,

whatever you try to achieve here is out of scope for the usage of our SDK and UA Stack packages. The default configuration and the documentation gives the scope of usage.

If the client developer does not "want" to implement FileObject, which would be the correct solution for large ByteString, we can not help you. Our implementation may contain limits you can tweek, but others that we have hard coded, depending on the use case we had in mind when creating the SDK and its default configuration. There are multiple parameters in the stack and serializer that all must match and must be negothiated on both sides to make this work. However, shooting yourself in the foot just because someone does not "want" to use correct the OPC UA mechanizm as intended for the use case by the OPC Foundation, sorry what you try to do is out of scope.

So your best option is to transfer a 30M fileobject (as intended by the OPC UA technology), but not a variable of type bytestring. Maybe it is time for the client-side developer to purchase SDK that is capable of handling file objects, btw. all Unified Automation client SDK would be capable of doing so.
Best regards
Unified Automation Support Team

franck.etienne
Sr. Member
Sr. Member
Posts: 16
Joined: 01 Jun 2016, 13:08

Re: Create ByteString of 30M

Post by franck.etienne »

Thank's for the response Support Team.

In UA documentation, I could find FileType methods but not how use them.
Is there somewhere an example of how implement a variable of FileType on server which could be read by a client ?
Thank's.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: Create ByteString of 30M

Post by Support Team »

Hi,

there is file type in DemoServer, which is probably best code base to look at.
On the client side the fileobject is pretty much close to C file API.
Best regards
Unified Automation Support Team

franck.etienne
Sr. Member
Sr. Member
Posts: 16
Joined: 01 Jun 2016, 13:08

Re: Create ByteString of 30M

Post by franck.etienne »

But DemoServer is a complicated exemple and base on nodeManagerNodesetXml.

Our server use nodeManagerNodesetXmlCreator and methods used in demoServer doesn't be applied to nodeManagerNodesetXmlCreator.

I can't create a FileType node on our server :-(

franck.etienne
Sr. Member
Sr. Member
Posts: 16
Joined: 01 Jun 2016, 13:08

Re: Create ByteString of 30M

Post by franck.etienne »

So, you said "So your best option is to transfer a 30M fileobject"

I implement FileObject in our server. Not easy but we arrive.

I try with a client based on other SDK to access to the "FileObject"
=> From a client tou need at least to call 3 method (Open, Read and Close).
But I have an issue if the client execute the Read on a FileObject with a size over 16Mb !

In methods offer, you can have the size of file BUT NOT than it's aver ByteString limitation of your SDK.
=> So the client must acces server's limitations first to get ByteString limitation of server and truncate Read ... It is what we can call an industrial process !

What did you mean by "Maybe it is time for the client-side developer to purchase SDK that is capable of handling file objects"

Post Reply