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 Sat Dec 15, 2018 3:20 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Nov 08, 2018 5:56 pm 
Offline

Joined: Fri Sep 07, 2018 8:16 am
Posts: 13
Hi at all! :)

I'm doing some tests in order to use SANYO EtherCAT Drivers in our applications.

I developed some code in a new Codesys project and it works fine.

If I put this code togheter with the machine's whole code, ETC_CO_SdoWrite4 return that it is busy.
Rightly, when "udiTimeOut" is expired , it set "xError" and the error is "ETC_CO_TIMEOUT".

I can't understand why.
In this project some ETC devices are disabled because they'arent connected, but I don't think that this could generate this error.

Some one can gently help me?

Best Regards,
Gianmarco


Top
   
PostPosted: Thu Nov 08, 2018 10:49 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3018
Hi,
did you check this with the CODESYS store example..?
https://store.codesys.com/ethercat-exam ... __store=en

BR
Edwin


Top
   
PostPosted: Fri Nov 09, 2018 9:31 am 
Offline

Joined: Fri Sep 07, 2018 8:16 am
Posts: 13
Hi Edwin, thank you!

I checked this example the first time that I developed the code.
I'm using "ETC_CO_Write4" in the same way, the only difference is that all the inputs/outputs of the function are sent to/recived by a FB in a library.

If I use the same "method" in a empty project, it works, but in the machine's whole code it's always "busy". Even if I set a 10" timeout.
It seems strange because I only copy PRGs from a project to the other.

Best Regards,
Gianmarco


Top
   
PostPosted: Fri Nov 09, 2018 3:30 pm 
Offline

Joined: Mon Nov 03, 2014 7:15 am
Posts: 42
Hi Gianmarco!

Did you check your program, if the instance of this ETC_CO_SdoWrite4 that you are calling is called cyclical and is not interrupted? In other words, once you set the xExecute, is the function block called in each cycle of the program until it is xDone? In the past I had some trouble, when I cancelled the processing of the function block during it was active.

Another problem can be caused by multiple data transfers to the same slave at the same time. Some slaves cannot handle more than one mailbox message, so that you have to wait before starting a new ETC_CO - function (not only write, even read maybe critical). So make sure you have only one acyclic call active to one slave at a time.

I hope that helps you :)
Good luck

Alfred


Top
   
PostPosted: Wed Nov 14, 2018 11:39 am 
Offline

Joined: Fri Sep 07, 2018 8:16 am
Posts: 13
Hi Alfred, thanks for the answer

Yes, the instance is called cyclical and ther's no multiple data tranfer...

The same piece of code in a empty project works very well, but here in the "whole code" there's this problem. I did only a "copy-paste" :cry:

Maybe in the second case there's too much code to process... is it possible? This is the only variable, I think..

Best Regards,
Gianmarco


Top
   
PostPosted: Wed Nov 14, 2018 4:45 pm 
Offline

Joined: Mon Nov 03, 2014 7:15 am
Posts: 42
Hi Gianmarco!
Quote:
Maybe in the second case there's too much code to process...

No, I don't think it's too much code. You can try the following:
In your "big" program eliminate the call of the SDO_Write (just comment it).
Insert a new program in your code, where you do only one call to one slave - like you had in your testprogram.

Is it working now?

Best regards
Alfred


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


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