Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  26 May 2014, Clemens Sauerzopf, Forum, Running a frontend on Arduino Yun 
    Reply  26 May 2014, Konstantin Olchanski, Forum, Running a frontend on Arduino Yun 
       Reply  27 May 2014, Clemens Sauerzopf, Forum, Running a frontend on Arduino Yun 
          Reply  27 May 2014, Konstantin Olchanski, Forum, Running a frontend on Arduino Yun 
             Reply  28 May 2014, Clemens Sauerzopf, Forum, Running a frontend on Arduino Yun 
                Reply  24 Oct 2014, Clemens Sauerzopf, Forum, Running a frontend on Arduino Yun 
                   Reply  24 Oct 2014, Stefan Ritt, Forum, Running a frontend on Arduino Yun 
                   Reply  24 Oct 2014, Konstantin Olchanski, Forum, Running a frontend on Arduino Yun 
                      Reply  02 Nov 2014, Stefan Ritt, Forum, Running a frontend on Arduino Yun 
Message ID: 1035     Entry time: 24 Oct 2014     In reply to: 1033     Reply to this: 1036
Author: Konstantin Olchanski 
Topic: Forum 
Subject: Running a frontend on Arduino Yun 
> INT read_event(char *pevent, INT off)
> {
>   WORD *data;
>   bk_create(pevent, "TEM0", TID_WORD, data); // <= we are dieing at this line
> }

The declaration of bk_create() in midas.h is wrong:

void EXPRT bk_create(void *pbh, const char *name, WORD type, void *pdata);
should be
void EXPRT bk_create(void *pbh, const char *name, WORD type, void **pdata);

Notice the extra "*" in "void**pdata" to indicate that it takes a pointer to the pointer to the data.

With the correct definition, you should get a compile error (type mismatch).

With the wrong current definition, you should have gotten a warning about "use of uninitialized variable 'data'", but some compilers with some settings do not generate this warning.

As it is, without looking at an example (highly recommended) and reading documentation (do we even have a "frontend writing guide"?!?) you have
no way to tell if you should pass "data" or "&data" to bk_create().

Thank you for reporting this problem.

P.S. As for running on Arduino, for slow controls type application, any CPU and network speed should be okey,
but memory use is always a concern, so please speak up if you run into problems. We routinely run MIDAS frontends
on linux machines with 512M and 128M RAM (1GHz CPU, 100 and 1000 M/s ethernet).

K.O.
ELOG V3.1.4-2e1708b5