Skip to main content



      Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » RS232(Serial Communication)
RS232 [message #1791448] Fri, 29 June 2018 10:25 Go to next message
Eclipse UserFriend
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 11:13 Go to previous messageGo to next message
Eclipse UserFriend
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 11:42 Go to previous messageGo to next message
Eclipse UserFriend
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 02:19 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 18:28:33 EDT 2025

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

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

Back to the top