OPC UA: FileDirectoryType

The Lenze OPC UA Server supports following methods to handle folders and files in the information model:

CreateDirectory()

The Create Directory method is used to create a new File Directory Type Object.

 

DataType

Argument

Description

[in]

String

directoryName

The name of the directory to create.

[out]

NodeId

directoryNodeId

The NodeId of the created directory Object.

CreateFile()

The CreateFile method is used to create a new FileType Object. With the Read and Write method of the created FileType Object, it´s possible to access the file.

 

DataType

Argument

Description

[in]

String

fileName

The name of the file to create.

[in]

Boolean

requestFileOpen

Flag indicating if the new file should be opened with the Write and Read bits set in the open mode after the creation of the file. If the flag is set to True, the file is created and opened for writing. If the flag is set to False, the file is just created.

[out]

NodeId

fileNodeId

The NodeId of the created file Object.

[out]

UInt32

fileHandle

The file Handle is returned if the request File Open is set to True.

The file NodeId and the file Handle can be used to access the new file through the File Type Object representing the new file.

If request File Open is set to False, the returned value shall be 0 and shall be ignored by the caller.

Delete()

The Delete method is used to delete a file or directory.

 

DataType

Argument

Description

[in]

NodeId

objectToDelete

The NodeId of the file or directory to delete.

In the case of a directory, all file and directory Objects below the directory to delete are deleted recursively.

MoveOrCopy()

The MoveOrCopy() method is used to move, copy or rename a file or directory.

 

DataType

Argument

Description

[in]

NodeId

objectToMoveOrCopy

The NodeId of the file or directory to move or copy.

[in]

NodeId

targetDirectory

The NodeId of the target directory of the move or copy command.

[in]

Boolean

NamecreateCopy

A flag indicating if a copy of the file or directory should be created at the target directory.

[in]

String

newName

The new name of the file or directory in the new location. If the string is empty, the name is unchanged.

[out]

NodeId

newNodeId

The NodeId of the moved or copied object.

The representation of a folders is defined by the OPC UA FileDirectoryType type definition. For more details see the following specification “OPC 10000-20 - UA Specification Part 20 - File Transfer”.