This section deals with running the application.
- Verify or restore the connections if disconnected before.
- Reload CPU1 and CM applications
- Run CPU1 first and hand-off the EtherCAT peripheral to CM
- Run the CM next to setup the EtherCAT connection with master and IPC link with CPU1
- From TwinCAT window, rescan for devices, and restart TwinCAT in config mode.
- ECAT messages can be viewed as variables in CCS debug window. If not done already, right-click within the CCS Expressions window and choose Import. Then browse to and select fcl_f2838x_tmdxiddk_ecat_vars.txt file from the debug directory. Variables 'countMainLoop', 'dataBufferFromCM' and 'dataBuffertoCM' are used by C28x core only while 'ipcCMToCPUDataBuffer' and 'ipcCPUToCMDataBuffer' are used by both C28 and CM cores and hence can be viewed from both 'Debug' spaces.
- Within TwinCAT, double-click on the discovered EtherCAT box and observe that the EtherCAT slave is running in OP mode.
- Within TwinCAT, expand the explorer to the EtherCAT box (I/O --> Devices -->Device 2 (EtherCAT) --> Box 1 (F2838x CM EtherCAT Slave(SYSTEM))) and find the various output/input mappings as shown in Figure 12-7. Double click on Box1 to get the F2838x CM slave input /output data window as shown in Figure 12-8.
- Select Input mapping 0 to view all the status feedback from the drive. The following are the drive parameters monitored through EtherCAT:
- SpeedStatus
- PositionStatus
- TorqueStatus
- DriveStatus
- Select Output mapping 0 to view and enter all the commands to the drive:
- DriveCommand
- SpeedReference
- PositionReference
- This build level is a loop back example to verify the EtherCAT functionality. So, if the command data entered in a certain output mapping variable is returned back in a certain input mapping variable, it confirms the functionality of EtherCAT slave on the F2838x. The loop back association is as follows:
- SpeedReference --> SpeedStatus
- PositionReference --> PositionStatus
- DriveCommand --> DriveStatus
For example, the data entered in 'SpeedReference' in output mapping should return back to show up in 'SpeedStatus' in input mapping if EtherCAT slave is functioning properly.