File Operation
This section covers how to use the OPC UA File Operation node to read and write files stored on OPC UA servers that implement the FileType interface (ns=0;i=11575).
Overview
The OPC UA File Operation node enables interaction with files on OPC UA servers, supporting:
- Reading file contents in various formats (text, binary, line-by-line)
- Writing and overwriting file data
- Appending data to existing files
- Checking file sizes
- Multiple text encodings (UTF-8, Shift_JIS, GB2312, and more)
- Automatic handling of large files with chunking
Tutorials
- Reading Files - Read file contents from OPC UA servers
- Writing Files - Create or overwrite files on OPC UA servers
- Appending to Files - Add data to existing files
Quick Reference
Common Operations
Read a text file:
- Mode: Read
- Format: utf8
- Encoding: utf8
Write JSON data:
- Mode: Write
- Encoding: utf8
- Payload: JavaScript object (auto-converted to JSON)
Append log entries:
- Mode: WriteAppend
- Encoding: utf8
- Payload: String with
\nat the end
Check file size:
- Mode: ReadSize
- Output:
msg.payloadcontains size in bytes
See Also
- Browse Node - Discover available files on the server
- Read Node - Read file metadata properties