Dear Community User! We will start the migration process in one hour.
The community will be then in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 

Ethercat Error Handling S20-EC-BK and Sync Manager Watchdog Error

Ethercat Error Handling S20-EC-BK and Sync Manager Watchdog Error

akrosis
Established Member

Hello,

 

We have X3 PLC with S20-EC-BK and Smart Function Kit for Pressing, with Ethercat communication. I want to implement an error detection on bus, and I'm trying to use CXA_S20 library for it. Issue is, when I unplug S20's connection to PLC, its state changes to error "0x0001B: Sync Manager Watchdog" and stays that way even if I plug the cable back, until we reset the system.

Do you have any ideas how to detect or reset that? 

Also, my current program is like below, using the library's example. If there is any real life implementation you can share, it'd be appreciated.

Thank you very much.

 

PROGRAM PRG_IOBusControl
VAR_INPUT
	bExecuteStart : BOOL;
END_VAR
VAR
      fbIH_S20ComConfiguration    : IH_S20ComConfiguration;           // Function block instance
      bEnableComConfig            : BOOL := TRUE;                     // Function block processing enabled( TRUE – once, edge-controlled )
      bInOperationComConfig       : BOOL;                             // TRUE: Function Block is working on its actual task
      bErrorComConfig             : BOOL;                             // TRUE: Indicates an error
      ErrorIDComConfig            : ERROR_CODE;                       // Class of error
      ErrorIdentComConfig         : ERROR_STRUCT;                     // Detailed information about error
      enBusType                   : IH_S20_BUSTYPE;                   // Bus type selection
      stBusConfig                 : IH_S20_BUS_CONFIG;                // Bus configuration parameters
      pS20BusHandle               : POINTER TO IH_S20_BUS_IDENTIFIER; // Bus handle of S20IO configuration

      strBusMaster                : STRING(100) := 'ethercatmaster'; // EtherCAT Busmaster name

      fbIH_S20ModuleDiagnosticsType02 : IH_S20ModuleDiagnosticsType02;    // Fb Instance
      bExecute                        : BOOL;                             // TRUE: Function is enabled
      bDone                           : BOOL;                             // TRUE: Function Block has completed its task
      bActive                         : BOOL;                             // TRUE: Function Block is working on its actual task
      bError                          : BOOL;                             // TRUE: Indicates an error
      ErrorID                         : ERROR_CODE;                       // Class of error
      ErrorIdent                      : ERROR_STRUCT;                     // Detailed information about error
      uiSlot                          : UINT := 1;                        // Module slot address. Bus coupler : 0,  1st Module after coupler:1 ... 63rd Module after coupler: 63
      bResetError                     : BOOL;                             // It deletes the diagnostics memory and acknowledge the diagnostic messages in the module
      wErrorNumber                    : WORD;                             // Module diagnostic message number
      byPriority                      : BYTE;                             // Priority of diagnostic message. Refer Table: Priority
      byChannel_Module                : BYTE;                             // Represents the channel number/entire device, where the diagnostic message available. Refer Table: Channel_Module
      wErrorCode                      : WORD;                             // Error code. Refer Table: ErrorCode & ErrorString
      strErrorString                  : STRING(51);                       // Error in Text format. Refer Table: ErrorCode & ErrorString
	  
END_VAR


 // Bustype
 enBusType := IH_S20_BUSTYPE.ETHERCAT;

 // Bus Configuration
 stBusConfig.EtherCAT.AddressType  := CXA_S20.CXA_EthercatMaster.IL_ECAT_ADDRESS_TYPE.ECAT_ETHERCAT_ADDRESS; // Address type
 stBusConfig.EtherCAT.BusMaster        := ADR(strBusMaster); // Bus master name
 stBusConfig.EtherCAT.SlaveAddress := 1001; // Address of the slave (bus coupler)

// IH_S20ComConfiguration FB Call
 fbIH_S20ComConfiguration(
       Enable:= bEnableComConfig,
       InOperation=> bInOperationComConfig,
       Error=> bErrorComConfig,
       ErrorID=> ErrorIDComConfig,
       ErrorIdent=> ErrorIdentComConfig,
       BusType:= enBusType,
       BusConfig:= stBusConfig,
       S20BusHandle=> pS20BusHandle);

 uiSlot  := 1; // Module position
 
 IF TRUE THEN  // temporary
	 bExecute := TRUE;
 END_IF

 // Enable FB by making TRUE at 'bExecute' var
 

// IH_S20ModuleDiagnosticsType02 FB Call
 fbIH_S20ModuleDiagnosticsType02(
       Execute:= bExecute,
       Done=> bDone,
       Active=> bActive,
       Error=> bError,
       ErrorID=> ErrorID,
       ErrorIdent=> ErrorIdent,
       S20BusHandle:= pS20BusHandle,
       Slot:= uiSlot,
       ResetError:= bResetError,
       ErrorNumber=> wErrorNumber,
       Priority=> byPriority,
       Channel_Module=> byChannel_Module,
       ErrorCode=> wErrorCode,
       ErrorString=> strErrorString);
	   
 IF fbIH_S20ModuleDiagnosticsType02.Active THEN
	 bExecute := FALSE;
	 bExecuteStart := FALSE;
 END_IF
 
 IF fbIH_S20ModuleDiagnosticsType02.Error THEN
	GVL_System.eSystemState := E_SystemState.Error;
	GVL_System.bError := TRUE;
 END_IF

 // Diagnostic Data will be available at:
 //    wErrorNumber
 //    byPriority
 //    byChannel_Module
 //    wErrorCode
 //    strErrorString
 

 

1 REPLY 1

CodeWasi
Occasional Contributor

Hello,
did you consider to seperate the ecat-members in different sync-units... that can continue the communication in operational for those components in the line which are still connected. 
SyncUnit is configured in the IOConfig. 

CodeWasi_0-1730792799946.png


Healting/restarting the ECAT master will integration missing member again. Please have a look into

CodeWasi_1-1730792872257.png

Did I get you right? Does it answer your question?

Bye

 

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist