Skip to main content

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

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 \n at the end

Check file size:

  • Mode: ReadSize
  • Output: msg.payload contains size in bytes

See Also