5. Running the acontis EtherCAT Master Demo (RT-Linux)

In this section we will get the EtherCAT master demo application running. It is assumed that an Ethernet adapter has been assigned to the RTOS.

5.1. Adjust the configuration

You may also have to adjust the parameters for the master stack demo on behalf.

Caution

This should only be done if the supplied default values for this quickstart guide aren’t sufficent!

mousepad /hv/guests/etc/rt-linux/files/ecat/noeni.sh

respectively

mousepad /hv/guests/etc/rt-linux/files/ecat/real.sh

5.2. Step 1: Scan the EtherCAT network

Start the RT-Linux example guest and open the console view as described in Chapter RT-Linux Guest Example.
Or start the guest from the command line.
cd /hv/guests/guestrtlinux
hv_guest_start -view

Login to the RT-Linux guest and start the EC-Master (without an ENI):

vmf64 login: root
password:  root
cd /mnt/rtfiles/etc/rt-linux/files/ecat
./noeni.sh

Finally, terminate the console connection to the real-time guest and stop the Real-time guest OS:

CTRL + C

hv_guest_stop

5.3. Step 2: Set the EtherCAT network operational

In this section we will run the EtherCAT network into OPERATIONAL mode. You need to be familiar with how to create an ENI file for EtherCAT networks.

In a first step, please generate a network configuration file (ENI) for the connected network.

Copy your ENI file to /hv/guests/etc/rt-linux/files/ecat/real.xml.

Start the EC-Master (with an ENI):

vmf64 login: root
password:  root
cd /mnt/rtfiles/etc/rt-linux/files/ecat
./real.sh

5.4. Running EcMasterDemo on the Host

The EcMasterDemo could be started on the host, because host kernel is built with real-time capabilities.

At first you should unbind network adapter from the host OS. Example:

echo 0000:00:19.0 > /sys/bus/pci/drivers/e1000e/unbind

For more details about using of unbind command and determining adapter instance, please refer to “EC-Master Class B” documentation.

Load atemsys kernel module:

sudo insmod $HV_BIN/atemsys.ko

Run EcMasterDemo from /hv/guests/etc/rt-linux/files/ecat/ directory:

cd /hv/guests/etc/rt-linux/files/ecat/
sudo LD_LIBRARY_PATH=$HV_BIN:$LD_LIBRARY_PATH ./noeni.sh