OpcFileNode Members

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcFileNode type exposes the following members.

OpcFileNode(FileState)

Initializes a new instance of the OpcFileNode class using the content as the instance to wrap.

C#

protected OpcFileNode(FileState content)


Parameters

content FileState

The FileState to wrap.


Exceptions

ArgumentNullException

The content is a null reference (Nothing in Visual Basic).

OpcFileNode(FileState, OpcNodeModel)

Initializes a new instance of the OpcFileNode class using the content as the instance to wrap.

C#

protected OpcFileNode(FileState content, OpcNodeModel model)


Parameters

content FileState

The FileState to wrap.

model OpcNodeModel

The OpcNodeModel which defines the modelling directives for the new node or a null reference (Nothing in Visual Basic) if there are no directives are to be applied to the node.


Exceptions

ArgumentNullException

The content is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, FileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent defined by fileInfo as a child node of the parent node given.

C#

public OpcFileNode(IOpcNode parent, OpcName name, FileInfo fileInfo)


Parameters

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

fileInfo FileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent defined by fileInfo as a child node of the parent node given.

C#

public OpcFileNode(IOpcNode parent, OpcName name, IOpcFileInfo fileInfo)


Parameters

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, OpcNodeId, FileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file information defined by fileInfo as a child node of the parent node given.

C#

public OpcFileNode(IOpcNode parent, OpcName name, OpcNodeId id, FileInfo fileInfo)


Parameters

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

fileInfo FileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, OpcNodeId, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file information defined by fileInfo as a child node of the parent node given.

C#

public OpcFileNode(IOpcNode parent, OpcName name, OpcNodeId id, IOpcFileInfo fileInfo)


Parameters

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, OpcNodeId, string)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file information defined by filePath as a child node of the parent node given.

C#

public OpcFileNode(IOpcNode parent, OpcName name, OpcNodeId id, string filePath)


Parameters

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

filePath String

The path to the file to use by the new file node.


Exceptions

ArgumentException

The filePath is an empty string.

ArgumentNullException

The filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, string)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent defined by filePath as a child node of the parent node given.

C#

public OpcFileNode(IOpcNode parent, OpcName name, string filePath)


Parameters

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

filePath String

The path to the file to use by the new file node.


Exceptions

ArgumentException

The filePath is an empty string.

ArgumentNullException

The filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcName, FileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by fileInfo.

C#

public OpcFileNode(OpcName name, FileInfo fileInfo)


Parameters

name OpcName

The OpcName through that the new file node can be accessed.

fileInfo FileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcName, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by fileInfo.

C#

public OpcFileNode(OpcName name, IOpcFileInfo fileInfo)


Parameters

name OpcName

The OpcName through that the new file node can be accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcName, OpcNodeId, FileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file to represent given by fileInfo.

C#

public OpcFileNode(OpcName name, OpcNodeId id, FileInfo fileInfo)


Parameters

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

fileInfo FileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcName, OpcNodeId, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file to represent given by fileInfo.

C#

public OpcFileNode(OpcName name, OpcNodeId id, IOpcFileInfo fileInfo)


Parameters

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcName, OpcNodeId, string)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file to represent given by filePath.

C#

public OpcFileNode(OpcName name, OpcNodeId id, string filePath)


Parameters

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

filePath String

The path to the file to use by the new file node.


Exceptions

ArgumentException

The filePath is an empty string.

ArgumentNullException

The filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcName, string)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by filePath.

C#

public OpcFileNode(OpcName name, string filePath)


Parameters

name OpcName

The OpcName through that the new file node can be accessed.

filePath String

The path to the file to use by the new file node.


Exceptions

ArgumentException

The filePath is an empty string.

ArgumentNullException

The filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcNodeModel, IOpcNode, OpcName, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent defined by fileInfo as a child node of the parent node given.

C#

protected OpcFileNode(OpcNodeModel model, IOpcNode parent, OpcName name, IOpcFileInfo fileInfo)


Parameters

model OpcNodeModel

