Skip to content
EC-Monitor 3.1 documentation logo
EC-Monitor 7.1. Link Layer selection
Type to start searching
    • | EtherCAT manuals |
    • | www.developer.acontis.com |
    • | www.acontis.com |
    • 7. Link Layer
    • 1. Introduction
      • 1.1. What is EtherCAT?
      • 1.2. The EC-Monitor - Features
      • 1.3. Protected version
      • 1.4. License
    • 2. Architecture
      • 2.1. EtherCAT Network Configuration (ENI)
      • 2.2. Operating system configuration
    • 3. Ethernet TAP
      • 3.1. Generic 100MBit/s Ethernet Switch
      • 3.2. Beckhoff ET2000
      • 3.3. Dualcomm ETAP-1000
      • 3.4. Hilscher netAnalyser
      • 3.5. ProfiTap ProfiShark
    • 4. Getting Started
      • 4.1. Running EcMonitorDemo
      • 4.2. Compiling the EcMonitorDemo
    • 5. Software Integration
      • 5.1. Example application
      • 5.2. Event notification
      • 5.3. Logging
      • 5.4. EtherCAT Network Configuration ENI
      • 5.5. Process Data Access
      • 5.6. EC-Monitor Source Code
    • 6. Platform and Operating Systems (OS)
      • 6.1. Linux
      • 6.2. QNX Neutrino
      • 6.3. Windriver VxWorks
      • 6.4. Microsoft Windows
    • 7. Link Layer
      • 7.1. Link Layer selection
      • 7.2. Windows NDIS - emllNdis
      • 7.3. Windows WinPcap - emllPcap
    • 8. Application programming interface, reference
      • 8.1. General functions
      • 8.2. Packet Capture
      • 8.3. Process Data functions
      • 8.4. Slave status functions
      • 8.5. Diagnosis
      • 8.6. Link Layer Control Interface
      • 8.7. EtherCAT Mailbox Transfer
      • 8.8. CAN application protocol over EtherCAT (CoE)
      • 8.9. File access over EtherCAT (FoE)
      • 8.10. Hot Connect
    • 9. Generic notification interface
      • 9.1. Notification callback
      • 9.2. emNotifyApp
      • 9.3. Enable/Disable notifications
      • 9.4. Status notifications
      • 9.5. Error notifications
    • 10. RAS-Server for EC-Inspector and EC-Engineer
      • 10.1. Integration Requirements
      • 10.2. Application programming interface
    • 11. Error Codes
      • 11.1. Groups
      • 11.2. Generic Error Codes
      • 11.3. DCM Error Codes
      • 11.4. ADS over EtherCAT (AoE) Error Codes
      • 11.5. CAN application protocol over EtherCAT (CoE) SDO Error Codes
      • 11.6. File Transfer over EtherCAT (FoE) Error Codes
      • 11.7. Servo Drive Profil over EtherCAT (SoE) Error Codes
      • 11.8. Remote API Error Codes

    7.1. Link Layer selection

    The EC-Monitor currently supports a variety of different Link Layer modules, each of which contained in a single library file, which is loaded by the core library dynamically. The EC-Monitor shipment consist of a core library and one (or more) libraries each containing support for one specific Link Layer module (type of hardware card). Which library actually is loaded, is depending on the Link Layer parameters at runtime.

    The principle of Link Layer selection is that the name of the Link Layer (Link Layer Identification) is used to determine the location and name of a registration function, which is called by the EC-Monitor and registers function pointers which allow access to the Link Layer functional entries.

    The EtherCAT Link Layer will be initialized using a Link Layer specific configuration parameter set. A pointer to this parameter set is part of the EC-Monitor initialization settings.

    The EC-Monitor supports two Link Layer operating modes. If the Link Layer operates in interrupt mode all received Ethernet frames will be processed immediately in the context of the Link Layer receiver task. When using the polling mode the EC-Monitor will call the Link Layer receiver polling function prior to processing received frames.

    7.1.1. Optimized Link Layer drivers

    Optimized means operating directly on the network device’s register set instead of using the operating system’s native driver.

    7.1.2. Optimized Link Layer drivers and PHY OS Driver

    Some operating systems, e.g. Linux and Xenomai, provide drivers for most common Ethernet controllers and their related physical transceivers (PHY). The manufacturer specific PHY circuits can be handled by a dedicated driver. Using the PHY OS Driver interface it is possible to use the manufacturer’s dedicated PHY driver without modification of the acontis optimized Link Layer driver. Depending on the hardware architecture, an additional module from acontis, e.g. atemsys for Linux, grants access to the MDIO bus to the OS drivers, or request MDIO operations from the OS drivers.

    Note

    Link Layer modules not listed here may be available if purchased additionally

    7.1.3. Link Layer selection and initialization

    The different Link Layer modules are selected and parameterized by a common structure EC_T_LINK_PARMS shared by all Link Layers and a Link Layer specific structure, pointed to by an element within the common structure. This parameter set is given to EC_T_INIT_MONITOR_PARMS::pLinkParms with the call of emInitMonitor().

    struct EC_T_LINK_PARMS

    Public Members

    EC_T_DWORD dwSignature

    [in] Signature of the adapter specific structure containing the EC_T_LINK_PARMS structure

    EC_T_DWORD dwSize

    [in] Size of the adapter specific structure containing the EC_T_LINK_PARMS structure

    EC_T_LOG_PARMS LogParms

    [in] Logging parameters

    EC_T_CHAR szDriverIdent[EC_DRIVER_IDENT_NAMESIZE]

    [in] Name of Link Layer module (driver identification) for Link Layer Selection

    EC_T_DWORD dwInstance

    [in] Instance of the adapter. if EC_LINKUNIT_PCILOCATION is set: contains PCI address

    EC_T_LINKMODE eLinkMode

    [in] Mode of operation

    EC_T_CPUSET cpuIstCpuAffinityMask

    [in] Interrupt service thread CPU affinity mask

    EC_T_DWORD dwIstPriority

    [in] Task priority of the interrupt service task (not used in polling mode)

    struct EC_T_LINK_TTS

    Public Members

    EC_T_BOOL bEnabled

    [in] Use Time-Triggered Send

    EC_T_DWORD dwCycleTimeUsec

    [in] Cycle time between 2 pfnStartCycle calls

    EC_T_DWORD dwSendOffsetUsec

    [in] Time between pfnStartCycle call and frame transmission

    EC_T_LINK_TTS_CALLBACK pfnStartCycle

    [in] Callback function called cyclically according dwCycleTimeUsec

    EC_T_VOID *pvStartCycleContext

    [in] Context passed to each pfnTtsStartCycle call

    7.1.4. Link Layer instance selection via PCI location

    For some operating systems it is possible to address the Link Layer instance using its PCI address as an alternative. To do this, EC_LINKUNIT_PCILOCATION (0x01000000) and the PCI location must be set as EC_T_LINK_PARMS::dwInstance.

    On Linux the PCI address can be shown using e.g.:

    lspci | grep Ethernet
    
    00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
    04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
    05:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
    

    The format of EC_T_LINK_PARMS::dwInstance using PCI bus address is:

    0x01bbddff
    • bb Bus Number

    • dd Device Number

    • ff Function Number

    EC_T_LINK_PARMS::dwInstance = 0x01001900; //"0000:00:19.0"
    

    On Windows the integer value displayed in properties dialog must be converted to HEX. E.g the number from the following dialog (PCI bus 11, device 0, function 0) corresponds to 0x010B0000 (bus 0x0B).

    Previous 7. Link Layer
    Next 7.2. Windows NDIS - emllNdis
    © Copyright 2024-May-14, acontis technologies GmbH.
    Created using Sphinx 4.2.0. and Material for Sphinx