<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
You can use ecrt_master_state, please see ecrt.h:<br>
<br>
<br>
/** Reads the current master state.<br>
*<br>
* Stores the master state information in the given \a state
structure.<br>
*/<br>
void ecrt_master_state(<br>
const ec_master_t *master, /**< EtherCAT master. */<br>
ec_master_state_t *state /**< Structure to store the
information. */<br>
);<br>
<br>
/** Master state.<br>
*<br>
* This is used for the output parameter of ecrt_master_state().<br>
*<br>
* \see ecrt_master_state().<br>
*/<br>
typedef struct {<br>
unsigned int slaves_responding; /**< Number of slaves in the
bus. */<br>
unsigned int al_states : 4; /**< Application-layer states of
all slaves.<br>
The states are coded in the lower
4 bits.<br>
If a bit is set, it means that at
least one<br>
slave in the bus is in the
corresponding<br>
state:<br>
- Bit 0: \a INIT<br>
- Bit 1: \a PREOP<br>
- Bit 2: \a SAFEOP<br>
- Bit 3: \a OP */<br>
unsigned int link_up : 1; /**< \a true, if the network link
is up. */<br>
} ec_master_state_t;<br>
<br>
Best regards<br>
<br>
<br>
Andreas<br>
<br>
<br>
<br>
Am 23.05.2012 11:23, schrieb <a class="moz-txt-link-abbreviated" href="mailto:ronaldo.mercado@diamond.ac.uk:">ronaldo.mercado@diamond.ac.uk:</a>
<blockquote
cite="mid:3D65E04168FA09429B823CA3FE25C447267D2B37@EXCHMBX01.fed.cclrc.ac.uk"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<title>bus status recognition</title>
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">We
use ecrt_master_get_slave as part of the poll cycle to fetch
the slaves’ status.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Ronaldo<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm
0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="EN-US"> <a class="moz-txt-link-abbreviated" href="mailto:etherlab-users-bounces@etherlab.org">etherlab-users-bounces@etherlab.org</a>
[<a class="moz-txt-link-freetext" href="mailto:etherlab-users-bounces@etherlab.org">mailto:etherlab-users-bounces@etherlab.org</a>]
<b>On Behalf Of </b>Ian Norton<br>
<b>Sent:</b> 18 May 2012 08:47<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> [etherlab-users] bus status
recognition<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Hi,</span>
<o:p>
</o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">I'm
running etherlab master in a regular Centos 6 kernel.</span>
<o:p></o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">The
system functions fine, but it appears still to be fine if
the network cable is unplugged!</span>
<o:p></o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">The
normal command line commands still show all slaves happily
working and in OP mode etc, and my user code still
receives the coorect number of responding slaves form
ecrt_master_state.</span><o:p></o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Does
anyone know how to detect an unplugged/broken network
cable during operation?</span>
<o:p></o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">regards</span>
<o:p></o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Ian
R.K. Norton</span>
<br>
<span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">System
Support Engineer</span>
<br>
<span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Aircraft
Engineering</span>
<br>
<span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Cranfield
Aerospace Ltd</span>
<br>
<span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Cranfield</span>
<br>
<span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Bedford
MK43 0AL</span>
<br>
<span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">UK</span>
<o:p></o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Tel
- +44 (0) 1234 754926</span>
<br>
<span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Fax
- +44 (0) 1234 752375</span>
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p>'All technology information within this Email has been
Exported from the United Kingdom under Open General Export
Licence (Technology for Military Goods) - BIS Reference:
GBOGE2008/00462'<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p><br>
************************************************************
<o:p></o:p></p>
<p>DISCLAIMER: <o:p></o:p></p>
<p>This email and any attachments are confidential to the
intended recipient and may also be privileged. For those
other than the recipient any disclosure, copying,
distribution, or any action taken or omitted to be taken in
reliance on such information is prohibited and may be
unlawful. If you are not the intended recipient please
delete it from your system and notify the sender immediately
by telephoning +44(0) 1234 754978 or by immediate reply via
e-mail to the Sender.
<o:p></o:p></p>
<p>Should the content of this Email, including any
attachments, require an Export Licence, this shall have been
registered in compliance with export controls laid down by
the UK Export Control Organisation, which forms part of the
UK Department for Business, Innovation and Skills (BIS). <o:p></o:p></p>
<p>Emails and other electronic communication with Cranfield
Aerospace may be monitored.
<o:p></o:p></p>
<p>Thank you. <o:p></o:p></p>
<p>Cranfield Aerospace Limited Registered in England No.
2415720 Registered Office: Cranfield University, Cranfield,
Beds, MK43 0AL
<o:p></o:p></p>
<p>Updated 14-July-2010 <o:p></o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span
style="font-size:8.5pt;font-family:"Verdana","sans-serif";color:#999999"><br>
Disclaimer added by <b>CodeTwo Exchange Rules</b><br>
<a moz-do-not-send="true" href="http://www.codetwo.com">www.codetwo.com</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<br>
<p align="justify"> </p>
<p align="justify">-- </p>
<p align="justify">This e-mail and any attachments may contain
confidential, copyright and or privileged material, and are for
the use of the intended addressee only. If you are not the
intended addressee or an authorised recipient of the addressee
please notify us of receipt by returning the e-mail and do not
use, copy, retain, distribute or disclose the information in or
attached to the e-mail.<br>
Any opinions expressed within this e-mail are those of the
individual and not necessarily of Diamond Light Source Ltd. <br>
Diamond Light Source Ltd. cannot guarantee that this e-mail or
any attachments are free from viruses and we cannot accept
liability for any damage which you may sustain as a result of
software viruses which may be transmitted in or with the
message.<br>
Diamond Light Source Limited (company no. 4375679). Registered
in England and Wales with its registered office at Diamond
House, Harwell Science and Innovation Campus, Didcot,
Oxfordshire, OX11 0DE, United Kingdom<br>
</p>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
etherlab-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.etherlab.org/mailman/listinfo/etherlab-users">http://lists.etherlab.org/mailman/listinfo/etherlab-users</a>
</pre>
</blockquote>
<br>
</body>
</html>