This section is about writing parameter data to an IO-Link device using Node-RED. The target is the creation of a specific Node-RED node for the write operation of the parameter’s index and sub-index.
Starting point is the configuration web interface. If a parameter is writeable (Read/Write, Write Only), the Node-RED node creation link is shown at the variable:
In the new tab that opens, click on „Copy to clipboard“:
In Node-RED Flows workspace, import the node (ether with the menu or CTRL-I).
Paste the content of the clipboard to the node/flow JSON box:
The specific node is the imported into Node-RED:
- The Input Port receives the input data. This darta needs to be formatted as described in the sections below. The node is triggered by writing data to this port.
- The Error Number and Error Text hold the error number (see https://pinetek-networks.de/knowledge-base/pinebox/10-appendix/appendix-error-codes/)
- Output is the data that is read back from the parameter (Write-Read-Verification). For datatypes like Numbers or Strings, this is usually the data that was written. For more complex datatypes like BLOB (represented by OctetString data), this might be formatted data that requires unpacking before further treatment.
Numbers (Integers, Bool) and Strings
Numbers and strings can be put to the input of the Write Parameter Node in the native Javascript format. The input is expected as payload to the message.
OctetString
There are two ways to format OctetSting input data:
Format as buffer
Example: Change Node
For the buffer, the data needs to be formatted accordingly:
Format as Base64 string
Example: Change Node
For the string, the data needs to have Base64 encoding: