FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
09-28-2021 03:32 PM
Is modbus RTU possible on the ctrlX CORE?
I have found that the S20-RS-UNI supports ModBus RTU but are there any libraries for this?
Solved! Go to Solution.
09-29-2021 12:57 PM - edited 02-17-2023 09:02 AM
For the S20-RS-UNI there is a library called CXA_MODBUSRTU. Please have a try with this one.
04-25-2022 04:09 PM
07-05-2022 04:29 PM
I see that there are many FBs in CXA_ModbusRTU behind the heading CXA_S20. These are all FBs based on the S20.
I assume that I can't use these FBs when working with a Modbus RTU module from beckhoff (EL6751), can I?
If not, is this Modbus RTU library also usable for third party RTU modules?
07-05-2022 04:39 PM - edited 07-05-2022 04:54 PM
Hi AndroidzZ,
we didn't test it with a Beckhoff module as we have our own.
Most likely this will not work. You can check if beckhoff provides examples for Codesys V3.
Or just take our module. 🙂
07-06-2022 07:57 AM
I would like nothing more than to use Bosch but I need a short term solution. And Beckhoff were the only cards I could get my hands on..
Thanks for the tip I will look for examples.
08-19-2022 09:51 AM
As a colleague of AndroidZz, I am currently testing the set-up with a CtrlX and RS485 card from Beckhoff (EL6021).
The EL6021 is connected to the CtrlX over EtherCat.
Wiring is OK, test with Beckhoff-PLC works well.
Basis for testing on CtrlX is "ModbusRTUtest.zip" as posted by TheCodeCaptain a few posts above.
- CXA_ModbusRTU.CXA_S20.IH_S20ComConfiguration works flawlessly. "bInOperation_ComConfig" immediately becomes TRUE.
- when calling "IH_S20MBRTUMaster" I get an error ACCESS_ERROR with ErrorIdent of CXA_TABLE-16#0C0F0000-16#0C850031.
Some questions:
- where can I find information regarding 16#0C850031
- how do I determine the slot number of the RS485 card?
In the example uiSlot is := 3... my RS485 card is as 3rd module after the EtherCat slave station...?
Kind regards,
08-19-2022 10:38 AM
Like mentioned in posts above and as the name suggest this library is usable for an S20 IO module. Please ask the supplier of your module for a library or example code usable for it.
Error codes and explanations can always be found in our online documentation. In your case see this page.
08-19-2022 12:01 PM
08-19-2022 02:45 PM - edited 08-19-2022 03:05 PM
Could you please send me this library so we can have a look to it.
It seems that this is a Twincat2 library. We cannot be sure that these are able to be used in the ctrlX PLC. We tested a library "Tc2_ModbusRTU.compiled-library-ge33" tht is part of the standard installation of Twincat and it could be inserted in our ctrlX PLC library manager. Please check if you can find and use this one.
08-19-2022 04:23 PM
Hi CodeShepherd,
I tried to export the library in Twincat in 2 ways:
- via export function of the "Library Repositry"
- look up the relevant file in "Explorer" --> see screenshot "Lib-file Twincat.png".
I assume you tested at your side with that same file. Am I correct?
When importing I keep getting the same message "Missing string table..."
Attached 2 pieces library in "Twincat-libs.zip":
- "Tc2_ModbusRTU.compiled-library" taken from export function
- "Tc2_ModbusRTU.compiled-library-ge33" copied from folder 3.4.2.0 of TwinCat
Kind regards,
08-26-2022 04:30 PM
We tested with the second library you mentioned. But I would have to check the version we used. As there is main vacation time in Germany, answers could need some time.
09-06-2022 03:20 PM
I am a colleague of Novice. I have updated ctrlX WORKS and the PLC app on the CORE both to version 1.16 but still get the same error as Novice, see attachment.
I do notice that:
"Tc2_ModbusRTU.compiled-library" is a COMPILED-LIBRARY file format and
"Tc2_ModbusRTU.compiled-library-ge33" is a COMPILED-LIBRARY -GE33 file format.
GE33 is also not directly recognized by the library repository. Must first set the explorer to 'All files (*.*)' when selecting files. see attachment 2
Therefore the question if the library repository is the right way to import the library?
09-07-2022 07:26 AM - edited 09-07-2022 07:27 AM
Sorry for the delay. We are using version 3.4.3.0 and it can be imported without any error in ctrlX PLC Engineering version 1.12 and 1.16 via the library repository.
09-07-2022 03:04 PM
Thanks for the info. I got that library installed now.
09-12-2022 01:55 PM
Hello @AndroidzZ ,
does it work with the installed Beckhoff library, the Modbus RTU communication, now?
09-13-2022 08:01 AM
i haven't had time to really figure it out yet
09-16-2022 10:42 AM
Maybe worth mentioning that we are using a temporary solution (RTU --> TCP gateway). I will put time in the library, but just not at the moment.
09-25-2023 04:13 PM