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
Hi,
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?
Thanks,
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: 117
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,
Martin
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: 1585
Registered: January 2014
Senior Member

Hi,

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

Cheers,
Alois
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
Hi,

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

raw[].ser[INTERFACE_NAME, BAUD_RATE, BYTE_SIZE, STOP_BITS, PARITY]

where:

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: Sat Apr 27 02:44:28 GMT 2024

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

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

Back to the top