UA Bundle SDK .NET  2.3.1.334
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Groups Pages
UnifiedAutomation.UaServer.IFileMethods Interface Reference

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

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

Public Member Functions

StatusCode Close (RequestContext context, FileModel model, uint FileHandle)
 Close is used to close a file represented by a FileType. When a client closes a file, the handle becomes invalid. More...
 
StatusCode GetPosition (RequestContext context, FileModel model, uint FileHandle, out ulong Position)
 GetPosition is used to provide the current position of the FileHandle. More...
 
StatusCode Open (RequestContext context, FileModel model, byte Mode, out uint FileHandle)
 Used to open a file represented by an Object of FileType. More...
 
StatusCode Read (RequestContext context, FileModel model, uint FileHandle, int Length, out byte[] Data)
 Read is used to read a part of the file starting from the current file position. More...
 
StatusCode SetPosition (RequestContext context, FileModel model, uint FileHandle, ulong Position)
 Used to set the current position of the FileHandle. More...
 
StatusCode Write (RequestContext context, FileModel model, uint FileHandle, byte[] Data)
 Write is used to write 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 
)

Close is used to close a file represented by a FileType. When a client closes a file, the handle becomes invalid.

Parameters
context
model
FileHandleA handle 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 
)

GetPosition is used to provide 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 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 
)

Used to open a file represented by an Object of FileType.

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

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

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.

Parameters
context
model
FileHandleA handle indicating the access request and thus indirectly the position inside the file.
LengthDefines 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.
DataContains the returned data of the file.
Returns

Implemented in UnifiedAutomation.UaServer.FileModel.

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

Used to set 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 
)

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

Parameters
context
model
FileHandleA handle 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.
Returns

Implemented in UnifiedAutomation.UaServer.FileModel.


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