Skip to content

encodeJson

Canonical path: o6.encodeJson

encodeJson

encodeJson(obj)

Encode an OPC UA value with the reversible JSON encoding.

Parameters:

Name Type Description Default
obj Any

One scalar value of a registered OPC UA type.

required

Returns:

Type Description
bytes

The OPC UA JSON representation of obj, as UTF-8 bytes.

Raises:

Type Description
TypeError

obj is not a scalar value of a registered OPC UA type.

StatusCodeError

open62541 rejected the value.