.NET Based OPC UA Client/Server SDK  2.6.0.418
UnifiedAutomation.UaServer.IFileMethods Interface Reference

The interface for methods implemented on the FileModel object. More...

Inherited by UnifiedAutomation.UaServer.FileModel, UnifiedAutomation.UaServer.IAddressSpaceFileMethods, and UnifiedAutomation.UaServer.ITrustListMethods.

Public Member Functions

StatusCode Close (RequestContext context, FileModel model, uint FileHandle)
 Closes a file represented by a UnifiedAutomation.UaServer.FileModel. More...
 
StatusCode GetPosition (RequestContext context, FileModel model, uint FileHandle, out ulong Position)
 Provides the current position of the FileHandle. More...
 
StatusCode Open (RequestContext context, FileModel model, byte Mode, out uint FileHandle)
 Opens a file represented by an object of UnifiedAutomation.UaServer.FileModel. More...
 
StatusCode Read (RequestContext context, FileModel model, uint FileHandle, int Length, out byte[] Data)
 Reads a part of the file starting from the current file position. More...
 
StatusCode SetPosition (RequestContext context, FileModel model, uint FileHandle, ulong Position)
 Sets the current position of the FileHandle. More...
 
StatusCode Write (RequestContext context, FileModel model, uint FileHandle, byte[] Data)
 Writes a part of the file starting from the current file position. More...
 

Detailed Description

The interface for methods implemented on the FileModel object.

Member Function Documentation

StatusCode UnifiedAutomation.UaServer.IFileMethods.Close ( RequestContext  context,
FileModel  model,
uint  FileHandle 
)

Closes a file represented by a UnifiedAutomation.UaServer.FileModel.

When a client closes a file, the handle becomes invalid.

Parameters
context
model
FileHandleA handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file.
Returns

Implemented in UnifiedAutomation.UaServer.FileModel.

StatusCode UnifiedAutomation.UaServer.IFileMethods.GetPosition ( RequestContext  context,
FileModel  model,
uint  FileHandle,
out ulong  Position 
)

Provides the current position of the FileHandle.

Parameters
context
model
FileHandleA handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file.
PositionThe position of the FileHandle in the file. If UnifiedAutomation.UaServer.IFileMethods.Read or UnifiedAutomation.UaServer.IFileMethods.Write is called, it starts at that position.
Returns

Implemented in UnifiedAutomation.UaServer.FileModel.

StatusCode UnifiedAutomation.UaServer.IFileMethods.Open ( RequestContext  context,
FileModel  model,
byte  Mode,
out uint  FileHandle 
)

Opens a file represented by an object of UnifiedAutomation.UaServer.FileModel.

When a client opens a file, it gets a FileHandle that is valid while the session is open. Clients shall use the UnifiedAutomation.UaServer.IFileMethods.Close method to release the handle when they do not need access to the file anymore. Clients can open the same file several times for reading. A request to open for writing shall return Bad_NotWritable when the file is already opened.

Parameters
context
model
ModeIndicates whether the file should be opened only for read operations or for read and write operations and where the initial position is set. The mode is an 8-bit unsigned integer used as bit mask with the structure defined in the following table:
Field Bit Description
Read 0 The file is opened for reading. If this bit is not set the UnifiedAutomation.UaServer.IFileMethods.Read method cannot be executed.
Write 1 The file is opened for writing. If this bit is not set the UnifiedAutomation.UaServer.IFileMethods.Write method cannot be executed.
EraseExisting 2 This bit can only be set if the file is opened for writing (Write bit is set). The existing content of the file is erased and an empty file is provided.
Append 3 When the Append bit is set the file is opened at end of the file, otherwise at begin of the file. The UnifiedAutomation.UaServer.IFileMethods.SetPosition Method can be used to change the position.
FileHandleA handle for the file used in other method calls indicating not the file (this is done by the object of the method call) but the access request and thus the position in the file. The FileHandle is generated by the server and is unique for the Session. Clients cannot transfer the FileHandle to another Session but need to get a new FileHandle by calling the UnifiedAutomation.UaServer.IFileMethods.Open method.
Returns

Implemented in UnifiedAutomation.UaServer.TrustListModel, and UnifiedAutomation.UaServer.FileModel.

StatusCode UnifiedAutomation.UaServer.IFileMethods.Read ( RequestContext  context,
FileModel  model,
uint  FileHandle,
int  Length,
out byte[]  Data 
)

Reads a part of the file starting from the current file position.

The file position is advanced by the number of bytes read.

Parameters
context
model
FileHandleA handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file.
LengthDefines the length in bytes that should be returned in data, starting from the current position of the file handle. If the end of file is reached, all data until the end of the file is returned. The Server is allowed to return less data than the specified length. Only positive values are allowed.
DataContains the returned data of the file. If the ByteString is empty, it indicates that the end of the file is reached.
Returns

Implemented in UnifiedAutomation.UaServer.FileModel.

StatusCode UnifiedAutomation.UaServer.IFileMethods.SetPosition ( RequestContext  context,
FileModel  model,
uint  FileHandle,
ulong  Position 
)

Sets the current position of the FileHandle.

Parameters
context
model
FileHandleA handle indicating the access request and thus indirectly the position inside the file.
PositionThe position to be set for the FileHandle in the file. If UnifiedAutomation.UaServer.IFileMethods.Read or UnifiedAutomation.UaServer.IFileMethods.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.
Returns

Implemented in UnifiedAutomation.UaServer.FileModel.

StatusCode UnifiedAutomation.UaServer.IFileMethods.Write ( RequestContext  context,
FileModel  model,
uint  FileHandle,
byte[]  Data 
)

Writes a part of the file starting from the current file position.

The file position is advanced by the number of bytes written

Parameters
context
model
FileHandleA handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file.
DataContains 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 UnifiedAutomation.UaServer.IFileMethods.Close method with the FileHandle. Writing an empty or null ByteString returns a Good result code without any effect on the file.
Returns

Implemented in UnifiedAutomation.UaServer.FileModel.


The documentation for this interface was generated from the following file: