Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Components\cifXApplicationDemoECS_SimpleImage Removed

...

Get sure to choose the simple example and the correct usecase for your buildImage Removed

...

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. 

...

The ECS Configuration packet is in the file AppECS_DemoApplication.cImage Removed

...

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

...

need to be same like in ESI file:Image Removed

...

Each example comes with its own ESI file but all have the same product code and revicion number, so do not mix up them when testing.

...

Change the number of Bytes for RxPdo (Output) and TxPdo (Input) in the ESI file, like in the configuration packet

<RxPdo Sm="2">

          <Index>#x1600</Index>

...

6 Byte Input

6 Start Sequenz

  1. Initialize

  2. Config Stack

  3. Init Config

  4. Start

...

  1. Image Added
  2. 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).

Image RemovedImage Added

7 Optional Configuration

...

At first set the taglist entry 'DDP mode ..' to passive by using the Tag List Editor Tool from hilscher and save the firmwareImage Removed

...

Than flash it to the device by e.g. using NetxStudio's flasher tool and restart the device to apply the firmware. Now the device will not activate the phys. 

...

Hint: If you add your ESI file later, you must click 'Reload Configuration files' in TwinCAT. Otherwise TwinCAT will not find your device and create an own temporary ESI file called 'OnlineDescritionCache'. It can only be seen in the folder for ESI files if you close TwinCAT. This can be confusing because it is prefered by TwinCAT if you add your file and do not delete it. Image Removed

...

or it may look like this:Image Removed

...

Than you have to add a networkadapter (TwinCAT will install some protocols on it). Rightclick on the 'Show realtime Ethernet Compatible Devices...'Image Removed

...

In the opening window choose a Networadapter from the list even if ther are no comaptible devices and click the 'Install' button. (Not compatible is mostly sufficent for testing in free run mode.)

...

The decice will be added above under 'Installed and ready to use ...'Image Removed

...

Now you can connect your slave with the example running on it to the master.

...

Than go on scaning the networkImage Removed

...

The device shall be found and should still be in Operational.Image Removed

...

To send data you can add a value to the RX-PDO (recive from slave view))Image Removed

...

The example will increment the value and send it backImage Removed

...

If you want to do wireshark traces you must activate the Promeiscous mode on the master device by setting the check mark.Image Removed

...

Than cklick the 'reload' button to apply your changes.

...

Choose the ESI file from the folder. (You might use/share the ESI file folder with TwinCAT's ESI folder)Image Removed

...

Add the network device with a click on right mouse buttonImage Removed

...

when asked click scan slaves which adds your slave to the path.

Start the testImage Removed

...

Unused Testcases can be deteted, is not they are skipped.

Image RemovedImage Added