SPRADH0 August   2024 AM625 , AM6442 , AM69 , TDA4VM

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 What is EtherCAT?
    2. 1.2 What is a PLC?
    3. 1.3 What is CODESYS?
  5. 2Evaluation Platform and Methods
    1. 2.1 Hardware
    2. 2.2 Software
    3. 2.3 Test Topology
  6. 3Performance Metrics
    1. 3.1 Cyclictest Performance Metrics
    2. 3.2 EtherCAT Performance Metrics
  7. 4Optimizations
    1. 4.1 Implemented Optimizations
    2. 4.2 Future Considerations
      1. 4.2.1 Set Maximum CPU Frequency
      2. 4.2.2 Isolate Cores
      3. 4.2.3 Set CPU Affinity
      4. 4.2.4 Isolate Cores and Set CPU Affinity
      5. 4.2.5 Ksoftirqs to FIFO
      6. 4.2.6 Increase the Real-Time Scheduling Time
      7. 4.2.7 Disable irqbalance
      8. 4.2.8 Use Separate Network Interface Card (NIC)
      9. 4.2.9 Disable Unnecessary Drivers
  8. 5Summary
  9. 6References
  10. 7Appendix A: How to Setup TI Embedded Processors as EtherCAT Controller Using the CODESYS Stack
    1. 7.1 Hardware Requirements
    2. 7.2 Software Requirements
    3. 7.3 Hardware Setup
    4. 7.4 Software Setup
      1. 7.4.1 Windows PC Setup
      2. 7.4.2 EtherCAT Controller Setup
      3. 7.4.3 CODESYS Development System Project
      4. 7.4.4 Execution
    5. 7.5 How to View Performance Measurements
      1. 7.5.1 Appendix A Resources
  11. 8Appendix B: How to Enable Unlimited Runtime on CODESYS Stack
    1. 8.1 CODESYS Licensing Background
    2. 8.2 Obtaining a CODESYS License
    3. 8.3 Activating CODESYS License
      1. 8.3.1 Background
      2. 8.3.2 Recommended Steps
    4. 8.4 Verifying CODESYS License Applied
      1. 8.4.1 Known Issues With Verifying CODESYS License Applied

CODESYS Development System Project

  1. Set up an EtherCAT network similar to what is shown in Section 7.3
  2. Start the CODESYS control service on the EtherCAT controller with one of the following commands
    $ /opt/codesys/bin/codesyscontrol.bin /etc/CODESYSControl.cfg
    $ systemctl start codesyscontrol.service
    $ /etc/init.d/codesyscontrol start
  3. Open CODESYS Development System V3 on your Windows PC
  4. Create a new standard project with the following steps

    1. Click on "File > New Project"
    2. Select "Standard project"
    3. Select a name for the project and where to store the project
    4. Select "CODESYS Control for Linux ARM64 SL (CODESYS GmbH)" for "Device" entry
    5. Select "Structured Text(ST)" for "PLC_PRG in" entry
    6. Click "OK"
      AM6442, AM625, AM69 CODESYS
                                    Standard Project Figure 7-3 CODESYS Standard Project
  5. Add the EtherCAT device ESI (EtherCAT Slave Information) files to the project with the following steps
    1. For AM243x/AM64x as EtherCAT device
    2. Verify that AM243x MCU+ SDK or AM64x MCU+ SDK have been installed
    3. Click on "Tools > Device Repository > Install"
    4. Navigate to and select (Similar step for AM64x EtherCAT devices)
      <path-to-AM243-MCU+-SDK>/source/industrial_comms/ethercat_slave/stack/esi/'TI AM243X.R5F Simple.xml'
  6. Click "Open"
  7. Click "Close"
  8. For other EtherCAT devices (for example, Beckhoff devices), obtain and download the ESI files and install to Device Repository in a similar manner
  9. Scan for EtherCAT controller device ("Origin" Device) with the following steps
    1. In the "Devices" window, double click "Device (CODESYS Control for Linux ARM64 SL)"
    2. Go to the "Communication Settings" and click on "Scan Network" tab
    3. The name of the EtherCAT controller device running the CODESYS control service shows up under Gateway-1
      1. If the EtherCAT controller does not appear, uncheck "Hide non-matching devices, filter by Target ID" then click "Scan Network"
    4. Select the device and click "Ok"
    5. If prompted about "user management":
      1. Click "Yes"
      2. Create a username and password
        1. The username and password can be changed by right clicking "Device (CODESYS Control for Linux ARM64 SL)" and clicking "Reset Origin Device [Device]"
      3. Click "OK"
      4. Log in
  10. Add an EtherCAT_Master device with the following steps
    1. In the "Devices" window, right click "Device (CODESYS Control for Linux ARM64 SL)"
    2. Click "Add Device"
    3. Expand "Fieldbuses > EtherCAT > Master > EtherCAT Master"
    4. Click "Add Device"
  11. Setup your EtherCAT controller as the EtherCAT_Master by matching the MAC address of the Ethernet port that is connecting with the rest of the EtherCAT devices.

    1. In the "Devices" window, double click "(CODESYS Control for Linux ARM64 SL)"
    2. Click the "General > EtherCAT NIC Settings > Source address (MAC) > Select" button
    3. Select the MAC address and ethernet port that connects to the rest of the system
  12. Setup the rest of the EtherCAT devices in network through scanning for devices
    1. Click "Toolbar > Login (gear icon)" or "Alt + F8"
      1. Click "Yes", if a window appears that states: "No online change possible due to severe changes: Do you want to perform a download?"
    2. Within the "Devices" window, right click on "EtherCAT_Master (EtherCAT Master)"
    3. Click "Scan for Devices..."
    4. Click "Copy All Devices to Project"
    5. If the EtherCAT devices do not appear under the list of scanned devices
      1. Try to power cycle the EtherCAT devices
      2. Try to reflash the boards
  13. Obtain process data from the EtherCAT devices with the following steps
    1. Click "Toolbar > Start" or "F5"
    2. In the "Devices" window, double click one of the EtherCAT devices
    3. Select "General > Address > Additional > Expert settings"
    4. Click "Expert Process Data > Load PDO from the Device"
    5. Repeat these steps to select "Expert Process Data" for each EtherCAT device
    6. Press "Ctrl + S"
    7. Click "Toolbar > Stop" or "Shift + F8"
    8. Click "Toolbar > Logout" or "Ctrl + F8"
  14. Mapping the variables within the "EtherCAT I/O Mapping" tab for each device can be accomplished by writing a custom PLC_PRG program
    1. In the "Devices" window, double click “PLC_PRG”
    2. Contact CODESYS for more details on how to write a PLC_PRG program