Serial Write Node

The Serial Write Node allows you to write to a specified serial port.

Serial Write Node

Node Properties

Configuration

Configuration includes the following fields…

Serial Write Node Configuration

  • Serial Path Template: (Required) A string template that resolves to the port at which the value should be written.
  • Baud Rate Template: (Required) The baud rate, speed of communication over a data channel, which by default is 9600. For agent versions prior to 1.19.2 the following are the accepted baud rates: 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 128000, 256000. As of agent version 1.19.2 you may specify any positive integer for this field. This field is templatable.

In Gateway Edge Agent versions 1.19.0 and below, the following options are defaulted:

  • Data Bits: 8
  • Stop Bits: 1
  • Parity: none
  • RTS/CTS: false.

However in GEA v1.19.0 and higher, you may specify these options.

  • Parity Template: (Required) The parity, whether or not a parity bit is set and its value. By default, this is none. Other valid values include even, odd, mark, and space. This field is templatable.
  • Data Bits Template: (Required) The number of bits per character, set to 8 by default. Other valid values include 5, 6, and 7. This field is templatable.
  • Stop Bits Template: (Required) The number of stop bits to signal the end of a character. Default is 1, may also be set to 2. This field is templatable.
  • RTS/CTS Template: (Required) Boolean that indicates whether RTS/CTS handshaking is in use. Default false. This field is templatable.
  • Write Template: (Required) A string template that is written to the specified serial port.
  • Write Encoding: (Required) The character encoding of the write template. The following are valid character encoding options: ASCII, UTF8, UTF16LE, Base64, Binary, Hex.

Result

The Result Path defines where on the payload to store the result of the serial write operation. The result will be true when successfully written. Otherwise, if unsuccessful, an object will be placed at the result path with the key “error” such that the value is the error message.

The following is an example of a successful write if you set your result path to serialResult:

{
  "serialResult": true
}

Node Errors

The following is an example of a failure to write if you set your result path to serialResult:

{
  "serialResult": { "error": "Port unexpectedly closed." }
}

Here are some related nodes:

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.