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

It is expected that OPC UA Servers will create vendor-specific subtypes of the FileDirectoryType with additional functionalities like Methods for creating symbolic links or setting access permissions. OPC UA Clients providing specialized file transfer user interfaces should be prepared to expose such additional Methods to the user.

Table 8 – FileDirectoryType

Attribute

Value

BrowseName

FileDirectoryType

IsAbstract

False

References

NodeClass

BrowseName

DataType

TypeDefinition

Modelling Rule

Subtype of the FolderType defined in OPC 10000-5

Organizes

Object

<FileDirectoryName>

FileDirectoryType

OptionalPlaceholder

Organizes

Object

<FileName>

FileType

OptionalPlaceholder

HasComponent

Method

CreateDirectory

Defined in 4.3.3

Mandatory

HasComponent

Method

CreateFile

Defined in 4.3.4

Mandatory

HasComponent

Method

Delete

Defined in 4.3.5

Mandatory

HasComponent

Method

MoveOrCopy

Defined in 4.3.6

Mandatory

Conformance Units

Base Info FileDirectoryType Base

Instances of the ObjectType contain a list of FileDirectoryType Objects representing the subdirectories of the file directory represented by the instance of this ObjectType.

Instances of the ObjectType contain a list of FileType Objects representing 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 FileDirectoryType with the BrowseName FileSystem as illustrated in Figure 1.

image004.png

Figure 1 – FileSystem example

The Object representing the root of a file directory structure shall have the BrowseName FileSystem. An OPC UA Server may have different FileSystem Objects in the AddressSpace. HasComponent is used to reference a FileSystem from aggregating Objects like the Objects Folder or the Object representing a device.

CreateDirectory is used to create a new FileDirectoryType Object organized 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-4 for a general description. A directory with the name already exists.

Bad_UserAccessDenied

See OPC 10000-4 for a general description.

Table 9 specifies the AddressSpace representation for the CreateDirectory Method.

Table 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

Conformance Units

Base Info FileDirectoryType Base

CreateFile is used to create a new FileType Object organized by this Object. The created file can be written using the Write Method of 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-4 for a general description. A file with the name already exists.

Bad_UserAccessDenied

See OPC 10000-4 for a general description.

Table 10 specifies the AddressSpace representation for the CreateFile Method.

Table 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

Conformance Units

Base Info FileDirectoryType Base

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-4 for a general description. A file or directory with the provided NodeId is not organized by this object.

Bad_InvalidState

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

Bad_UserAccessDenied

See OPC 10000-4 for a general description.

Table 11 specifies the AddressSpace representation for the Delete Method.

Table 11 – Delete Method AddressSpace definition

Attribute

Value

BrowseName

Delete

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

HasProperty

Variable

InputArguments

Argument[]

PropertyType

Mandatory

Conformance Units

Base Info FileDirectoryType Base

MoveOrCopy is used to move or copy a file or directory organized by this Object to 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-4 for a general description. A file or directory with the name already exists.

Bad_NotFound

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

Bad_InvalidState

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

Bad_UserAccessDenied

See OPC 10000-4 for a general description.

Table 12 specifies the AddressSpace representation for the MoveOrCopy Method.

Table 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

Conformance Units

Base Info FileDirectoryType Base