Is 4diac support uart/serial? [message #1848465] |
Fri, 03 December 2021 01:11  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.27151 seconds