The OpcNodeModel which defines the modelling directives for the new node or a null reference (Nothing in Visual Basic) if there are no directives are to be applied to the node.

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcNodeModel, IOpcNode, OpcName, OpcNodeId, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file information defined by fileInfo as a child node of the parent node given.

C#

protected OpcFileNode(OpcNodeModel model, IOpcNode parent, OpcName name, OpcNodeId id, IOpcFileInfo fileInfo)


Parameters

model OpcNodeModel

The OpcNodeModel which defines the modelling directives for the new node or a null reference (Nothing in Visual Basic) if there are no directives are to be applied to the node.

parent IOpcNode

The IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcNodeModel, OpcName, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by fileInfo.

C#

protected OpcFileNode(OpcNodeModel model, OpcName name, IOpcFileInfo fileInfo)


Parameters

model OpcNodeModel

The OpcNodeModel which defines the modelling directives for the new node or a null reference (Nothing in Visual Basic) if there are no directives are to be applied to the node.

name OpcName

The OpcName through that the new file node can be accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcNodeModel, OpcName, OpcNodeId, IOpcFileInfo)

Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file to represent given by fileInfo.

C#

protected OpcFileNode(OpcNodeModel model, OpcName name, OpcNodeId id, IOpcFileInfo fileInfo)


Parameters

model OpcNodeModel

The OpcNodeModel which defines the modelling directives for the new node or a null reference (Nothing in Visual Basic) if there are no directives are to be applied to the node.

name OpcName

The OpcName through that the new file node can be accessed.

id OpcNodeId

The OpcNodeId through that the new file node can be identified and accessed.

fileInfo IOpcFileInfo

The file information to use by the new file node.


Exceptions

ArgumentNullException

The fileInfo is a null reference (Nothing in Visual Basic).

CanUserWrite

Gets or sets a value indicating whether by default a user can access the file represented for writing taking user access rights into account.

C#

public bool CanUserWrite { get; set; }


Property Value

Boolean

The value true if the file represented is accessible for writing by the user; otherwise the value false.



Remarks

The property does not take into account whether the file is currently opened for writing by another client and thus currently locked and not writable by others.

CanUserWriteNode

Gets the OpcPropertyNode´1 of the CanUserWrite property.

C#

public OpcPropertyNode<bool> CanUserWriteNode { get; }


Property Value

OpcPropertyNode<Boolean>

An instance of the OpcPropertyNode´1 class.

CanWrite

Gets or sets a value indicating whether the file is writable. It does not take any user access rights into account, i.e. although the file is writable this may be restricted to a certain user / user group.

C#

public bool CanWrite { get; set; }


Property Value

Boolean

The value true if the file represented is accessible for writing; otherwise the value false.



Remarks

The property does not take into account whether the file is currently opened for writing by another client and thus currently locked and not writable by others.

CanWriteNode

Gets the OpcPropertyNode´1 of the CanWrite property.

C#

public OpcPropertyNode<bool> CanWriteNode { get; }


Property Value

OpcPropertyNode<Boolean>

An instance of the OpcPropertyNode´1 class.

CloseNode

Gets the OpcFileCloseMethodNode used to handle 'Close' method calls to close the file represented.

C#

public OpcFileCloseMethodNode CloseNode { get; }


Property Value

OpcFileCloseMethodNode

An instance of the OpcFileCloseMethodNode class. Which uses an OpcFileNode defined callback to close the file.

DefaultTypeDefinitionId

Gets the default identifier which identifies the node that defines the underlying node type from that this OpcInstanceNode has been created.

C#

protected override OpcNodeId DefaultTypeDefinitionId { get; }


Property Value

OpcNodeId

The OpcNodeId of the type node from that this OpcInstanceNode has been created from. These type node defines the typical structure of an instance node of its type definition. If there exists no specific type definition node a null reference (Nothing in Visual Basic).

File

Gets the IOpcFileInfo used to access the file represented.

C#

public IOpcFileInfo File { get; }


Property Value

IOpcFileInfo

The IOpcFileInfo used to access the file and its metadata represented.

FileInfo

Gets the FileInfo of the file represented.

C#

public FileInfo FileInfo { get; }


