4.2.4 Read

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.

Signature

	Read(
		 [in] UInt32 fileHandle
		 [in] Int32 length
		 [out] ByteString data
		);
Argument Description
fileHandleA handle indicating the access request and thus indirectly the position inside the file.
Length

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

Method Result Codes (defined in Call Service)

Result Code Description
Bad_InvalidArgumentSee OPC 10000-4 Invalid file handle in call or non-positive length.
Bad_UnexpectedErrorSee OPC 10000-4 for a general description.
Bad_InvalidStateSee OPC 10000-4 for a general description. File was not opened for read access.

Table 4 specifies the AddressSpace representation for the Read Method.

Table 4 – Read Method AddressSpace definition
Attribute Value
BrowseNameRead
References NodeClass BrowseName DataType TypeDefinition ModellingRule
HasPropertyVariableInputArgumentsArgument[] PropertyTypeMandatory
HasPropertyVariableOutputArgumentsArgument[] PropertyTypeMandatory
Conformance Units
Base Info FileType Base