CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Nov 14, 2019 5:17 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Sep 24, 2019 3:06 pm 
Offline

Joined: Thu Aug 23, 2018 8:42 am
Posts: 43
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.


Top
   
PostPosted: Fri Sep 27, 2019 8:57 am 
Offline

Joined: Thu Aug 23, 2018 8:42 am
Posts: 43
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited