Skip to content

Reference

OpcFileOpenMethodNode.FileOpenExCallback Delegate

Opens the file represented.

Reference

OpcFileOpenMethodNode.FileOpenExCallback Delegate ​

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

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.

Syntax ​

csharp
[CLSCompliant(false)]
public delegate uint OpcFileOpenMethodNode.FileOpenExCallback(
    OpcMethodContext context,
    byte mode)
vbnet
<CLSCompliant(False)>
Public Delegate Function OpcFileOpenMethodNode.FileOpenExCallback(
    context As OpcMethodContext,
    mode As Byte) As UInteger

Parameters ​

NameTypeDescription
contextOpcMethodContextThe OpcMethodContext to use when opening the file. This instance will be also updated with the outcome of the method call.
modeByteIndicates 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.

Remarks ​

This method does provide the following OpcResult information:

  • BadNotReadableThe file might be locked and thus not readable. This is also the case there the file is already opened for writing by the current or a different session.
  • BadNotWritableThe mode refers to Write but neither 'CanWrite' nor 'CanUserWrite' grant write access. This is also the case there the file is already opened by the current or a different session.
  • BadInvalidStateThe file is locked and thus not writable.
  • BadInvalidArgumentThe mode configuration is invalid.
  • BadNotFoundThe file maintained by the file node does not exist.
  • BadUnexpectedErrorAn unexpected error occurred while opening the file.

Applies to ​

PackageVersions
Opc.UaFx.Advancedv2.5–v2.59