Serial Comm Issues on Beckhoff CX5120

Omar Ampyx
2019-09-24
2019-09-27
  • Omar Ampyx - 2019-09-24

    Hi,

    I am trying to run 422 serial communications on a Beckhoff CX5120 running WES7 and the Codesys RTE. For that I am using a USB to Serial converter with an FTDI chip.

    Writing data is flawless but reading data is not. Every now and then the acquired data gets corrupted in two ways:

    • Bytes on the read buffer shift positions
    • Bytes values go to 0

    Around the same time the RTE reports the following system errors in a recurrent way:

    <Entry severity="warning" component="CmpOPCUAStack" user="nobody" timestamp="24-Sep-19 14:55:30" infoId="0">OpcUa_TcpListener_ReadEventHandler: Process Request returned an error (0x800B0000)!</Entry>
    <Entry severity="error" component="CmpOPCUAStack" user="nobody" timestamp="24-Sep-19 14:55:30" infoId="0">OpcUa_SecureListener_ProcessRequest: Closing channel due error 0x800B0000!</Entry>
    <Entry severity="error" component="CmpOPCUAStack" user="nobody" timestamp="24-Sep-19 14:55:30"
    

    I also observed that the PLC load fluctuates around the same time it reads corrupted data, on the other hand, the incoming data is just fine when the CPU stays at a steady value.

    Could you help me please?

    PS: I have the same codesys application running on a raspberri Pi and all data is perfect.

     
  • Omar Ampyx - 2019-09-27

    Hi All,

    I finally found the causes of the problem.

    • Cause 1: the CAA function block ComRead sometimes reads less bytes than expected (actual number of bytes read are outputted in szSize). It is very important to react to this otherwise the data will be shifted from that point on!

    • Cause 2: USB ports in windows have lower priority that system tasks and the OS will definitely cut CPU resources to USB related tasks if needed. We have experienced that this leads to the incoming serial data to be heavily corrupted!!

    Further tests need to be carried out with a dedicated serial port instead of via USB converter.

    Regards

     

Log in to post a comment.