Property Value

FileInfo

The FileInfo used to access the file and its metadata represented or a null reference (Nothing in Visual Basic) if File represents a custom implementation of the IOpcFileInfo interface.

GetPositionNode

Gets the OpcFileGetPositionMethodNode used to handle 'GetPosition' method calls to query the position in the file represented.

C#

public OpcFileGetPositionMethodNode GetPositionNode { get; }


Property Value

OpcFileGetPositionMethodNode

An instance of the OpcFileGetPositionMethodNode class. Which uses an OpcFileNode defined callback to query the position in the file.

MimeType

Gets the media type of the file.

C#

public string MimeType { get; }


Property Value

String

The type of media represented by the OpcFileNode based on RFC 2046.

MimeTypeNode

Gets the OpcPropertyNode´1 of the MimeType property.

C#

public OpcPropertyNode<string> MimeTypeNode { get; }


Property Value

OpcPropertyNode<String>

An instance of the OpcPropertyNode´1 class.

OpenCount

Gets the number of currently valid file handles on the file.

C#

[CLSCompliant(false)]
public ushort OpenCount { get; }


Property Value

UInt16

The number of currently valid file handles on the file.

OpenCountNode

Gets the OpcPropertyNode´1 of the OpenCount property.

C#

[CLSCompliant(false)]
public OpcPropertyNode<ushort> OpenCountNode { get; }


Property Value

OpcPropertyNode<UInt16>

An instance of the OpcPropertyNode´1 class.

OpenNode

Gets the OpcFileOpenMethodNode used to handle 'Open' method calls to open the file represented.

C#

public OpcFileOpenMethodNode OpenNode { get; }


Property Value

OpcFileOpenMethodNode

An instance of the OpcFileOpenMethodNode class. Which uses an OpcFileNode defined callback to open the file.

ReadNode

Gets the OpcFileReadMethodNode used to handle 'Read' method calls to read data from the file represented.

C#

public OpcFileReadMethodNode ReadNode { get; }


Property Value

OpcFileReadMethodNode

An instance of the OpcFileReadMethodNode class. Which uses an OpcFileNode defined callback to read data from the file.

SetPositionNode

Gets the OpcFileSetPositionMethodNode used to handle 'SetPosition' method calls to update the position in the file represented.

C#

public OpcFileSetPositionMethodNode SetPositionNode { get; }


Property Value

OpcFileSetPositionMethodNode

An instance of the OpcFileSetPositionMethodNode class. Which uses an OpcFileNode defined callback to update the position in the file.

Size

Gets the size of the file in bytes.

C#

[CLSCompliant(false)]
public ulong Size { get; }


Property Value

UInt64

The size of the file in bytes.



Remarks

When a file is opened for write and the file handle is still valid the size might not be accurate.

SizeNode

Gets the OpcPropertyNode´1 of the Size property.

C#

[CLSCompliant(false)]
public OpcPropertyNode<ulong> SizeNode { get; }


Property Value

OpcPropertyNode<UInt64>

An instance of the OpcPropertyNode´1 class.

WriteNode

Gets the OpcFileWriteMethodNode used to handle 'Write' method calls to write data to the file represented.

C#

public OpcFileWriteMethodNode WriteNode { get; }


Property Value

OpcFileWriteMethodNode

An instance of the OpcFileWriteMethodNode class. Which uses an OpcFileNode defined callback to write data to the file.

Close(OpcContext, uint)

Closes the file represented. When a client closes a file the handle becomes invalid.

C#

public void Close(OpcContext context, uint fileHandle)


Parameters

context OpcContext


fileHandle UInt32

A file handle indicating the access request and thus indirectly the position inside the file.



Exceptions

ArgumentNullException


OpcException


GetPosition(OpcContext, uint)

GetPosition is used to provide the current position of the file handle.

C#

public ulong GetPosition(OpcContext context, uint fileHandle)


Parameters

context OpcContext


fileHandle UInt32

A file handle indicating the access request and thus indirectly the position inside the file.


Returns

UInt64

The position of the file handle in the file. If a Read or Write is called it starts at that position.



