...
netX 90 - EtherCAT Slave - V5.0.1.0
2 ECS Sources
Take the netXStudion to open the projcet. The ECS Sources in the ECS SimepleConfig Example are in the folder:
...
Get sure to choose the simple example and the correct usecase for your build
3 Overview of the example structure
The examples consist of a general part which is the same for all differnent examples. It initializes the toolkit sets up the Channels etc. The related code is mainly in the folder Components\ApplicationDemo and in the Targets folder. It is not described here but can be found under Common general part for all examples
The simple demo part starts (AppECS_DemoApplication.c) with initializing a packet handler (AppECSSimpleDemo_Initialize) for incomming packets. Actually only HIL_LINK_STATUS_CHANGE_IND (selfexpaining) and ECAT_ESM_ALSTATUS_CHANGED_IND (actual slave state). The function AppECSSimpleDemo_Setup sends the configuration request and afterwards the channel is initialized (App_SysPkt_AssembleChannelInitReq) which means to apply the configurtion data. Then the connection to the bus is switched on by App_SysPkt_AssembleStartStopCommReq.
4 Configuration packet
The ECS Configuration packet is in the file AppECS_DemoApplication.c
...
It includes the ECAT_SET_CONFIG_DEVICEINFO as addition to the basic parameters, which retalte to the ESI file
5 Values from ESI file
DeviceInfo values:
#define ECS_PRODUCTCODE 0x0000003d
...
Only use one file at a time when adding to a master or config file folder.
Process Data Values:
Choose the number of Input and Output Bytes and tell this the stack in the configuration packet with
...
10 Byte Output
6 Byte Input
6 Start Sequenz
- Initialize
- Config Stack
- Init Config
- Start
- Stack is in Init State
6 ECM Master
As soon as the ECS Stack is successfully configured and the “Start Communication Request” / “Bus On” is done, the EtherCAT Slave goes in Init State.
The EtherCAT Master now needs to bring the EtherCAT Slave from Init State to Operational State (OP).
7 Optional Configuration
As an extension to this simple example you can optionally set the define HOST_APPLICATION_SETS_OEM_DATA in AppECS_DemoApplication_Config.h
...
Now the function AppECS_SetOemData in the AppECSSimpleDemo_Initialize function is called. This function uses the HIL_DDP_SERVICE_SET_REQ to to send OEM data to the device. Afterwards AppECS_ActivateDdp is called to activate the data in the firmware. The DDP OEM parameters overwrite one value which is also set in the Configuration packet szOrderIdx (DEV_TYPE_INFO) from ECAT_SET_CONFIG_DEVICEINFO.
8 Using TwinCAT as master
The following scrennshots give a shot introduction to bring the slave to Operational mode using TwinCAT as a master and configuration tool.
...
Than cklick the 'reload' button to apply your changes.
Running a Conformance Test
As a member of the EtherCAT organisation you have to buy a licence for the Conformance Test Tool.
...