[etherlab-dev] foe_write result
Gavin Lambert
gavinl at compacsort.com
Tue Sep 19 01:00:01 CEST 2017
It will print the error on stderr (which will include the error code from
the slave if the slave itself reports an error, which isn't shown in your
examples below). Otherwise no, there isn't any way to get anything more
detailed when using the command-line tool; you'd have to use the internal
ioctl directly if you wanted the specific error. (Though again, none of the
examples below are an ioctl error, they're erroring out before it gets to
that point.)
From: Lingjie_Kong at amat.com [mailto:Lingjie_Kong at amat.com]
Sent: Tuesday, 19 September 2017 05:15
To: Gavin Lambert <gavin.lambert at compacsort.com>; etherlab-dev at etherlab.org
Subject: RE: foe_write result
Hi Gavin,
I think I did make a mistake in my original test and what you said does
work!
I did three tests as below. The first test is without in the specified
folder, the second test is with file in the specified folder, and the third
test is with amplifier turned off. The first test result is 1, the second is
0, and the third is 1. What you said works.
One more follow up question that I might have is that when file transfer
works, the result is 0. Otherwise, the result is 1. Therefore, I am just
wondering that is there some more detailed information that I can log to see
what actually cause the failure of the transfer.
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 6:02 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
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>
[mailto:Lingjie_Kong at amat.com]
Sent: Friday, 15 September 2017 12:07
To: Gavin Lambert <gavin.lambert at compacsort.com
<mailto:gavin.lambert at compacsort.com> >; etherlab-dev at etherlab.org
<mailto: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/20170919/ef67053e/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 193601 bytes
Desc: not available
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20170919/ef67053e/attachment-0004.png>
More information about the Etherlab-dev
mailing list