E-box/User manual: Difference between revisions
(User manual for E-box and EtherCAT) |
No edit summary |
||
Line 75: | Line 75: | ||
This should give an output similar to: [breaklines=true,frame=single,lastline=40] {simple_test.txt} | This should give an output similar to: [breaklines=true,frame=single,lastline=40] {simple_test.txt} | ||
== slaveinfo == | == slaveinfo == |
Revision as of 08:01, 9 June 2011
Starting an experiment
Starting Matlab
- Open a terminal.
- Type sudo matlab
Basic simulink model
The function of ec_test01 is similar to mini01 for the PATO setup with Tu/eDACS. Open ec_test01 and "Save as" under a different file name in your home directory /home/<username>.
Library
The library can be found by typing eclib in the matlab console. The supported modules are:
- EL1008
- EL1014
- EL1018
- EL2004
- EL2008
- EL3102
- EL4038
- EL4132
- EL5101
Building the real-time code
Press "CTRL+B" to build the code.
Executing the real-time code
Without Simulink External Mode
- Open a terminal.
- Go to the directory where the model is saved.
- Type sudo ./model.
With Simulink External Mode
- Open the simulink model.
- Open a terminal.
- Go to the directory where the model is saved.
- Type sudo ./model -w (in the terminal).
- Click Connect to target.
- Click Start real-time code.
Getting the data
After the experiment the file model.mat will be created with the data from the experiment.
Errors
This section gives an overview of possible errors
Wrong ethernet port
- Click Simulation
- Click Configuration parameters
- Click Real-Time Workshop
- Change the make command to make_rtw OPTS='-DNETIF_ID=<x>'
where <x> is the number of the ethernet controller. The correct ethernet port (0 by default) can be found by clicking on the icon marked by the arrow in figure {fig:desktop}.
image {Desktop screen} {fig:desktop}
Program not executed as root
When you forgot to execute the real-time programm as root you will see the following output: [breaklines=true,frame=single,linerange={1-14}] {no_root.txt}
simple_test
- Open a terminal.
- Type cd /usr/src/soem/.
- Type sudo ./simple_test eth<x>.
where <x> is the number of the ethernet controller.
This should give an output similar to: [breaklines=true,frame=single,lastline=40] {simple_test.txt}
slaveinfo
- Open a terminal.
- Type cd /usr/src/soem/.
- Type sudo ./slaveinfo eth<x>.
where <x> is the number of the ethernet controller.
This should give an output similar to: [breaklines=true,frame=single,linerange={1-14}] {slaveinfo.txt} [breaklines=true,frame=single,linerange={25-34}] {slaveinfo.txt}