industrialNETworXnetx

tvonbuer

tvonbuer

| 02.03.2009 | 14:22 | 9 replies

EtherCAT Newbie question

Hi,

I'm new to EtherCAT and need some advice how to get my setup running. I have already browsed through this forum but still can't get it to work.

All I'm trying to do in a first step is to start a communication between an EtherCAT master and a slave, e.g. set a bit in the process image on the slave and check the same bit on the master or something similar.

Here's the setup:
EtherCAT Master: Windows XP laptop with Beckhoff's TwinCAT running
EtherCAT Slave: PC with a CIFX 50-RE PCI Card

What I did/tried so far:

On the PC:
1) I installed the Hilscher PCI card plus all drivers
2) I ran the netX configuration and diagnostic tool and downloaded the configuration to the PCI card: the diagnostics area shows me that the system is ready (green light on)

On the Laptop:
1) I installed Beckhoff TwinCAT
2) I checked the windows device manager. Under network adapters, it shows "TwinCAT-Intel PCI Ethernet Adapter"
3) I started TwinCAT in Config mode on the laptop
4) I did "Options" --> "Show real-time ethernet compatible devices": The laptops ethernet adapter was listed as compatible. I then activated a binding to TwinCAT Ethernet Protocol"
5) In the twincat system manager, I tried to provide to the master the XML file of the slave, but couldn't figure out how.

My questions:
1) What basic steps are needed to get the communication running? I would like to send both cyclic and acyclic data from slave to master and vice versa.
2) How do I provide to the master the XML file of the slave?
3) Do I need to download the configuration to the CIFX 50-RE using the netx utility only once, i.e. is the configuration saved in the flash or do I need to reload after every system start-up?

Thank you very much in advance for your hints.

Thomas

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 03.03.2009 | 07:22

Hi tvonbuer,

please start TwinCAT and be sure that the salve device is connected to the master.
Perform a right click on "I/O-Devices" in the tree structure on the left and select in the context menu "Scan Devices".
Select the correct NIC. A dialog opens and ask fro "Scan Boxes" confirm it with yes. Also the question for the free run mode.
The available and found slaves should be shown in the left side of the window.

tvonbuer

tvonbuer

| 03.03.2009 | 13:14

Thanks a lot.

I tried it and it worked. Twincat finds the NIC and the CIFX 50-RE. Cyclic communication is now working (I tested master to slave and slave to master using the cifxdemo application).

However, I still haven't figured out how to provide to the master the process image of the slave. (So far I assumed this is done by providing an XML file)

Also, can someone give me a hint about how the configuration for the CIFX 50-RE is done? So far I used the netx setup utility. Do I need to do this only once, or every time the system is restarted? What's the difference between the "netx setup utility" and the "cifx driver setup utility"?

I'm also not sure about the warm start parameters (seen in the cifx driver setup utility). What's their purpose and when are they used?

regards,
Thomas

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 03.03.2009 | 13:43

Hi,

tvonbuer wrote:
Also, can someone give me a hint about how the configuration for the CIFX 50-RE is done? So far I used the netx setup utility. Do I need to do this only once, or every time the system is restarted? What's the difference between the "netx setup utility" and the "cifx driver setup utility"?

The configuration of the card is stored into a file and will be downloaded to the card.
The Firmware and the configuration is stored to your local hard disk drive of your machine. On a windows machine you can find under Program Files/cifX Device Driver/Device and Serial Number of your board/channel0.
The driver provides automatically on every start the files to the card. Means, you have to do the configuration only once (when there is no need for any change).
the difference between the "netx setup utility" and the "cifx driver setup utility" is the GUI. With the cifX Driver Setup Utility you have to do more configuration steps and more "clicks". Thats it. Both applications are usable and working.

tvonbuer wrote:
I'm also not sure about the warm start parameters (seen in the cifx driver setup utility). What's their purpose and when are they used?

You have to configure your slave. You have to set the used I/O data's, names and slave addresses (depends on the used stack. I know that Real Time Ethernet-Stacks do not use a slave address ;-) )
Warmstart parameters can only be set for slave firmware.
The standard warmstart parameters can be found in the "cifX Driver installation" manual.

tvonbuer

tvonbuer

| 04.03.2009 | 19:26

Hi,

I'm now able to interface an empty TwinCAT task (no PLC running) on the master with the CIFX 50 as slave. However, I'm still struggling on how to transfer the slave's process image (i.e. cyclic data) to the master. Do you have a hint for that, too?

regards,
Thomas

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 05.03.2009 | 10:12

Hi,

you must activate the "Free Run Mode" in TwinCAT. You can find the button in the button bar on top of the screen. It is right from the button with the magic wand.

tvonbuer

tvonbuer

| 05.03.2009 | 13:59

Hi,

I think there's a misunderstanding. I have already activated Free Run Mode to get the communication running that's working correctly. But all this is happening with the standard inputs and outputs I get from "Scan Boxes" in TwinCAT: 4 unsigned integer variables as inputs and 4 unsigned integer variables as outputs.

I would like to use a custom definition, for example this one:
Inputs:
inputVar1, inputVar2: BOOLEAN
inputVar3: UINT8

Outputs:
outputVar1 : BOOLEAN
outputVar2 : UINT32

How do I define this structure and use it for both master and slave ?

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 06.03.2009 | 06:36

Hi,

this needs changes in the XML file.

The EtherCAT slave firmware does not implement dynamic process mapping itself. This is a task for the particular application which e.g. implements a certain profile.

tvonbuer

tvonbuer

| 27.04.2009 | 18:22

Hi again,

I'm trying now to adapt the original XML description file for the CIFX50 provided by hilscher. It's working, but not working stable together with TwinCat.

Is there any documentation available what the XML tags mean, or rather how to correctly adapted the original Hilscher XML file?

One of the changes I made is listed below (added two variables), would this change be correct?

kind regards,
Thomas

For example, I changed the PDO TX section from


#x1a00
wIn0

#x2004
1
32
Input
DINT

to


#x1a00
wIn0

#x2004
1
16
Input1
UINT16


#x2004
2
8
Input2
USINT


#x2004
3
32
Input3
FLOAT

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 28.04.2009 | 11:08

Hi tvonbuer,

a description of the XML file can be found on the ETG page.

Regarding your modifications on the XML file, it is better to have the entire XML file for looking into and using that for checking what is wrong. The code snippet would not be enough.

Login