Skip to content

Reference

OpcFileNode Members

Defines a file node.

Reference

OpcFileNode Members ​

Type
OpcFileNode
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Inherits members from OpcObjectNode, OpcInstanceNode, OpcNode.

Constructors ​

OpcFileNode ​

18 overloads

OverloadDescription
OpcFileNode(OpcName, IOpcFileInfo)since v2.16Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by fileInfo.
OpcFileNode(OpcName, FileInfo)Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by fileInfo.
OpcFileNode(OpcName, string)Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by filePath.
OpcFileNode(OpcName, OpcNodeId, IOpcFileInfo)since v2.16Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file to represent given by fileInfo.
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.
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.
OpcFileNode(IOpcNode, OpcName, IOpcFileInfo)since v2.16Initializes 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.
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.
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.
OpcFileNode(IOpcNode, OpcName, OpcNodeId, IOpcFileInfo)since v2.16Initializes 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.
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.
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.
OpcFileNode(FileState)protected · since v2.50Initializes a new instance of the OpcFileNode class using the content as the instance to wrap.
OpcFileNode(FileState, OpcNodeModel)protected · since v2.50Initializes a new instance of the OpcFileNode class using the content as the instance to wrap.
OpcFileNode(OpcNodeModel, OpcName, IOpcFileInfo)protected · since v2.50Initializes a new instance of the OpcFileNode class accessible by the name specified with the file to represent given by fileInfo.
OpcFileNode(OpcNodeModel, OpcName, OpcNodeId, IOpcFileInfo)protected · since v2.50Initializes a new instance of the OpcFileNode class accessible by the name and id specified with the file to represent given by fileInfo.
OpcFileNode(OpcNodeModel, IOpcNode, OpcName, IOpcFileInfo)protected · since v2.50Initializes 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.
OpcFileNode(OpcNodeModel, IOpcNode, OpcName, OpcNodeId, IOpcFileInfo)protected · since v2.50Initializes 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.

OpcFileNode(OpcName, IOpcFileInfo) ​

since v2.16

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

