[etherlab-users] bus status recognition

Andreas Stewering ab at igh-essen.com
Wed May 23 11:41:08 CEST 2012


Hello,

You can use ecrt_master_state, please see ecrt.h:


/** Reads the current master state.
  *
  * Stores the master state information in the given \a state structure.
  */
void ecrt_master_state(
         const ec_master_t *master, /**< EtherCAT master. */
         ec_master_state_t *state /**< Structure to store the 
information. */
         );

/** Master state.
  *
  * This is used for the output parameter of ecrt_master_state().
  *
  * \see ecrt_master_state().
  */
typedef struct {
     unsigned int slaves_responding; /**< Number of slaves in the bus. */
     unsigned int al_states : 4; /**< Application-layer states of all 
slaves.
                                   The states are coded in the lower 4 bits.
                                   If a bit is set, it means that at 
least one
                                   slave in the bus is in the corresponding
                                   state:
                                   - Bit 0: \a INIT
                                   - Bit 1: \a PREOP
                                   - Bit 2: \a SAFEOP
                                   - Bit 3: \a OP */
     unsigned int link_up : 1; /**< \a true, if the network link is up. */
} ec_master_state_t;

Best regards


Andreas



Am 23.05.2012 11:23, schrieb ronaldo.mercado at diamond.ac.uk:
>
> Hello,
>
> We use ecrt_master_get_slave as part of the poll cycle to fetch the 
> slaves' status.
>
> Regards,
>
> Ronaldo
>
> *From:*etherlab-users-bounces at etherlab.org 
> [mailto:etherlab-users-bounces at etherlab.org] *On Behalf Of *Ian Norton
> *Sent:* 18 May 2012 08:47
> *To:* etherlab-users at etherlab.org
> *Subject:* [etherlab-users] bus status recognition
>
> Hi,
>
> I'm running etherlab master in a regular Centos 6 kernel.
>
> The system functions fine, but it appears still to be fine if the 
> network cable is unplugged!
>
> 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.
>
> Does anyone know how to detect an unplugged/broken network cable 
> during operation?
>
> regards
>
> Ian R.K. Norton
> System Support Engineer
> Aircraft Engineering
> Cranfield Aerospace Ltd
> Cranfield
> Bedford MK43 0AL
> UK
>
> Tel  - +44 (0) 1234 754926
> Fax - +44 (0) 1234 752375
>
> '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'
>
>
> ************************************************************
>
> DISCLAIMER:
>
> 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.
>
> 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).
>
> Emails and other electronic communication with Cranfield Aerospace may 
> be monitored.
>
> Thank you.
>
> Cranfield Aerospace Limited Registered in England No. 2415720 
> Registered Office: Cranfield University, Cranfield, Beds, MK43 0AL
>
> Updated 14-July-2010
>
>
> Disclaimer added by *CodeTwo Exchange Rules*
> www.codetwo.com <http://www.codetwo.com>
>
>
> -- 
>
> 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.
> Any opinions expressed within this e-mail are those of the individual 
> and not necessarily of Diamond Light Source Ltd.
> 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.
> 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
>
>
>
>
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20120523/43ffefa3/attachment-0005.htm>


More information about the Etherlab-users mailing list