4.2.5 Write

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.

Signature

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

Contains 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 fileHandle.

Writing an empty or null ByteString returns a Good result code without any affect on the file.

Method Result Codes (defined in Call Service)

Result Code Description
Bad_InvalidArgumentSee OPC 10000-4 for a general description. Invalid file handle in call.
Bad_NotWritableSee OPC 10000-4 for a general description. File might be locked and thus not writable.
Bad_InvalidStateSee OPC 10000-4 for a general description. File was not opened for write access.

Table 5 specifies the AddressSpace representation for the Write Method.

Table 5 – Write Method AddressSpace definition
Attribute Value
BrowseNameWrite
References NodeClass BrowseName DataType TypeDefinition ModellingRule
HasPropertyVariableInputArgumentsArgument[] PropertyTypeMandatory
Conformance Units
Base Info FileType Base