|
Re: Is 4diac support uart/serial? [message #1848468 is a reply to message #1848465] |
Fri, 03 December 2021 08:44 |
Martin Melik Merkumians 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 |
overmas zhang 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 #1848519 is a reply to message #1848504] |
Mon, 06 December 2021 19:38 |
|
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.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04583 seconds