🚧RS-232/485 (WIP)

RS-232 and RS-485 are both serial communication protocols used for data transfer between devices. RS-232 is commonly employed for short-distance communication, typically under 50 feet, and supports point-to-point connections at lower speeds. Conversely, RS-485 is designed for longer distances, up to 4000 feet, and supports multi-point configurations with higher data rates. The key differences include their physical wiring setups, signal voltage levels, and maximum distance capabilities.

RS-232 is often found in older computer serial ports, connections to modems, and in certain industrial applications where simple point-to-point communication is sufficient. For example, connecting a computer to a printer or a microcontroller to a GPS module.

RS-485 is widely used in industrial automation systems, such as connecting PLCs (Programmable Logic Controllers) to various sensors and actuators. It is also common in building management systems (BMS), where multiple devices like HVAC systems, lighting controls, and other peripherals need to communicate over long distances in a multi-drop network configuration.

Functions

create

Instantiates a serial connection to a specific port.

In the options box, insert as an object the necessary parameters.

list

Lists all serial ports found on the system.

open

Opens the connection of the given serial port.

isOpen

getBinding

changeBaudRate

Changes the baud rate for an open port. Parameter baudRate can be set as 110, 300, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, or 115200.

write

Writes data to the given serial port and waits until all output data is transmitted to the serial port. Use the input box for data to insert the data you want to write. You can also use suffix to always add specific information at the end of the data you want to write.

If you need to transport a carriage return use <CR>, for linefeed use <LF> and for both together use <CRLF>.

read

Read data from a port.

close

Closes an open connection. If there are in-progress writes when the port is closed the writes will error.

onError

Reports about any errors

onData

Listens to data events

Last updated

Change request #284: