Skip to main content



      Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Is 4diac support uart/serial?(Is 4diac support uart/serial?)
Is 4diac support uart/serial? [message #1848465] Fri, 03 December 2021 01:11 Go to next message
Eclipse UserFriend
I want to use RS232 & RS485 for communication, but I don't find any documentation.
Is CPosixSerCommLayer can be use? how?
If anyone knows, pls reply. thx a lot
Re: Is 4diac support uart/serial? [message #1848468 is a reply to message #1848465] Fri, 03 December 2021 03:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

you have to activate the Serial Com Layer in CMake, and then use the Communication FBs for transmitting data (PUBLISH, SUBSCRIBE).
To configure your serial interface, you have to put the configuration parameters on the ID input on your Comm-FB "ser[<InterfaceName>, <baudRate>, <byteSize>, <stopBits>, <parity>]"

Please note, that his only configures the communication parameters, not the representation of data, which has to be chained as usual with a dot '.' and the next communciation layer.

Best regards,
Martin
Re: Is 4diac support uart/serial? [message #1848500 is a reply to message #1848468] Sun, 05 December 2021 20:26 Go to previous messageGo to next message
Eclipse UserFriend
Thx a lot, but how to activate the Serial Com Layer in CMake?
In fact, I have used to try to modify "src/posix/CMakeLists.txt":
forte_add_network_layer(SER ON "ser" CPosixSerCommLayer posixsercommlayer "Enable Forte serial line communication")
and i see after complied, it has the file "./src/CMakeFiles/FORTE_LITE.dir/arch/posix/posixsercommlayer.cpp.o
"
but when I try to use it with a PUBLISH block with ID like:
ser[/dev/ttyAMA2,115200,8,1,0] or
raw[].ser[/dev/ttyAMA2,115200,8,1,0]

I just see that after init, it returns NO_SOCKET
:(

pls tell me what's wrong, thx

Re: Is 4diac support uart/serial? [message #1848504 is a reply to message #1848500] Mon, 06 December 2021 04:06 Go to previous messageGo to next message
Eclipse UserFriend
Parity should be one of the following (all caps):
- NONE
- ODD
- EVEN
- MARK

You also need an extra parameter at the end for the termination symbol, which should be one of the following (posix serial communication does not use this actually, but rather the windows one. Still this parameters needs to be there following the current implementation. You can try with $n):
- $n
- $r
- $r$n

So, the PARAM looks actually like ser[<InterfaceName>, <baudRate>, <byteSize>, <stopBits>, <parity>, <terminationSymbol>]
Re: Is 4diac support uart/serial? [message #1848519 is a reply to message #1848504] Mon, 06 December 2021 14:38 Go to previous messageGo to next message
Eclipse UserFriend
Also please don't modify the CmakeList.txt of 4diac FORTE core elements unless there is a bug in them. You can activate all the modules and communication systems during the cmake configuration step, either from the command line or from CMake GUI.
Re: Is 4diac support uart/serial? [message #1848522 is a reply to message #1848519] Mon, 06 December 2021 20:02 Go to previous messageGo to next message
Eclipse UserFriend
thx. But 4diac has not enough document, and nowhere to find how to activate serial module.
Re: Is 4diac support uart/serial? [message #1848523 is a reply to message #1848504] Mon, 06 December 2021 20:13 Go to previous messageGo to next message
Eclipse UserFriend
Thx. I modify the ID like "ser[/dev/ttyAMA2,115200,8,1,NONE,$n]", but still can't work, it returns NO_SOCKET.
Re: Is 4diac support uart/serial? [message #1848540 is a reply to message #1848522] Tue, 07 December 2021 04:20 Go to previous message
Eclipse UserFriend
I know that our documentation is not perfect. We are very great full for any support for improving it.
Previous Topic:Editing Algorithms in 4diac
Next Topic:Run New basic FB in 4diac IDE and forte
Goto Forum:
  


Current Time: Mon Jul 07 13:49:27 EDT 2025

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

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

Back to the top