[etherlab-users] Question about cascading EK1100
Thorsten Schnebeck
thorsten.schnebeck at gmx.net
Tue Feb 1 15:38:01 CET 2011
Hi,
old thread, but somehow the same problem:
> >Michael Sagner schrieb:
> >
> > I’m planning to use several EK1100 couplers on one ethernet line.
> > The first EK1100 will be connected directly to a PC’s Ethernet port
> > (the PC is running Etherlab),
> > The second one will be connected via the slave Ethernet port of the
> > first EK1100 and so on.
> > Q: What must be done to initialize the slave EK1100’s? Is there a
> > C/C++ code sample for this, someplace?
> Andreas Stewering-Bone schrieb:
>
> There is no need to initialize the EK1100,
> but it is possible.
> You have to act on it like a normal slave without pdo configuration
> #define BusCouplerPos 0, 0
> #define Beckhoff_EK1100 0x00000002, 0x044c2c52
> ...
> sc = ecrt_master_slave_config(master, BusCouplerPos, Beckhoff_EK1100);
> if (!sc)
> return -1;
> and that is all
We also want to use cascading couplers but as part of ML/Simulink generate code.
When we want to use two EK1100 boxes the Matlab code generator creates wrong code :
ulser3.c: In function 'MdlStart':
ulser3.c:3988: error: 'sync_manager_2_044c2c52_00000000_0' undeclared
(first use in this function)
ulser3.c:3988: error: (Each undeclared identifier is reported only once
ulser3.c:3988: error: for each function it appears in.)
gmake: *** [ulser3.o] Error 1
This is the generated code for the two couplers:
/* S-Function Block: <Root>/Infrastructure
* Registering EtherCAT block EK1100 with Driver
*/
if ((errstr_rc = ecs_reg_slave( 0, /* TID */
/* MasterId, DomainId, SlaveAlias, SlavePosition */
0U, 0U, 0U, 1U,
/* VendorId, ProductCode */
2U, 72100946U,
/* SdoConfigCount, SdoVar */
0, NULL,
/* SoeConfigCount, SoeVar */
0, NULL,
/* SyncManager Configuration */
NULL,
/* Distributed Clock Configuration */
NULL,
/* Input/Output Configuration */
0, NULL))) {
snprintf(etl_errbuf, sizeof(etl_errbuf),
"EtherCAT slave ifumPulser3/Infrastructure register "
"failed: %s", errstr_rc);
rtmSetErrorStatus(ifumPulser3_M, etl_errbuf);
return;
}
/* S-Function Block: <Root>/Infrastructure1
* Registering EtherCAT block EK1100 with Driver
*/
if ((errstr_rc = ecs_reg_slave( 0, /* TID */
/* MasterId, DomainId, SlaveAlias, SlavePosition */
0U, 0U, 0U, 20U,
/* VendorId, ProductCode */
2U, 72100946U,
/* SdoConfigCount, SdoVar */
0, NULL,
/* SoeConfigCount, SoeVar */
0, NULL,
/* SyncManager Configuration */
sync_manager_2_044c2c52_00000000_0,
/* Distributed Clock Configuration */
NULL,
/* Input/Output Configuration */
0, NULL))) {
snprintf(etl_errbuf, sizeof(etl_errbuf),
"EtherCAT slave ifumPulser3/Infrastructure1 register "
"failed: %s", errstr_rc);
rtmSetErrorStatus(ifumPulser3_M, etl_errbuf);
return;
}
}
If I change manually the sync_manager_2_044c2c52_00000000_0 -> NULL everything works as expected and both couplers do enter OP-mode.
Any hints how this can be fixed?
Bye
Thorsten
--
etherlab 1.3pre670
More information about the Etherlab-users
mailing list