Skip to main content

One post tagged with "RS232"

View All Tags

Serial (RS232) Dispatcher

This application shuffles data between four serial ports. The serial ports anticipate encapsulated traffic; that is, each message (packet) starts and stops with a predefined character. This is how the app knows where messages begin and end. For each RS232 port, it is possible to define where this port's traffic gets routed.

As an example of the last point, imagine a system that routes:

  • Incoming packets of port 1 to ports 2 and 4 (blue arrows on the diagram below)
  • Incoming packets of port 2 to port 3 (green arrows)
  • Incoming packets of port 3 to port 1 (purple arrows)
  • Incoming packets of port 4 to port 1 as well (orange arrows)
RS232 Dispatcher

The project achieves routing by using four flows, one for each port. Here is how it looks for the first port:

RS232 Dispatcher

p0_1, p0_2, and p0_3 are settings defined on the Settings page of the Features tab. Settings are edited through the app's web interface, a.k.a. the web console (Features tab again). Start and stop sequences are set in the properties sheet of the On Serial Data block. You can use \x notation for non-printable characters, for example, \x0D for CR (carriage return).

RS232 Dispatcher

This simple project demonstrates how app development can be dramatically simplified with AppBlocks. Nothing in this project's source code would be particularly complex, but it would still require a lot of tedious work! The use of AppBlocks slashes the development time at least by an order of magnitude and, in all probability, even more.