Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » RS232(Serial Communication)
RS232 [message #1791448] Fri, 29 June 2018 14:25 Go to next message
Reza ELC is currently offline Reza ELCFriend
Messages: 5
Registered: June 2018
Junior Member
I would like to read some data from the TX/RX of the Raspberry Pi and I don't see the RS232 communication FB in the 4diac. Is this discontinued in the latest version?
Re: RS232 [message #1791576 is a reply to message #1791448] Mon, 02 July 2018 15:13 Go to previous messageGo to next message
Martin Melik-Merkumians is currently offline Martin Melik-MerkumiansFriend
Messages: 104
Registered: March 2016
Senior Member
Hi Reza,

the last time I used serial communication, about two years ago, there was no dedicated FB for that. You just use the regular communication FBs, like Publish, to send data. (I am quite sure, as I implemented the serial comm layer for Windows and the associated RawDataComLayer)

If you don't need any special type of encoding, configure the comm FB to use the rawdata and serialcom layer. The configure string should look approx like raw[].ser[<your serial device>]

Best regards,
Re: RS232 [message #1791581 is a reply to message #1791576] Mon, 02 July 2018 15:42 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1239
Registered: January 2014
Senior Member

the same should work for linux. When you activate the posix architecture the sercomlayer should be available for selection in CMake.

Re: RS232 [message #1791622 is a reply to message #1791581] Tue, 03 July 2018 06:19 Go to previous message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member

The PARAMS data input is not only the name of the interface, but an array of strings like this:



INTERFACE_NAME: is the name of the file that will be use.
BAUD_RATE: Just a number according to the connection
BYTE_SIZE: Byte size of the connection
STOP_BITS: 1 for one bit, 2 for two bits, 3 for one comma five bits
PARITY: 0 for no parity, 1 for odd parity, 2 for even parity, 3 for mark parity (only windows), 4 for space parity (only windows)

So, an example could be:

raw[].ser[/dev/ttyS0, 115200, 8, 1, 1]

which will use the /dev/ttyS0 inteface, 115200 as baud rate, 8 bits byte, 1 stop bit and odd parity.

Previous Topic:How to integrate struct data type to 4DIAC IDE?
Next Topic:Memory Error
Goto Forum:

Current Time: Tue Jul 27 19:39:13 GMT 2021

Powered by FUDForum. Page generated in 0.02025 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top