Congratulations, you have hit the jackpot. As I said, configuring a
generic ethercat slave is not an easy task, you are jumping not only
into the deep side of the a pool, you are jumping in the middle of the
Atlantic without a rescue boat in sight!
This slave is dynamically configured. The command output you send me is
empty! That is why your block has no inputs and outputs.
Fist of all, you should use this m-file directly in "EtherCAT Slave
Configuration struct" input of the generic slave. The return value of
this m-file is a struct that is needed to configure the slave as well as
the block.
You will need to read the documentation and the XML files (MAXPOS
EtherCAT Slave Information.xml, from MOXPOS-Setup.exe) and configure the
slave as in the example I sent you, but with the information from the
xml file. An easier way of doing this is to try the configuration with
TwinCAT first and then see what you need in terms of PDO's, CoE, etc.
It will take you quite some time
*) read the help to the generic slave
*) Look at examples in $EtherLAB/rtw/blocks/EtherCAT/*.m
*) Run these examples (with the correct parameters)
*) Search etherlab.org for generic ethercat slaves and drives
Good luck
Richard
Dear Richard Hacker,
Thank you very much for your reply.
Output of the command "ethercat slaves" as follows;
*0 0:0 PREOP + EK1101 EtherCAT-Koppler (2A E-Bus, ID-Switch)
1 0:1 PREOP + MAXPOS 50/5*
I have run the code you provided and ended up with the following MATLAB
function;
===============================
*%
% Master 0, Slave 1, "MAXPOS"
%
function rv = slave1()
% Slave configuration
rv.SlaveConfig.vendor = 251;
rv.SlaveConfig.product = hex2dec('30010000');
rv.SlaveConfig.description = 'MAXPOS';
rv.SlaveConfig.sm <http://rv.SlaveConfig.sm> = { ...
{0, 0, {
}}, ...
{1, 1, {
}}, ...
{2, 0, {
}}, ...
{3, 1, {
}}, ...
};
% Port configuration
end*
===============================
Saved this piece of code as a matlab function and run it. Output of it
was a struct named as "ans"
So, I copied the generic ethercat slave block into my model and typed
"ans" for/EtherCAT Slave Configuration struct/ parameter. Then my block
had the name MAXPOS. So far so good. However this block only lies there
and has no input or output ports. At this point how can I send a signal
to driver over EtherCAT ?
Besides, I have to be able to differentiate between the signals I am
sending. So, this is another question for me how to tell which signal is
which one.
Thank you.
2015-02-25 14:44 GMT+02:00 Richard Hacker <[email protected] <mailto:[email protected]>>:
Hi,
please use the mailing list for your correspondence.
What does the command
ethercat slaves
output?
In simulink, you will need a block for every ethercat slave, one for
the EK1101 and one for your drive.
The EK1101 has output PDO's which might be useful.
As far as the drive is concerned, you will need to use the generic
ethercat slave block and write a matlab function that will output a
structure as defined in the help of that block. It is quite a
daunting task though!
As a start, try (assuming your drive has position 2)
ethercat pdos -s etherlab -p 2
which outputs (in this case for a normal Beckhoff ethercat slave)
========== snip =============
%
% Master 0, Slave 2, "EL2622"
%
function rv = slave2()
% Slave configuration
rv.SlaveConfig.vendor = 2;
rv.SlaveConfig.product = hex2dec('0a3e3052');
rv.SlaveConfig.description = 'EL2622';
rv.SlaveConfig.sm <http://rv.SlaveConfig.sm> = { ...
{0, 0, {
{hex2dec('1600'), [
hex2dec('7000'), hex2dec('01'), 1; ...
]}, ...
{hex2dec('1601'), [
hex2dec('7010'), hex2dec('01'), 1; ...
]}, ...
}}, ...
};
% Port configuration
rv.PortConfig.input(1).pdo = [0, 0, 0, 0];
rv.PortConfig.input(1).pdo___data_type = 1001;
rv.PortConfig.input(2).pdo = [0, 1, 0, 0];
rv.PortConfig.input(2).pdo___data_type = 1001;
end
========== snip =============
Save this into a matlab script, test it and use it in the "EtherCAT
Slave Configuration struct" for the generic ethercat slave block.
Study this file, the generic slave documentation and the drive's
documentation to get going.
Good luck
Richard
On 24.02.2015 15:08, Dogacan Bilgili wrote:
Dear Sylvia Schlüter,
I have been working on Ether Lab for the last few days and
managed to
establish the connection between my motor driver MAXPOS 50/5 and
openSuSe computer through Beckhoff EK1101 module.
So, my linux computer is connected to Beckhoff EK1101 module and
this
module is connected to MAXPOS 50/5 motor driver, which has ther
EtherCat
technology.
However, I'm having some problems on the simulink side;
In the etherlab_lib, under Beckhoff section there is an
Infrastructure
node called "EK1101" and this one can be configured as "EK1101"
once it
is copied to another simulink model. And when I set it as EK1101, it
gets an output port.
My beckhoff module works as master and has no I/O module on it.
It is
only connected to MAXPOS driver through ethernet cable and I'm
trying to
send the signal over ethernet cable.
I would really appreciate any help you can provide.
Thank you.
Mit freundlichem Gruß
Richard Hacker
--
------------------------------__------------------------------__------------
Richard Hacker M.Sc.
[email protected] <mailto:[email protected]>
Tel.: +49 201 / 36014-16 <tel:%2B49%20201%20%2F%2036014-16>
Ingenieurgemeinschaft IgH
Gesellschaft für Ingenieurleistungen mbH
Heinz-Bäcker-Str. 34
D-45356 Essen
Amtsgericht Essen HRB 11500
USt-Id.-Nr.: DE 174 626 722
Geschäftsführung:
- Dr.-Ing. T. Finke,
- Dr.-Ing. W. Hagemeister
Tel.: +49 201 / 360-14-0 <tel:%2B49%20201%20%2F%20360-14-0>
http://www.igh-essen.com
------------------------------__------------------------------__------------
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users