I've already posted these information to the mailing list and to Andreas Stewering-Bone. I'm using Linux-2.6.24.7, Ethercat 1.4, Etherlab 1.2rc10, Rtai 3.6.2 (all from the ethernet-bundle-1.6) The model and the c-file is attached. My matlab version is 2010a. I think that i don't use printf somewhere. I just put some blocks from the etherlab_lib together.
Thank you for your help -------- Original-Nachricht -------- > Datum: Tue, 26 Oct 2010 12:28:47 +0200 > Von: Richard Hacker <[email protected]> > An: [email protected] > CC: [email protected] > Betreff: Re: [etherlab-users] Problem with module installation > Hello Joerg > > I am a bit confused. Are you using printf somewhere? If you can, please > attach > your model that you are trying to compile. Also, please attach > etherlab_first_test.c > > You have not sent me the details of your operating system: > OS: > Version/Distribution > EtherLab Version > > Richard > > On Tuesday 26 October 2010 09:35:15 [email protected] wrote: > > Hello Richard > > > > I've attached the symbol table. > > > > Greatings Joerg > > > > > > -------- Original-Nachricht -------- > > > > > Datum: Tue, 26 Oct 2010 09:30:36 +0200 > > > Von: Richard Hacker <[email protected]> > > > An: [email protected] > > > CC: [email protected] > > > Betreff: Re: [etherlab-users] Problem with module installation > > > > > > Hello > > > > > > Please supply some information about your operating system. > > > > > > Also, supply the symbol table for all generated objects: > > > # cd <modelname>_etl_rtw > > > # nm *.o > > > > > > Richard > > > > > > On Tuesday 26 October 2010 08:49:00 [email protected] wrote: > > > > Hello, > > > > > > > > this is my previous mail in english with some additional > information: > > > > I've downloaded the ethernet-bundle-1.6 from www.etherlab.org and > > > > > > installed > > > > > > > it. So now I'm running kernel 2.6.24.7, rtai 3.6.2, ethercat 1.4 > and > > > > etherlab 1.2rc4 (i've also tried etherlab 1.2rc10). I've started > the > > > > > > new > > > > > > > kernel and the services ethercat and etherlab. Now I built a simple > > > > Simulink Model containing EK1100, EL3102 and EL4102. There is a > gain > > > > of 0.5 between EL3102 and EL4102. After having adjusted the > > > > Configuration Parameters I built the model and received several > > > > warnings of undefined symbols (like __snprintf_chk). Now I tried to > > > > execute insmod. There was > > > > > > an > > > > > > > error (dmesg) saying that the symbol __snprintf_chk is undefined. I > > > > > > don't > > > > > > > know which library is missing. I didn't find this error in > Internet. > > > > > > Could > > > > > > > you give me some advise please? > > > > > > > > Thank you > > > > > > > > Joerg > > > > -- > ------------------------------------------------------------------------ > > Richard Hacker Amtsgericht Essen HRB 11500 > Ingenieurgemeinschaft IgH USt-Id.-Nr.: DE 174 626 722 > Ges. für Ingenieurleistungen mbH Geschäftsführung: > > Heinz-Baecker-Str. 34 Dr.-Ing. S. Rotthäuser > D-45356 Essen Dr.-Ing. T. Finke > Tel.: +49 201 / 36014-16 Dr.-Ing. W. Hagemeister > Fax.: +49 201 / 36014-14 Tel.: +49 201 / 360-14-0 > [email protected] http://www.igh-essen.com > > ------------------------------------------------------------------------ -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
etherlab_first_test.mdl
Description: Binary data
/*
* etherlab_first_test.c
*
* Real-Time Workshop code generation for Simulink model "etherlab_first_test.mdl".
*
* Model version : 1.4
* Real-Time Workshop version : 7.5 (R2010a) 25-Jan-2010
* C source code generated on : Mon Oct 25 17:38:51 2010
*
* Target selection: etherlab.tlc
* Note: GRT includes extra infrastructure and instrumentation for prototyping
* Embedded hardware selection: 32-bit xPC Target (Intel Pentium)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "etherlab_first_test_capi.h"
#include "etherlab_first_test.h"
#include "etherlab_first_test_private.h"
/* S-Function Block: <Root>/AOUT_0
* Mapped Pdos for block EL4102
*/
struct pdo_map pdo_map_1[] = {
{ 0x6411, 1, 1, EC_DIR_OUTPUT, si_sint16_T, 16,
ðerlab_first_test_DWork.AOUT_0_PWORK.DataPtr[0], NULL },
{ 0x6411, 2, 1, EC_DIR_OUTPUT, si_sint16_T, 16,
ðerlab_first_test_DWork.AOUT_0_PWORK.DataPtr[1], NULL },
};
/* PDO configuration for EL4102
* with configuration layout 0U
*/
ec_pdo_entry_info_t pdo_entry_info_2_10063052_00000000_0[] = {
{ 0x6411, 1, 16 }, /* 0 */
{ 0x6411, 2, 16 }, /* 1 */
};
ec_pdo_info_t pdo_info_2_10063052_00000000_0[] = {
{ 0x1600, 1, &pdo_entry_info_2_10063052_00000000_0[0] },
{ 0x1601, 1, &pdo_entry_info_2_10063052_00000000_0[1U] },
};
ec_sync_info_t sync_manager_2_10063052_00000000_0[] = {
{ 2U, EC_DIR_OUTPUT, 2U, &pdo_info_2_10063052_00000000_0[0] },
{ (uint8_T)EC_END, },
};
/* S-Function Block: <Root>/AIN_0
* Mapped Pdos for block EL3102
*/
struct pdo_map pdo_map_2[] = {
{ 0x3101, 2, 1, EC_DIR_INPUT, si_sint16_T, 16,
ðerlab_first_test_DWork.AIN_0_PWORK.DataPtr[0], NULL },
{ 0x3102, 2, 1, EC_DIR_INPUT, si_sint16_T, 16,
ðerlab_first_test_DWork.AIN_0_PWORK.DataPtr[1], NULL },
};
/* PDO configuration for EL3102
* with configuration layout 0U
*/
ec_pdo_entry_info_t pdo_entry_info_2_0c1e3052_00000000_0[] = {
{ 0x3101, 1, 8 }, /* 0 */
{ 0x3101, 2, 16 }, /* 1 */
{ 0x3102, 1, 8 }, /* 2 */
{ 0x3102, 2, 16 }, /* 3 */
};
ec_pdo_info_t pdo_info_2_0c1e3052_00000000_0[] = {
{ 0x1A00, 2, &pdo_entry_info_2_0c1e3052_00000000_0[0] },
{ 0x1A01, 2, &pdo_entry_info_2_0c1e3052_00000000_0[2U] },
};
ec_sync_info_t sync_manager_2_0c1e3052_00000000_0[] = {
{ 3U, EC_DIR_INPUT, 2U, &pdo_info_2_0c1e3052_00000000_0[0] },
{ (uint8_T)EC_END, },
};
/* Block signals (auto storage) */
BlockIO_etherlab_first_test etherlab_first_test_B;
/* Block states (auto storage) */
D_Work_etherlab_first_test etherlab_first_test_DWork;
/* Real-time model */
RT_MODEL_etherlab_first_test etherlab_first_test_M_;
RT_MODEL_etherlab_first_test *etherlab_first_test_M = ðerlab_first_test_M_;
/* All EtherLAB error messages go in here */
char etl_errbuf[256];
/* Model output function */
static void etherlab_first_test_output(int_T tid)
{
/* user code (Output function Body) */
/* EtherCAT Process for Sample Time [0.01] */
if (1 && rtmIsMajorTimeStep(etherlab_first_test_M)) {
ecs_receive(0);
#ifdef ASYNC_ECAT
ecs_send(0);
#endif
}
/* S-Function Block: <Root>/AIN_0 */
/* Output Port 1 */
etherlab_first_test_B.AIN_0[0] = *(int16_T*)
etherlab_first_test_DWork.AIN_0_PWORK.DataPtr[0] / 32768.0;
etherlab_first_test_B.AIN_0[1] = *(int16_T*)
etherlab_first_test_DWork.AIN_0_PWORK.DataPtr[1] / 32768.0;
/* Gain: '<Root>/Gain' */
etherlab_first_test_B.Gain[0] = etherlab_first_test_P.Gain_Gain *
etherlab_first_test_B.AIN_0[0];
etherlab_first_test_B.Gain[1] = etherlab_first_test_P.Gain_Gain *
etherlab_first_test_B.AIN_0[1];
/* tid is required for a uniform function interface.
* Argument tid is not used in the function. */
UNUSED_PARAMETER(tid);
}
/* Model update function */
static void etherlab_first_test_update(int_T tid)
{
/* S-Function Block: <Root>/AOUT_0
*/
/* Input port 1 */
{
real_T value = 0.0;
value = 32768.0 * etherlab_first_test_B.Gain[0];
value = value > 32767.0 ? 32767.0 : (value < -32768.0 ? -32768.0 : value);
*(int16_T*)etherlab_first_test_DWork.AOUT_0_PWORK.DataPtr[0] = (int16_T)
value;
value = 32768.0 * etherlab_first_test_B.Gain[1];
value = value > 32767.0 ? 32767.0 : (value < -32768.0 ? -32768.0 : value);
*(int16_T*)etherlab_first_test_DWork.AOUT_0_PWORK.DataPtr[1] = (int16_T)
value;
}
/* user code (Update function Trailer) */
/* EtherCAT Queue for Sample Time [0.01] */
#ifndef ASYNC_ECAT
if (1 && rtmIsMajorTimeStep(etherlab_first_test_M)) {
ecs_send(0);
}
#endif
/* Update absolute time for base rate */
/* The "clockTick0" counts the number of times the code of this task has
* been executed. The absolute time is the multiplication of "clockTick0"
* and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
* overflow during the application lifespan selected.
* Timer of this task consists of two 32 bit unsigned integers.
* The two integers represent the low bits Timing.clockTick0 and the high bits
* Timing.clockTickH0. When the low bit overflows to 0, the high bits increment.
*/
if (!(++etherlab_first_test_M->Timing.clockTick0)) {
++etherlab_first_test_M->Timing.clockTickH0;
}
etherlab_first_test_M->Timing.t[0] = etherlab_first_test_M->Timing.clockTick0 *
etherlab_first_test_M->Timing.stepSize0 +
etherlab_first_test_M->Timing.clockTickH0 *
etherlab_first_test_M->Timing.stepSize0 * 4294967296.0;
{
/* Update absolute timer for sample time: [0.01s, 0.0s] */
/* The "clockTick1" counts the number of times the code of this task has
* been executed. The absolute time is the multiplication of "clockTick1"
* and "Timing.stepSize1". Size of "clockTick1" ensures timer will not
* overflow during the application lifespan selected.
* Timer of this task consists of two 32 bit unsigned integers.
* The two integers represent the low bits Timing.clockTick1 and the high bits
* Timing.clockTickH1. When the low bit overflows to 0, the high bits increment.
*/
if (!(++etherlab_first_test_M->Timing.clockTick1)) {
++etherlab_first_test_M->Timing.clockTickH1;
}
etherlab_first_test_M->Timing.t[1] =
etherlab_first_test_M->Timing.clockTick1 *
etherlab_first_test_M->Timing.stepSize1 +
etherlab_first_test_M->Timing.clockTickH1 *
etherlab_first_test_M->Timing.stepSize1 * 4294967296.0;
}
/* tid is required for a uniform function interface.
* Argument tid is not used in the function. */
UNUSED_PARAMETER(tid);
}
/* Model initialize function */
void etherlab_first_test_initialize(boolean_T firstTime)
{
(void)firstTime;
/* Registration code */
/* initialize non-finites */
rt_InitInfAndNaN(sizeof(real_T));
/* initialize real-time model */
(void) memset((void *)etherlab_first_test_M, 0,
sizeof(RT_MODEL_etherlab_first_test));
{
/* Setup solver object */
rtsiSetSimTimeStepPtr(ðerlab_first_test_M->solverInfo,
ðerlab_first_test_M->Timing.simTimeStep);
rtsiSetTPtr(ðerlab_first_test_M->solverInfo, &rtmGetTPtr
(etherlab_first_test_M));
rtsiSetStepSizePtr(ðerlab_first_test_M->solverInfo,
ðerlab_first_test_M->Timing.stepSize0);
rtsiSetErrorStatusPtr(ðerlab_first_test_M->solverInfo,
(&rtmGetErrorStatus(etherlab_first_test_M)));
rtsiSetRTModelPtr(ðerlab_first_test_M->solverInfo, etherlab_first_test_M);
}
rtsiSetSimTimeStep(ðerlab_first_test_M->solverInfo, MAJOR_TIME_STEP);
rtsiSetSolverName(ðerlab_first_test_M->solverInfo,"FixedStepDiscrete");
/* Initialize timing info */
{
int_T *mdlTsMap = etherlab_first_test_M->Timing.sampleTimeTaskIDArray;
mdlTsMap[0] = 0;
mdlTsMap[1] = 1;
etherlab_first_test_M->Timing.sampleTimeTaskIDPtr = (&mdlTsMap[0]);
etherlab_first_test_M->Timing.sampleTimes =
(ðerlab_first_test_M->Timing.sampleTimesArray[0]);
etherlab_first_test_M->Timing.offsetTimes =
(ðerlab_first_test_M->Timing.offsetTimesArray[0]);
/* task periods */
etherlab_first_test_M->Timing.sampleTimes[0] = (0.0);
etherlab_first_test_M->Timing.sampleTimes[1] = (0.01);
/* task offsets */
etherlab_first_test_M->Timing.offsetTimes[0] = (0.0);
etherlab_first_test_M->Timing.offsetTimes[1] = (0.0);
}
rtmSetTPtr(etherlab_first_test_M, ðerlab_first_test_M->Timing.tArray[0]);
{
int_T *mdlSampleHits = etherlab_first_test_M->Timing.sampleHitArray;
mdlSampleHits[0] = 1;
mdlSampleHits[1] = 1;
etherlab_first_test_M->Timing.sampleHits = (&mdlSampleHits[0]);
}
rtmSetTFinal(etherlab_first_test_M, -1);
etherlab_first_test_M->Timing.stepSize0 = 0.01;
etherlab_first_test_M->Timing.stepSize1 = 0.01;
etherlab_first_test_M->solverInfoPtr = (ðerlab_first_test_M->solverInfo);
etherlab_first_test_M->Timing.stepSize = (0.01);
rtsiSetFixedStepSize(ðerlab_first_test_M->solverInfo, 0.01);
rtsiSetSolverMode(ðerlab_first_test_M->solverInfo,
SOLVER_MODE_SINGLETASKING);
/* block I/O */
etherlab_first_test_M->ModelData.blockIO = ((void *) ðerlab_first_test_B);
(void) memset(((void *) ðerlab_first_test_B), 0,
sizeof(BlockIO_etherlab_first_test));
/* parameters */
etherlab_first_test_M->ModelData.defaultParam = ((real_T *)
ðerlab_first_test_P);
/* states (dwork) */
etherlab_first_test_M->Work.dwork = ((void *) ðerlab_first_test_DWork);
(void) memset((void *)ðerlab_first_test_DWork, 0,
sizeof(D_Work_etherlab_first_test));
/* Initialize DataMapInfo substructure containing ModelMap for C API */
etherlab_first_test_InitializeDataMapInfo(etherlab_first_test_M);
}
/* Model terminate function */
void etherlab_first_test_terminate(void)
{
/* user code (Terminate function Body) */
/* Shutting down EtherCAT subsystem */
ecs_end();
}
/*========================================================================*
* Start of GRT compatible call interface *
*========================================================================*/
void MdlOutputs(int_T tid)
{
etherlab_first_test_output(tid);
}
void MdlUpdate(int_T tid)
{
etherlab_first_test_update(tid);
}
void MdlInitializeSizes(void)
{
etherlab_first_test_M->Sizes.numContStates = (0);/* Number of continuous states */
etherlab_first_test_M->Sizes.numY = (0);/* Number of model outputs */
etherlab_first_test_M->Sizes.numU = (0);/* Number of model inputs */
etherlab_first_test_M->Sizes.sysDirFeedThru = (0);/* The model is not direct feedthrough */
etherlab_first_test_M->Sizes.numSampTimes = (2);/* Number of sample times */
etherlab_first_test_M->Sizes.numBlocks = (4);/* Number of blocks */
etherlab_first_test_M->Sizes.numBlockIO = (2);/* Number of block outputs */
etherlab_first_test_M->Sizes.numBlockPrms = (1);/* Sum of parameter "widths" */
}
void MdlInitializeSampleTimes(void)
{
}
void MdlInitialize(void)
{
}
void MdlStart(void)
{
{
/* user code (Start function Header) */
const char __attribute__((unused)) *errstr_rc;
/* Sample times for EtherCAT */
unsigned int ec_st[] = {
10000U,
0U };
/* user code (Start function Body) */
/* Initialising EtherCAT Support system */
if ((errstr_rc = ecs_init( ec_st))) {
snprintf(etl_errbuf, sizeof(etl_errbuf),
"Could not initialise EtherCAT Support layer: %s",
errstr_rc);
rtmSetErrorStatus(etherlab_first_test_M, etl_errbuf);
return;
}
/* S-Function Block: <Root>/AOUT_0
* Registering EtherCAT block EL4102 with Driver
*/
if ((errstr_rc = ecs_reg_slave( 0, /* TID */
/* MasterId, DomainId, SlaveAlias, SlavePosition */
0U, 0U, 0U, 2U,
/* VendorId, ProductCode */
2U, 268841042U,
/* SdoConfigCount, SdoVar */
0, NULL,
/* SyncManager Configuration */
sync_manager_2_10063052_00000000_0,
/* Input/Output Configuration */
2, pdo_map_1))) {
snprintf(etl_errbuf, sizeof(etl_errbuf),
"EtherCAT slave etherlab_first_test/AOUT_0 register "
"failed: %s", errstr_rc);
rtmSetErrorStatus(etherlab_first_test_M, etl_errbuf);
return;
}
/* S-Function Block: <Root>/AIN_0
* Registering EtherCAT block EL3102 with Driver
*/
if ((errstr_rc = ecs_reg_slave( 0, /* TID */
/* MasterId, DomainId, SlaveAlias, SlavePosition */
0U, 0U, 0U, 1U,
/* VendorId, ProductCode */
2U, 203305042U,
/* SdoConfigCount, SdoVar */
0, NULL,
/* SyncManager Configuration */
sync_manager_2_0c1e3052_00000000_0,
/* Input/Output Configuration */
2, pdo_map_2))) {
snprintf(etl_errbuf, sizeof(etl_errbuf),
"EtherCAT slave etherlab_first_test/AIN_0 register "
"failed: %s", errstr_rc);
rtmSetErrorStatus(etherlab_first_test_M, etl_errbuf);
return;
}
/* 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, 0U,
/* VendorId, ProductCode */
2U, 72100946U,
/* SdoConfigCount, SdoVar */
0, NULL,
/* SyncManager Configuration */
NULL,
/* Input/Output Configuration */
0, NULL))) {
snprintf(etl_errbuf, sizeof(etl_errbuf),
"EtherCAT slave etherlab_first_test/Infrastructure register "
"failed: %s", errstr_rc);
rtmSetErrorStatus(etherlab_first_test_M, etl_errbuf);
return;
}
/* user code (Start function Trailer) */
/* Starting EtherCAT subsystem */
if ((errstr_rc = ecs_start())) {
snprintf(etl_errbuf, sizeof(etl_errbuf),
"Starting EtherCAT subsystem failed: %s", errstr_rc);
rtmSetErrorStatus(etherlab_first_test_M, etl_errbuf);
return;
}
}
MdlInitialize();
}
void MdlTerminate(void)
{
etherlab_first_test_terminate();
}
RT_MODEL_etherlab_first_test *etherlab_first_test(void)
{
etherlab_first_test_initialize(1);
return etherlab_first_test_M;
}
/*========================================================================*
* End of GRT compatible call interface *
*========================================================================*/
_______________________________________________ etherlab-users mailing list [email protected] http://lists.etherlab.org/mailman/listinfo/etherlab-users
