[etherlab-users] Problem with EL4112 and Etherlab Master 1.3.2
Hammer, Günter
Guenter.Hammer at ids.de
Tue Nov 25 16:49:14 CET 2008
Hello,
I found out, that my EL4112-Slave is a new version of this module.
I also tested with an older version, an everything does right.
In the new version, Beckhoff changed the PDO mapping, but i think this is ok and should not be a problem.
Here is the ../info content of the NEW and the OLD EL4112-Slave:
###################################
NEW EL4112-Slave:
Ring position: 1
State: PREOP (PREOP)
Flags: online, ok
Data link status:
Port 0: Phy 0 (EBUS), Link up, Loop open, Signal detected
Port 1: Phy 3 (unknown), Link down, Loop closed, No signal
Port 2: Phy 0 (EBUS), Link down, Loop closed, No signal
Port 3: Phy 0 (EBUS), Link down, Loop closed, No signal
Identity:
Vendor ID: 0x00000002 (2)
Product code: 0x10103052 (269496402)
Revision number: 0x03F80000 (66584576)
Serial number: 0x00000000 (0)
Mailboxes:
RX: 0x1800/246, TX: 0x18F6/246
Supported protocols: CoE, FoE
Current consumption: 190 mA
General:
Group: AnaOut
Order number: EL4112
Name: EL4112 2K. Ana. Ausgang 0-20mA, 16bit
Sync managers / PDO mapping:
SM0: addr 0x1800, size 246, control 0x26, enable
No PDOs mapped.
SM1: addr 0x18F6, size 246, control 0x22, enable
No PDOs mapped.
SM2: addr 0x1000, size 2, control 0x24, enable
PDO mapping information from SII.
RxPdo 0x1600 "Channel 1"
0x3001:1 "Output", 16 bit
RxPdo 0x1601 "Channel 2"
0x3002:1 "Output", 16 bit
SM3: addr 0x1100, size 0, control 0x20, disable
No PDOs mapped.
Available PDOs from SII:
RxPdo 0x1600 "Channel 1", default mapping: SM2.
0x3001:1 "Output", 16 bit
RxPdo 0x1601 "Channel 2", default mapping: SM2.
0x3002:1 "Output", 16 bit
###################################
and here is the ../info content of the OLD EL4112-Slave:
Ring position: 2
State: PREOP (PREOP)
Flags: online, ok
Data link status:
Port 0: Phy 0 (EBUS), Link down, Loop open, Signal detected
Port 1: Phy 3 (unknown), Link down, Loop open, Signal detected
Port 2: Phy 0 (EBUS), Link down, Loop closed, No signal
Port 3: Phy 0 (EBUS), Link down, Loop closed, No signal
Identity:
Vendor ID: 0x00000002 (2)
Product code: 0x10103052 (269496402)
Revision number: 0x00000000 (0)
Serial number: 0x00000000 (0)
Mailboxes:
RX: 0x1800/246, TX: 0x18F6/246
Supported protocols: CoE, FoE
Current consumption: 180 mA
General:
Group: AnaOut
Image: TERM_AO
Order number: EL4112
Name: EL4112 2K. Ana. Ausgang 0-20mA
Sync managers / PDO mapping:
SM0: addr 0x1800, size 246, control 0x26, enable
No PDOs mapped.
SM1: addr 0x18F6, size 246, control 0x22, enable
No PDOs mapped.
SM2: addr 0x1000, size 4, control 0x24, enable
PDO mapping information from SII.
RxPdo 0x1600 "Channel 1"
0x6411:1 "Output", 16 bit
RxPdo 0x1601 "Channel 2"
0x6411:2 "Output", 16 bit
SM3: addr 0x1100, size 0, control 0x20, enable
No PDOs mapped.
Available PDOs from SII:
RxPdo 0x1600 "Channel 1", default mapping: SM2.
0x6411:1 "Output", 16 bit
RxPdo 0x1601 "Channel 2", default mapping: SM2.
0x6411:2 "Output", 16 bit
##################################################
I used the mini-code-example to start.
My initialization code:
#define Beckhoff_EL4112_new 0x00000002, 0x10103052
#define Beckhoff_EL4112_new_PDO_Output1 0x3001, 1
#define Beckhoff_EL4112_new_PDO_Output2 0x3002, 1
#define Beckhoff_EL4112_new_Output1 Beckhoff_EL4112_new, Beckhoff_EL4112_new_PDO_Output1
#define Beckhoff_EL4112_new_Output2 Beckhoff_EL4112_new, Beckhoff_EL4112_new_PDO_Output2
#define Beckhoff_EL4112_old 0x00000002, 0x10103052
#define Beckhoff_EL4112_old_PDO_Output1 0x6411, 1
#define Beckhoff_EL4112_old_PDO_Output2 0x6411, 2
#define Beckhoff_EL4112_old_Output1 Beckhoff_EL4112_old, Beckhoff_EL4112_old_PDO_Output1
#define Beckhoff_EL4112_old_Output2 Beckhoff_EL4112_old, Beckhoff_EL4112_old_PDO_Output2
static void *r_ana_out_new;
static void *r_ana_out_old;
const static ec_pdo_reg_t domain1_pdo_regs[] = {
{"1", Beckhoff_EL4112_new_Output1, &r_ana_out_new},
{"2", Beckhoff_EL4112_old_Output1, &r_ana_out_old},
{}
};
int __init init_mini_module
(
void
)
{
while (!(EcKAppMainInfo.master = ecrt_request_master(0)))
{
printk(KERN_ERR PFX "Requesting master 0 failed!\n");
ssleep(10);
}
ecrt_master_callbacks( EcKAppMainInfo.master, request_lock, release_lock, NULL);
if (!(EcKAppMainInfo.pEcDomain->pDomain = ecrt_master_create_domain( EcKAppMainInfo.master ))) {
printk(KERN_ERR "-> Domain creation failed!\n");
goto out_release_master;
}
if (ecrt_domain_register_pdo_list(EcKAppMainInfo.pEcDomain->pDomain, domain1_pdo_regs)) {
printk(KERN_ERR PFX "PDO registration failed!\n");
goto out_release_master;
}
if (ecrt_master_activate(EcKAppMainInfo.master)) {
printk(KERN_ERR PFX "Failed to activate master!\n");
goto out_release_master;
}
init_timer(&EcKAppMainInfo.timer);
EcKAppMainInfo.timer.function = run;
EcKAppMainInfo.timer.expires = jiffies + 10;
add_timer(&EcKAppMainInfo.timer);
return 0;
out_release_master:
ecrt_release_master( EcKAppMainInfo.master );
return -1;
}
Best regards
Günter Hammer
More information about the Etherlab-users
mailing list