[etherlab-dev] EtherCAT :: generatingvoltageon BeckhoffEL4732terminal fails
Daniel Bechter
daniel.bechter at omicron.at
Fri Apr 17 10:37:42 CEST 2009
I think that the EL4732 terminal is too sophisticated. From the ethercat data
command you can see that 4 Bytes are transmitted, 2 Bytes for Ch1 CycleCount
and 2 Bytes for Ch1 Value. The CycleCount seems to be added to the data image
even though I did not add it to the domain regs (I only add the channel 1
value beforehand... off_el4732_ch1).
I think that the EL4732 does not generate the output because channel 2 is
activated internally but no data arrives. So I tried to add channel 2 to the
domain regs:
const static ec_pdo_entry_reg_t domain1_regs[] = {
{AnaOutSlavePos, Beckhoff_EL4732, 0x7800, 1, &off_el4732_cc1}, //Ch1 CC
{AnaOutSlavePos, Beckhoff_EL4732, 0x7000, 1, &off_el4732_ch1}, //Ch1 val
{AnaOutSlavePos, Beckhoff_EL4732, 0x7800, 2, &off_el4732_cc2}, //Ch2 CC
{AnaOutSlavePos, Beckhoff_EL4732, 0x7000, 2, &off_el4732_ch2}, //Ch2 val
{}
};
As soon as I try to add data from another SM to the domain regs, I get domain
state 1 and a working counter 1/2. All data is written according to the
ethercat data command however:
root at SWES-Linux:/home/daniel/EtherCAT/ethercat-devel-r1680/tool# ./ethercat
data | hexdump
0000000 02e8 7FFF 02e8 7FFF
0000008
root at SWES-Linux:/home/daniel/EtherCAT/ethercat-devel-r1680/tool# ./ethercat
data | hexdump
0000000 0342 7FFF 0342 7FFF
0000008
root at SWES-Linux:/home/daniel/EtherCAT/ethercat-devel-r1680/tool# ./ethercat
data | hexdump
0000000 0395 7FFF 0395 7FFF
0000008
But there is neither an output on channel 1 nor on channel 2 of the terminal
(both should be 10V now).
I am really stuck here. I would also like to attach the documentation of the
EL4732:
ftp://ftp.beckhoff.com/Document/BusTermi/BusTermi/EL4732e.chm
Maybe you guys have an idea left for me :( ...
-----Original Message-----
From: etherlab-dev-bounces at etherlab.org
[mailto:etherlab-dev-bounces at etherlab.org] On Behalf Of Daniel Bechter
Sent: Thursday, 16. April 2009 10:58
To: etherlab-dev at etherlab.org
Subject: Re: [etherlab-dev] EtherCAT :: generatingvoltageon
BeckhoffEL4732terminal fails
> Try to specify all pdos and sm exactly as in the output of ethercat xml.
> Same order and the complete list of pdos.
Done so now. I added all PDO's and entries to the sync stucture now and in
the same order as in the XML. CycleCounter and Value are now swapped within
the data image.
const static ec_pdo_entry_reg_t domain1_regs[] = {
{AnaOutSlavePos, Beckhoff_EL4732, 0x7000, 1, &off_ana_out}, //
channel 1 sample value
{}
};
static ec_pdo_entry_info_t el4732_pdo_entries[] = {
{0x7800, 1, 16}, // channel 1 cycle count
{0x7000, 1, 16}, // channel 1 sample value
{0x7800, 2, 16}, // channel 2 cycle count
{0x7000, 2, 16}, // channel 2 sample value
{0x1d09, 152, 32} // StartTimeNextOutput
};
static ec_pdo_info_t el4732_pdos[] = {
{0x1680, 1, &el4732_pdo_entries[0]},
{0x1600, 1, &el4732_pdo_entries[1]},
{0x1780, 1, &el4732_pdo_entries[2]},
{0x1700, 1, &el4732_pdo_entries[3]},
{0x1a82, 1, &el4732_pdo_entries[4]}
};
static ec_sync_info_t el4732_syncs[] = {
{0, EC_DIR_OUTPUT, 2, el4732_pdos},
{1, EC_DIR_OUTPUT, 2, &el4732_pdos[2]},
{2, EC_DIR_INPUT, 1, &el4732_pdos[4]},
{0xff}
};
All logs look fine, working counter 1/1, domain state 2, data is transmitted
(according to the data command). But still no voltage is generated by the
EL4732. Only one warning shows up in the syslog ("WARNING: 1 datagram
UNMATCHED"), but I have seen this at startup with other tasks that worked
correctly, too...
XML output from the command-line tool is attached to my first mail.
> In the your sylog output the working counter is 1/1 like expected??
Yes, the code from my first mail here is an example that worked concerning
PDO and SM configuration. But no voltage is generated by the EL4732.
I also added an analog-in terminal recently and it all ends up with a working
counter 2/3 and domain state 1. I can't find an error in my code, but I first
want to track down the problem with the analog-out terminal...
_______________________________________________
etherlab-dev mailing list
etherlab-dev at etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-dev
More information about the Etherlab-dev
mailing list