Dear Support Team,
Now, I want to develop a file transfer function between server and client, and my solution is add variable whose type is FileDirectoryType in address space(I develop the address space via hard code, not xml). File transfer will be realized by FileDirectoryType::MoveOrCopy. I am not sure this soulution is correct, so I need your advice. By the way, I didn't find the demo about FileDirectoryType , can you give me some samples about adding FileDirectoryType node in address space via hard code?
Thank you!
How to create file transfer between server and client
Moderator: uasdkcpp
-
- Full Member
- Posts: 9
- Joined: 21 Sep 2016, 04:15
- Support Team
- Hero Member
- Posts: 3073
- Joined: 18 Mar 2011, 15:09
Re: How to create file transfer between server and client
Hello Kangskii,
you couldd implement a file transfer using that mechanism.
Note that the SDK provides the class for the FileDirectoryType but you still need to implement the functionality to Create, Delete, Mode and Copy Files and Directories.
This does not work out-of-the-box.
You at least need to implement the FileDirectoryTypeCallback. We can not provide a sample code for that callback implementation.
you couldd implement a file transfer using that mechanism.
Note that the SDK provides the class for the FileDirectoryType but you still need to implement the functionality to Create, Delete, Mode and Copy Files and Directories.
This does not work out-of-the-box.
Code: Select all
// Create an instance of FileDirectoryType
UaString sName("MyFileDirectory");
OpcUa::FileDirectoryType* pFileDirectory = new OpcUa::FileDirectoryType(
UaNodeId(sName, getNameSpaceIndex()),
sName,
getNameSpaceIndex(),
this);
addNodeAndReference(OpcUaId_ObjectsFolder, pFileDirectory, OpcUaId_Organizes);
// set the callback
MyFileDirectoryTypeCallback* pCallback = new MyFileDirectoryTypeCallback();
pFileDirectory->setCallback(pCallback);
Best regards
Unified Automation Support Team
Unified Automation Support Team