Hello Luis.
Your patch is very impressive. Very good work !
I will test it as soon as possible.
I have some suggestions :
- Add a paragraph in the tex manual (something similar to your mail
should be sufficient)
- Add some EMCY scenario to the TestMasterSlave example, so that :
+ the EMCY feature could also benefit from this non-regression test
+ CanFestival users will have a real use case to copy/paste code from.
- Add your name in CONTRIBUTORS file
- Put your name in the emcy.c and emcy.h files header
- 1003h must have a special behavior in objdictedit. See gen_cfile.py,
line 320 for a similar example:
if 0x1005 not in communicationlist:
entry_infos = Node.GetEntryInfos(0x1005)
texts["EntryName"] = entry_infos["name"]
indexContents[0x1005] = """\n/* index 0x1005 : %(EntryName)s */
UNS32 %(NodeName)s_obj1005 = 0x0; /* 0 */
"""%texts
As you can see this forces declaration of a fake 1005 index in the
generated c file, so that CO_Data struct can be filled by initializer.
Just do the same for 1003.
- EMCY_MAX_ERRORS should be a configure parameter:
This do _not_ work (only first array element is initialized) :
/* error_data: structure s_errors */\
{{\
0, /* errCode */\
0, /* errRegMask */\
0 /* active */\
},},\
Configure should generate config.h with appropriate macros :
#define EMCY_MAX_ERRORS 8
#define REPEAT_EMCY_MAX_ERRORS_TIMES(repeat)\
repeat repeat repeat repeat repeat repeat repeat repeat
And then, in data.h:
#define ERROR_DATA_INITIALIZER \
{\
0, /* errCode */\
0, /* errRegMask */\
0 /* active */\
},
#define CANOPEN_NODE_DATA_INITIALIZER(NODE_PREFIX) {\
...
\
/* EMCY */\
Error_free, /* error_state */\
sizeof(NODE_PREFIX ## _obj1003) / sizeof(NODE_PREFIX ## _obj1003[0]), /* error_history_size */\
& NODE_PREFIX ## _highestSubIndex_obj1003, /* error_number */\
& NODE_PREFIX ## _obj1003[0], /* error_first_element */\
& NODE_PREFIX ## _obj1001, /* error_register */\
/* error_data: structure s_errors */\
{\
REPEAT_EMCY_MAX_ERRORS_TIMES(ERROR_DATA_INITIALIZER)\
},\
_post_emcy /* post_emcy */\
I send you CVS write access login/password in a separate email.
Thanks for your devotion to the CanFestival project !
Regards
Edouard
canfestival-devel@... a écrit :
> As I already commented in this list, I wanted to implement EMCY
> messages, and finally I have had time to do it.
> It is a preliminar version that only manages standard errors (no
> manufacturer specific field is used in EMCY messages or additional info
> in 1003 regs) but it seems to work.
> - It implements the error state machine defined in DS-301
> - It manages 1001h and 1003h OD entries. (It is neccesary that 1003h exists)
> - It uses an array (d->error_data) to manage which errors are active. By
> now the size of this array is defined as EMCY_MAX_ERRORS=8 in emcy.h,
> but it might be defined in config.h)
> - It calls the function (d->post_emcy(UNS8 nodeID, UNS16 errCode, UNS8
> errReg)) when an EMCY message is received. So it has to be defined in
> user app and assigned in the same way as initialisation() or post_sync().
> - It provides an API for error management:
> · EMCY_setError(CO_Data* d, UNS16 errCode, UNS8 errRegMask)
> · EMCY_errorRecovered(CO_Data* d, UNS16 errCode)
>
> I have faced some issues:
> - I haven´t found the criteria for MSG_ERR or MSG_WAR codes, so I used
> some arbitrary ones. It has to be changed.
> - Index 1003, subindex 0, number of errors: can be written, but only
> with a '0'. If it is tried to be written with a different value it
> should lead to an abort message that says it is out of range. I supose
> this verification has to be checked in the object access, but I don´t
> know where exactly, so I haven't done it.
>
> I have mad a patch, but it does not include "emcy.h" or "emcy.c" that
> are also attached.
>
> Please, let me know your impressions or suggestions if you test it.
> Regards,
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Canfestival-devel mailing list
> Canfestival-devel@...
> https://lists.sourceforge.net/lists/listinfo/canfestival-devel
--
LOLITech - TBI sarl
24, rue Pierre Evrat
88100 Saint-Dié des Vosges
tel: 03 29 52 95 67
fax: 03 29 58 93 16
edouard.tisserant@... <mailto:edouard.tisserant@...>
http://www.lolitech.fr <http://www.lolitech.fr>
|