csharp
public OpcFileNode(OpcName name, IOpcFileInfo fileInfo)
vbnet
Public Sub New(name As OpcName, fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
nameOpcNameThe OpcName through that the new file node can be accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe fileInfo 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.

csharp
public OpcFileNode(OpcName name, FileInfo fileInfo)
vbnet
Public Sub New(name As OpcName, fileInfo As FileInfo)

Parameters

NameTypeDescription
nameOpcNameThe OpcName through that the new file node can be accessed.
fileInfoFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe fileInfo 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.

csharp
public OpcFileNode(OpcName name, string filePath)
vbnet
Public Sub New(name As OpcName, filePath As String)

Parameters

NameTypeDescription
nameOpcNameThe OpcName through that the new file node can be accessed.
filePathStringThe path to the file to use by the new file node.

Exceptions

ExceptionCondition
ArgumentExceptionThe filePath is an empty string.
ArgumentNullExceptionThe filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(OpcName, OpcNodeId, IOpcFileInfo) ​

since v2.16

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

csharp
public OpcFileNode(OpcName name, OpcNodeId id, IOpcFileInfo fileInfo)
vbnet
Public Sub New(name As OpcName, id As OpcNodeId, fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe 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.

csharp
public OpcFileNode(OpcName name, OpcNodeId id, FileInfo fileInfo)
vbnet
Public Sub New(name As OpcName, id As OpcNodeId, fileInfo As FileInfo)

Parameters

NameTypeDescription
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
fileInfoFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe 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.

csharp
public OpcFileNode(OpcName name, OpcNodeId id, string filePath)
vbnet
Public Sub New(name As OpcName, id As OpcNodeId, filePath As String)

Parameters

NameTypeDescription
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
filePathStringThe path to the file to use by the new file node.

Exceptions

ExceptionCondition
ArgumentExceptionThe filePath is an empty string.
ArgumentNullExceptionThe filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, IOpcFileInfo) ​

since v2.16

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.

csharp
public OpcFileNode(IOpcNode parent, OpcName name, IOpcFileInfo fileInfo)
vbnet
Public Sub New(parent As IOpcNode, name As OpcName, fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe fileInfo 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.

csharp
public OpcFileNode(IOpcNode parent, OpcName name, FileInfo fileInfo)
vbnet
Public Sub New(parent As IOpcNode, name As OpcName, fileInfo As FileInfo)

Parameters

NameTypeDescription
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
fileInfoFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe fileInfo 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.

csharp
public OpcFileNode(IOpcNode parent, OpcName name, string filePath)
vbnet
Public Sub New(parent As IOpcNode, name As OpcName, filePath As String)

Parameters

NameTypeDescription
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
filePathStringThe path to the file to use by the new file node.

Exceptions

ExceptionCondition
ArgumentExceptionThe filePath is an empty string.
ArgumentNullExceptionThe filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(IOpcNode, OpcName, OpcNodeId, IOpcFileInfo) ​

since v2.16

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.

csharp
public OpcFileNode(
    IOpcNode parent,
    OpcName name,
    OpcNodeId id,
    IOpcFileInfo fileInfo)
vbnet
Public Sub New(
    parent As IOpcNode,
    name As OpcName,
    id As OpcNodeId,
    fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe 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.

csharp
public OpcFileNode(
    IOpcNode parent,
    OpcName name,
    OpcNodeId id,
    FileInfo fileInfo)
vbnet
Public Sub New(
    parent As IOpcNode,
    name As OpcName,
    id As OpcNodeId,
    fileInfo As FileInfo)

Parameters

NameTypeDescription
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
fileInfoFileInfoThe file information to use by the new file node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe 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.

csharp
public OpcFileNode(IOpcNode parent, OpcName name, OpcNodeId id, string filePath)
vbnet
Public Sub New(
    parent As IOpcNode,
    name As OpcName,
    id As OpcNodeId,
    filePath As String)

Parameters

NameTypeDescription
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
filePathStringThe path to the file to use by the new file node.

Exceptions

ExceptionCondition
ArgumentExceptionThe filePath is an empty string.
ArgumentNullExceptionThe filePath is a null reference (Nothing in Visual Basic).

OpcFileNode(FileState) ​

protected · since v2.50

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

csharp
protected OpcFileNode(FileState content)
vbnet
Protected Sub New(content As FileState)

Parameters

NameTypeDescription
contentFileStateThe FileState to wrap.

Exceptions

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

OpcFileNode(FileState, OpcNodeModel) ​

protected · since v2.50

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

csharp
protected OpcFileNode(FileState content, OpcNodeModel model)
vbnet
Protected Sub New(content As FileState, model As OpcNodeModel)

Parameters

NameTypeDescription
contentFileStateThe FileState to wrap.
modelOpcNodeModelThe 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

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

OpcFileNode(OpcNodeModel, OpcName, IOpcFileInfo) ​

protected · since v2.50

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

csharp
protected OpcFileNode(OpcNodeModel model, OpcName name, IOpcFileInfo fileInfo)
vbnet
Protected Sub New(
    model As OpcNodeModel,
    name As OpcName,
    fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
modelOpcNodeModelThe 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.
nameOpcNameThe OpcName through that the new file node can be accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

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

OpcFileNode(OpcNodeModel, OpcName, OpcNodeId, IOpcFileInfo) ​

protected · since v2.50

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

csharp
protected OpcFileNode(
    OpcNodeModel model,
    OpcName name,
    OpcNodeId id,
    IOpcFileInfo fileInfo)
vbnet
Protected Sub New(
    model As OpcNodeModel,
    name As OpcName,
    id As OpcNodeId,
    fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
modelOpcNodeModelThe 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.
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

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

OpcFileNode(OpcNodeModel, IOpcNode, OpcName, IOpcFileInfo) ​

protected · since v2.50

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.

csharp
protected OpcFileNode(
    OpcNodeModel model,
    IOpcNode parent,
    OpcName name,
    IOpcFileInfo fileInfo)
vbnet
Protected Sub New(
    model As OpcNodeModel,
    parent As IOpcNode,
    name As OpcName,
    fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
modelOpcNodeModelThe 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.
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

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

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

protected · since v2.50

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.

csharp
protected OpcFileNode(
    OpcNodeModel model,
    IOpcNode parent,
    OpcName name,
    OpcNodeId id,
    IOpcFileInfo fileInfo)
vbnet
Protected Sub New(
    model As OpcNodeModel,
    parent As IOpcNode,
    name As OpcName,
    id As OpcNodeId,
    fileInfo As IOpcFileInfo)

Parameters

NameTypeDescription
modelOpcNodeModelThe 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.
parentIOpcNodeThe IOpcNode used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available.
nameOpcNameThe OpcName through that the new file node can be accessed.
idOpcNodeIdThe OpcNodeId through that the new file node can be identified and accessed.
fileInfoIOpcFileInfoThe file information to use by the new file node.

Exceptions

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

Properties ​

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.

csharp
public bool CanUserWrite { get; set; }
vbnet
Public Property CanUserWrite As Boolean

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<T> of the CanUserWrite property.

csharp
public OpcPropertyNode<bool> CanUserWriteNode { get; }
vbnet
Public ReadOnly Property CanUserWriteNode As OpcPropertyNode(Of Boolean)

Property value

OpcPropertyNode<Boolean>

An instance of the OpcPropertyNode<T> 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.

csharp
public bool CanWrite { get; set; }
vbnet
Public Property CanWrite As Boolean

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<T> of the CanWrite property.

csharp
public OpcPropertyNode<bool> CanWriteNode { get; }
vbnet
Public ReadOnly Property CanWriteNode As OpcPropertyNode(Of Boolean)

Property value

OpcPropertyNode<Boolean>

An instance of the OpcPropertyNode<T> class.

CloseNode ​

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

csharp
public OpcFileCloseMethodNode CloseNode { get; }
vbnet
Public ReadOnly Property CloseNode As OpcFileCloseMethodNode

Property value

OpcFileCloseMethodNode

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

DefaultTypeDefinitionId ​

protected · override

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

csharp
protected override OpcNodeId DefaultTypeDefinitionId { get; }
vbnet
Protected Overrides ReadOnly Property DefaultTypeDefinitionId As OpcNodeId

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).

Overrides

DefaultTypeDefinitionId

File ​

since v2.16

Gets the IOpcFileInfo used to access the file represented.

csharp
public IOpcFileInfo File { get; }
vbnet
Public ReadOnly Property File As IOpcFileInfo

Property value

IOpcFileInfo

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

FileInfo ​

Gets the FileInfo of the file represented.

csharp
public FileInfo FileInfo { get; }
vbnet
Public ReadOnly Property FileInfo As FileInfo

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.

csharp
public OpcFileGetPositionMethodNode GetPositionNode { get; }
vbnet
Public ReadOnly Property GetPositionNode As OpcFileGetPositionMethodNode

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.

csharp
public string MimeType { get; }
vbnet
Public ReadOnly Property MimeType As String

Property value

String

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

MimeTypeNode ​

Gets the OpcPropertyNode<T> of the MimeType property.

csharp
public OpcPropertyNode<string> MimeTypeNode { get; }
vbnet
Public ReadOnly Property MimeTypeNode As OpcPropertyNode(Of String)

Property value

OpcPropertyNode<String>

An instance of the OpcPropertyNode<T> class.

OpenCount ​

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

csharp
[CLSCompliant(false)]
public ushort OpenCount { get; }
vbnet
<CLSCompliant(False)>
Public ReadOnly Property OpenCount As UShort

Property value

UInt16

The number of currently valid file handles on the file.

OpenCountNode ​

Gets the OpcPropertyNode<T> of the OpenCount property.

csharp
[CLSCompliant(false)]
public OpcPropertyNode<ushort> OpenCountNode { get; }
vbnet
<CLSCompliant(False)>
Public ReadOnly Property OpenCountNode As OpcPropertyNode(Of UShort)

Property value

OpcPropertyNode<UInt16>

An instance of the OpcPropertyNode<T> class.

OpenNode ​

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

csharp
public OpcFileOpenMethodNode OpenNode { get; }
vbnet
Public ReadOnly Property OpenNode As OpcFileOpenMethodNode

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.

csharp
public OpcFileReadMethodNode ReadNode { get; }
vbnet
Public ReadOnly Property ReadNode As OpcFileReadMethodNode

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.

csharp
public OpcFileSetPositionMethodNode SetPositionNode { get; }
vbnet
Public ReadOnly Property SetPositionNode As OpcFileSetPositionMethodNode

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.

csharp
[CLSCompliant(false)]
public ulong Size { get; }
vbnet
<CLSCompliant(False)>
Public ReadOnly Property Size As ULong

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<T> of the Size property.

csharp
[CLSCompliant(false)]
public OpcPropertyNode<ulong> SizeNode { get; }
vbnet
<CLSCompliant(False)>
Public ReadOnly Property SizeNode As OpcPropertyNode(Of ULong)

Property value

OpcPropertyNode<UInt64>

An instance of the OpcPropertyNode<T> class.

WriteNode ​

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

csharp
public OpcFileWriteMethodNode WriteNode { get; }
vbnet
Public ReadOnly Property WriteNode As OpcFileWriteMethodNode

Property value

OpcFileWriteMethodNode

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

Methods ​

Close ​

since v2.33

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

csharp
public void Close(OpcContext context, uint fileHandle)
vbnet
Public Sub Close(context As OpcContext, fileHandle As UInteger)

Parameters

NameTypeDescription
contextOpcContext
fileHandleUInt32A file handle indicating the access request and thus indirectly the position inside the file.

Exceptions

ExceptionCondition
ArgumentNullException
OpcException

GetPosition ​

since v2.33

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

csharp
public ulong GetPosition(OpcContext context, uint fileHandle)
vbnet
Public Function GetPosition(
    context As OpcContext,
    fileHandle As UInteger) As ULong

Parameters

NameTypeDescription
contextOpcContext
fileHandleUInt32A 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

ExceptionCondition
ArgumentNullException
OpcException

InitializeDefaults ​

protected · override

Initializes the default values used by the OpcFileNode.

csharp
protected override void InitializeDefaults()
vbnet
Protected Overrides Sub InitializeDefaults()

Overrides

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 ​

since v2.33

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.

csharp
public uint Open(OpcContext context, OpcFileMode mode)
vbnet
Public Function Open(context As OpcContext, mode As OpcFileMode) As UInteger

Parameters

NameTypeDescription
contextOpcContext
modeOpcFileModeIndicates 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

ExceptionCondition
ArgumentNullException
OpcException

Read ​

since v2.33

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.

csharp
public ByteString Read(OpcContext context, uint fileHandle, int length)
vbnet
Public Function Read(
    context As OpcContext,
    fileHandle As UInteger,
    length As Integer) As ByteString

Parameters

NameTypeDescription
contextOpcContext
fileHandleUInt32A file handle indicating the access request and thus indirectly the position inside the file.
lengthInt32Defines 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

ExceptionCondition
ArgumentNullException
OpcException

ReadCanUserWrite ​

protected · virtual

Reads the value of the CanUserWrite property.

csharp
protected virtual OpcPropertyValue<bool> ReadCanUserWrite(
    OpcReadPropertyValueContext<OpcPropertyNode<bool>> context,
    OpcPropertyValue<bool> value)
vbnet
Protected Overridable Function ReadCanUserWrite(
    context As OpcReadPropertyValueContext(Of OpcPropertyNode(Of Boolean)),
    value As OpcPropertyValue(Of Boolean)) As OpcPropertyValue(Of Boolean)

Parameters

NameTypeDescription
contextOpcReadPropertyValueContext<OpcPropertyNode<Boolean>>The OpcReadPropertyValueContext<T> to use to read the property value.
valueOpcPropertyValue<Boolean>The preliminary OpcPropertyValue<T>.

Returns

OpcPropertyValue<Boolean>

The determined OpcPropertyValue<T>.

ReadCanWrite ​

protected · virtual

Reads the value of the CanWrite property.

csharp
protected virtual OpcPropertyValue<bool> ReadCanWrite(
    OpcReadPropertyValueContext<OpcPropertyNode<bool>> context,
    OpcPropertyValue<bool> value)
vbnet
Protected Overridable Function ReadCanWrite(
    context As OpcReadPropertyValueContext(Of OpcPropertyNode(Of Boolean)),
    value As OpcPropertyValue(Of Boolean)) As OpcPropertyValue(Of Boolean)

Parameters

NameTypeDescription
contextOpcReadPropertyValueContext<OpcPropertyNode<Boolean>>The OpcReadPropertyValueContext<T> to use to read the property value.
valueOpcPropertyValue<Boolean>The preliminary OpcPropertyValue<T>.

Returns

OpcPropertyValue<Boolean>

The determined OpcPropertyValue<T>.

SetPosition ​

since v2.33

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

csharp
public void SetPosition(OpcContext context, uint fileHandle, ulong position)
vbnet
Public Sub SetPosition(
    context As OpcContext,
    fileHandle As UInteger,
    position As ULong)

Parameters

NameTypeDescription
contextOpcContext
fileHandleUInt32A file handle indicating the access request and thus indirectly the position inside the file.
positionUInt64The 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

ExceptionCondition
ArgumentNullException
OpcException

Write ​

since v2.33

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.

csharp
public void Write(OpcContext context, uint fileHandle, ByteString data)
vbnet
Public Sub Write(
    context As OpcContext,
    fileHandle As UInteger,
    data As ByteString)

Parameters

NameTypeDescription
contextOpcContext
fileHandleUInt32A file handle indicating the access request and thus indirectly the position inside the file.
dataByteStringContains 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

ExceptionCondition
ArgumentNullException
OpcException