RevPI direct access to the serial port of a Serial Gatway

Topics about the Hardware of Revolution Pi
Post Reply
moty66
Posts: 1
Joined: 01 Feb 2018, 15:41

RevPI direct access to the serial port of a Serial Gatway

Post by moty66 »

Is there anyway that I can assess the serial port on the Serial Gateway as a tty?
I am interested to have a bidirectional communication between a NodeJS process and the serial port on the gateway but unfortunately I can't see the gateway a tty device loaded by the kernel

Regards
M.
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41

Re: RevPI direct access to the serial port of a Serial Gatway

Post by volker »

Sorry, but that is not possible. This is one reason why we have placed a text in the shop strongly requesting our customers to contact us in advance before buying a gateway module. All gateway modules are designed to be used as a pair of two without any PLC in between. Therefore their data exchange is strictly cyclical just as in all the field busses they work with. A tty port is normally used in a a-cyclical (event based) way: One device is sending something whenever it has data or needs to get data. The other device is responding to this request. In a typical field bus scenario there is a first startup phase where the master is collecting information about the slaves and then switches to a cyclical data exchange where data is reflecting the current Io state of the slave. So if a contact is closed the master is again and again getting a "1" for this input and not just when the event has occurred.
Our gateway module "serial" is out of the box working like a modbus slave. All data which is polled by a master or sent by a master is read/written from/to a memory block of 512 byte in and 512 byte output. This block is cyclically exchanged with a second gateway module or (in case of use with RevPi Core) with the central process image of RevPi Core. So if you want to implement a message based serial communication you must implement a kind of postbox strategy where there is a flag in this data block indicating a new message needs to be transferred over the serial bus. The serial gateway then needs to be configured with a script (using the scripter and the program interface plug) which listens to this flag and reacts by sending another part of the memory block as a payload of the message on the serial bus. It the needs to set another flag to show RevPi communication software (which you need to write) that the message si successfully sent and the memory block is free for the next message. This postbox needs to be implemented in both directions if you need to communicate bi-directional.
I think this was most probably not what you expected to do, right? There are better ways to get a serial tty on the RevPi. The easiest way is to use the USB inferface and e.g. one of our USB to serial converters for DIN rail and 24 V. Or you wait for our RevPi Connect (shown on SPS Drives Fair November 2017) to be available. This RevPi version comes with a n RS485 screw terminal and has options for adding new devices on the "ConBridge connector" which could well be also serial modules.
Unser RevPi Motto: Don't just claim it - make it!
Post Reply