Exceptions

ArgumentNullException


OpcException


InitializeDefaults()

Initializes the default values used by the OpcFileNode.

C#

protected override void InitializeDefaults()


Remarks

This method is used to ensure the availability of appropriate node specific default values. For more information like when this method is to be overwritten see InitializeDefaults.

Open(OpcContext, OpcFileMode)

Opens the file represented. When a client opens a file it gets a file handle that is valid while the session is open. Clients shall use the Close Method to release the file handle when they do not need access to the file anymore. Clients can open the same file several times for read.

C#

public uint Open(OpcContext context, OpcFileMode mode)


Parameters

context OpcContext


mode OpcFileMode

Indicates whether the file should be opened only for read operations or for read and write operations and where the initial position is set.


Returns

UInt32

A handle for the file used in other method calls indicating not the file but the access request and thus the position in the file. The file handle is generated by the server and is unique for the Session. Clients cannot transfer the file handle to another Session but need to get a new file handle by calling the Open Method.



Exceptions

ArgumentNullException


OpcException


Read(OpcContext, uint, int)

Read is used to read a part of the file starting from the current file position. The file position is advanced by the number of bytes read.

C#

public ByteString Read(OpcContext context, uint fileHandle, int length)


Parameters

context OpcContext


fileHandle UInt32

A file handle indicating the access request and thus indirectly the position inside the file.

length Int32

Defines the length in byte that should be returned in data, starting from the current position of the file handle. If the end of file is reached only all data till the end of the file are returned. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size are returned. Only positive values are allowed.


Returns

ByteString

Contains the returned data of the file.



Exceptions

ArgumentNullException


OpcException


ReadCanUserWrite(OpcReadPropertyValueContext<OpcPropertyNode<bool>>, OpcPropertyValue<bool>)

Reads the value of the CanUserWrite property.

C#

protected virtual OpcPropertyValue<bool> ReadCanUserWrite(OpcReadPropertyValueContext<OpcPropertyNode<bool>> context, OpcPropertyValue<bool> value)


Parameters

context OpcReadPropertyValueContext<OpcPropertyNode>

The OpcReadPropertyValueContext´1 to use to read the property value.

value OpcPropertyValue<Boolean>

The preliminary OpcPropertyValue´1.


Returns

OpcPropertyValue<Boolean>

The determined OpcPropertyValue´1.

ReadCanWrite(OpcReadPropertyValueContext<OpcPropertyNode<bool>>, OpcPropertyValue<bool>)

Reads the value of the CanWrite property.

C#

protected virtual OpcPropertyValue<bool> ReadCanWrite(OpcReadPropertyValueContext<OpcPropertyNode<bool>> context, OpcPropertyValue<bool> value)


Parameters

context OpcReadPropertyValueContext<OpcPropertyNode>

The OpcReadPropertyValueContext´1 to use to read the property value.

value OpcPropertyValue<Boolean>

The preliminary OpcPropertyValue´1.


Returns

OpcPropertyValue<Boolean>

The determined OpcPropertyValue´1.

SetPosition(OpcContext, uint, ulong)

SetPosition is used to set the current position of the file handle.

C#

public void SetPosition(OpcContext context, uint fileHandle, ulong position)


Parameters

context OpcContext


fileHandle UInt32

A file handle indicating the access request and thus indirectly the position inside the file.

position UInt64

The position to be set for the file handle in the file. If a Read or Write is called it starts at that position. If the position is higher than the file size the position is set to the end of the file.



Exceptions

ArgumentNullException


OpcException


Write(OpcContext, uint, ByteString)

Write is used to write a part of the file starting from the current file position. The file position is advanced by the number of bytes written.

C#

public void Write(OpcContext context, uint fileHandle, ByteString data)


Parameters

context OpcContext


fileHandle UInt32

A file handle indicating the access request and thus indirectly the position inside the file.

data ByteString

Contains the data to be written at the position of the file. It is server-dependent whether the written data are persistently stored if the session is ended without calling the Close Method with the file handle.



Exceptions

ArgumentNullException


OpcException