This ObjectTypedefines a type for the representation of file directories. It is formally defined in Table C.8.

It is expected that OPC UA Serverswill create vendor-specific subtypes of the FileDirectoryTypewith additional functionalities like Methodsfor creating symbolic links or setting access permissions. OPC UA Clientsproviding specialized file transfer user interfaces should be prepared to expose such additional Methodsto the user.

Table C.8– FileDirectoryType

Attribute

Value

BrowseName

FileDirectoryType

IsAbstract

False

References

NodeClass

BrowseName

DataType

TypeDefinition

Modelling Rule

Subtype of the FolderType defined in 6.6.

Organizes

Object

<FileDirectoryName>

FileDirectoryType

OptionalPlaceholder

Organizes

Object

<FileName>

FileType

OptionalPlaceholder

HasComponent

Method

CreateDirectory

Defined in C.3.3

Mandatory

HasComponent

Method

CreateFile

Defined in C.3.4

Mandatory

HasComponent

Method

Delete

Defined in C.3.5

Mandatory

HasComponent

Method

MoveOrCopy

Defined in C.3.6

Mandatory

Instances of the ObjectTypecontain a list of FileDirectoryType Objectsrepresenting the subdirectories of the file directory represented by the instance of this ObjectType.

Instances of the ObjectTypecontain a list of FileType Objectsrepresenting the files in the file directory represented by the instance of this ObjectType.

The support of file directory structures is declared by aggregating an instance of the FileDirectoryTypewith the BrowseName FileSystemas illustrated in Figure C.1.

image023.png

Figure C.1– FileSystem Example

The Objectrepresenting the root of a file directory structure shall have the BrowseName FileSystem. An OPC UA Servermay have different FileSystem Objectsin the AddressSpace. HasComponentis used to reference a FileSystemfrom aggregating Objectslike the Objects Folderor the Objectrepresenting a device.

CreateDirectory is used to create a new FileDirectoryType Objectorganized by this Object.

Signature

CreateDirectory(

[in] String directoryName

[out] NodeId directoryNodeId

);

Argument

Description

directoryName

The name of the directory to create. The name is used for the BrowseName and DisplayName of the directory object and also for the directory in the file system.

For the BrowseName, the directoryName is used for the name part of the QualifiedName. The namespace index is Server specific.

For the DisplayName, the directoryName is used for the text part of the LocalizedText. The locale part is Server specific.

directoryNodeId

The NodeId of the created directory Object.

Method Result Codes (defined in Call Service)

Result Code

Description

Bad_BrowseNameDuplicated

See OPC 10000-4for a general description. A directory with the name already exists.

Bad_UserAccessDenied

See OPC 10000-4for a general description.

Table C.9 specifies the AddressSpacerepresentation for the CreateDirectory Method.

Table C.9– CreateDirectory Method AddressSpace Definition

Attribute

Value

BrowseName

CreateDirectory

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

HasProperty

Variable

InputArguments

Argument[]

PropertyType

Mandatory

HasProperty

Variable

OutputArguments

Argument[]

PropertyType

Mandatory

CreateFile is used to create a new FileType Objectorganized by this Object. The created file can be written using the Write Methodof the FileType.

Signature

CreateFile(

[in] String fileName

[in] Boolean requestFileOpen

[out] NodeId fileNodeId

[out] UInt32 fileHandle

);

Argument

Description

fileName

The name of the file to create. The name is used for the BrowseName and DisplayName of the file object and also for the file in the file system.

For the BrowseName, the fileName is used for the name part of the QualifiedName. The namespace index is Server specific.

For the DisplayName, the fileName is used for the text part of the LocalizedText. The locale part is Server specific.

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.

fileNodeId

The NodeId of the created file Object.

fileHandle

The fileHandle is returned if the requestFileOpen is set to True.

The fileNodeId and the fileHandle can be used to access the new file through the FileType Object representing the new file.

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

Method Result Codes (defined in Call Service)

Result Code

Description

Bad_BrowseNameDuplicated

See OPC 10000-4for a general description. A file with the name already exists.

Bad_UserAccessDenied

See OPC 10000-4for a general description.

Table C.10 specifies the AddressSpacerepresentation for the CreateFile Method.

Table C.10– CreateFile Method AddressSpace Definition

Attribute

Value

BrowseName

CreateFile

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

HasProperty

Variable

InputArguments

Argument[]

PropertyType

Mandatory

HasProperty

Variable

OutputArguments

Argument[]

PropertyType

Mandatory

Delete is used to delete a file or directory organized by this Object.

Signature

Delete(

[in] NodeId objectToDelete

);

Argument

Description

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.

Method Result Codes (defined in Call Service)

Result Code

Description

Bad_NotFound

See OPC 10000-4for a general description. A file or directory with the provided NodeId is not organized by this object.

Bad_InvalidState

See OPC 10000-4for a general description. The file or directory is locked and thus cannot be deleted.

Bad_UserAccessDenied

See OPC 10000-4for a general description.

Table C.11 specifies the AddressSpacerepresentation for the Delete Method.

Table C.11– Delete Method AddressSpace Definition

Attribute

Value

BrowseName

Delete

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

HasProperty

Variable

InputArguments

Argument[]

PropertyType

Mandatory

MoveOrCopy is used to move or copy a file or directory organized by this Objectto another directory or to rename a file or directory.

Signature

MoveOrCopy(

[in] NodeId objectToMoveOrCopy

[in] NodeId targetDirectory

[in] Boolean createCopy

[in] String newName

[out] NodeId newNodeId

);

Argument

Description

objectToMoveOrCopy

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

targetDirectory

The NodeId of the target directory of the move or copy command. If the file or directory is just renamed, the targetDirectory matches the ObjectId passed to the method call.

createCopy

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

newName

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

newNodeId

The NodeId of the moved or copied object. Even if the Object is moved, the Server may return a new NodeId.

Method Result Codes (defined in Call Service)

Result Code

Description

Bad_BrowseNameDuplicated

See OPC 10000-4for a general description. A file or directory with the name already exists.

Bad_NotFound

See OPC 10000-4for a general description. A file or directory with the provided NodeId is not organized by this object.

Bad_InvalidState

See OPC 10000-4for a general description. The file or directory is locked and thus cannot be moved or copied.

Bad_UserAccessDenied

See OPC 10000-4for a general description.

Table C.12 specifies the AddressSpacerepresentation for the MoveOrCopy Method.

Table C.12– MoveOrCopy Method AddressSpace Definition

Attribute

Value

BrowseName

MoveOrCopy

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

HasProperty

Variable

InputArguments

Argument[]

PropertyType

Mandatory

HasProperty

Variable

OutputArguments

Argument[]

PropertyType

Mandatory