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 » Is 4diac support uart/serial?(Is 4diac support uart/serial?)
Is 4diac support uart/serial? [message #1848465] Fri, 03 December 2021 06:11 Go to next message
overmas zhang is currently offline overmas zhangFriend
Messages: 12
Registered: June 2021
Junior Member
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 08:44 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
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] Mon, 06 December 2021 01:26 Go to previous messageGo to next message
overmas zhang is currently offline overmas zhangFriend
Messages: 12
Registered: June 2021
Junior Member
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 09:06 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 16
Registered: January 2021
Junior Member
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 19:38 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

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] Tue, 07 December 2021 01:02 Go to previous messageGo to next message
overmas zhang is currently offline overmas zhangFriend
Messages: 12
Registered: June 2021
Junior Member
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] Tue, 07 December 2021 01:13 Go to previous messageGo to next message
overmas zhang is currently offline overmas zhangFriend
Messages: 12
Registered: June 2021
Junior Member
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 09:20 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

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: Fri Apr 26 08:02:57 GMT 2024

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

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

Back to the top