Re: comedi_command_test fails using rtai_comedi

Ian Abbott wrote:

> I don't recognize the rt_ functions you are using, 
These are from rtai's comedi add-on, and there defined in rtai_comedi.h

> but the code above should cause comedi_command_test to return 3,
> and mpComediCommand->convert_arg should have been modified to 
> an acceptable value. 
Correct, but this doesn't happen because the command never seems to 
arrive intact in the appropriate driver specific test function 
(ni_ai_cmdtest - see my initial mail).

> What happens if you call comedi_command_test again with the modified 
> mpComediCommand?
Since comedi_command_test only modifies the command if there are only 
minor errors (i.e. when 3 will be returned), and in my case, 1 is 
returned, no modifications take place. The command is the same as before 
comedi_command_test, and I can tell that from dump_cmd's output.

However if I dump the contents of the command in kernel space, I see 
that all fields are zero. That's my real problem. AFAIK I _have_ built a 
command with only minor errors that should be just corrected by 
comedi_command_test.

But somewhere in the call stack down to ni_ai_cmdtest(...) my command is 
no longer passed on, but an obviously incorrect all-zero memory area.

I don't know if this is a bug of my program or in (rtai-) comedi (add-on).

Andreas

Received on 2005-02-16Z17:52:51