[etherlab-dev] foe_write result

Gavin Lambert gavinl at compacsort.com
Fri Sep 15 03:02:15 CEST 2017


That's odd, it definitely should be returning exit code 1 on any error
according to the code.  Are you sure you're testing it correctly?

 

But no, it does check whether the slave reports successfully receiving the
file or not and will return 1 in case of error on that end as well.
(Depending on the slave, this may or may not also indicate whether it was
successfully saved to the slave's internal memory or not.)

 

There is no documentation on the ioctls other than the source itself;
they're an internal interface mostly intended to be used only by the command
line tool and userspace library.  You will need to look at the source of the
tool for inspiration if you want to use them directly.  It's safer and
easier to use the tool commands if that suits your usage requirements
however; they just provide less detail for programmatic use.

 

From: Lingjie_Kong at amat.com [mailto:Lingjie_Kong at amat.com] 
Sent: Friday, 15 September 2017 12:07
To: Gavin Lambert <gavin.lambert at compacsort.com>; etherlab-dev at etherlab.org
Subject: RE: foe_write result

 

Hi Gavin,

 

Thanks for your advices and I really appreciated. I still get several
questions that I want to double check with you.

 

First, I assume the error on return non-zero exit code in case of error only
check whether the linux command is executed successfully or not. It does not
actually get the status of the slave to see whether it received the file
successfully. 

 

For example, I am trying to send a file in a folder over ethercat while
leave the folder empty by issuing the command

 

ethercat -m0 foe_write -p0 /var/ftp/gather/Drive_configuration.ccd

 

it shows that Failed to open '/var/ftp/gather/Drive_configuration.ccd' in
stderr. However, the exit code is still 0 which means no error. 

 

Second, is there a specific document on how to use ioctl to send file over
FoE in detail because I am not exactly sure on where to start on the source
code.

 

Best regards,

 

Lingjie (Kimi) Kong

Software Engineer - Servo Control Engineering || Common Solution Group ||
Applied Materials

lingjie_kong at amat.com <mailto:lingjie_kong at amat.com>  || Office:
(408)563-4400 || Cell: (858)242-9076

The content of this message is Applied Materials Confidential. If you are
not the intended recipient and have received this message in error, any use
or distribution is prohibited. Please notify me immediately by reply e-mail
and delete this message from your computer system. Thank you. 

** Save a tree. Please don't print this e-mail unless needed.

 

From: Gavin Lambert [mailto:gavinl at compacsort.com] 
Sent: Thursday, September 14, 2017 3:52 PM
To: Lingjie Kong --TR <Lingjie_Kong at amat.com <mailto:Lingjie_Kong at amat.com>
>; etherlab-dev at etherlab.org <mailto:etherlab-dev at etherlab.org> 
Subject: RE: foe_write result

 

The "foe_write" ethercat command will print an error on stderr and return a
non-zero exit code in case of error.  It's intended to be used interactively
by whoever is commissioning the system, although it can be used in a script.

 

Alternatively if you want to call it programmatically you could use the
equivalent master ioctl call directly, which provides the specific FoE error
code.

 

The unofficial patchset also adds some additional ecrt.h APIs that you can
call for FoE, although these require more "plumbing" to use.

 

From: Lingjie_Kong at amat.com <mailto:Lingjie_Kong at amat.com> 
Sent: Friday, 15 September 2017 10:25
To: etherlab-dev at etherlab.org <mailto:etherlab-dev at etherlab.org> 
Subject: [etherlab-dev] foe_write result

 

Hi,

 

I am working on file over ethercat (FOE) to send motor driver's
configuration file. From the ethercat 1.5.2 document, it looks like I can
use foe_write to send the file. However, I am just wondering that what I can
check to see whether the file transfer is successfully or not. 

 

Best regards,

 

Lingjie (Kimi) Kong

Software Engineer - Servo Control Engineering || Common Solution Group ||
Applied Materials

lingjie_kong at amat.com <mailto:lingjie_kong at amat.com>  || Office:
(408)563-4400

 

  _____  

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20170915/47ad3d9d/attachment.html>


More information about the etherlab-dev mailing list