Thanks for the feedback. Very useful!

I will handle integrating this into the linuxcnc source tree after I get
things cleaned up, tested, and get the code production worthy. I'll also
move all of the code into the comp file as suggested by Sebastian.



As far as capturing output, I'll just write any errors encountered to
stderr. That is perfectly fine as far as I'm concerned. I just had a hard
time finding out where the linuxcnc logs were located. I couldn't find them
in the documentation via search, or in the wiki either.


As far as the watchdog goes, It just didn't occur to me. I think that a
watchdog is a much better solution than monitoring the exit code of the
user component. Simply because it is an explicit mechanism. No matter how
perfect the component may be, it can still have an error, and start
behaving erratically. The watchdog is going to have a more reliable take on
the behavior of the user component and it is easier to understand when
someone else comes in and looks at the .hal file for troubleshooting.

Thanks a bunch,
Curt


On Tue, May 7, 2013 at 11:40 AM, Sebastian Kuzminsky <s...@highlab.com>wrote:

> On May 7, 2013, at 08:43 , Curtis Dutton wrote:
>
> > I have a preliminary WJ200 modbus inverter driver that I've written,
> based
> > upon other modbus drivers I have seen from the VFD wiki page.
> >
> > The source code so far is posted at
> https://github.com/OKComputers/wj200vfd
>
> Awesome!
>
> Some feedback:
>
> You have two commits in a stand-alone repository, it would be easier for
> us to integrate with the main linuxcnc code if your commits were based on
> the linuxcnc git repo at git://git.linuxcnc.org/git/linuxcnc.git (master
> branch).  This would also let you integrate with the linuxcnc build system
> instead of making your own (go.sh).
>
> It looks like you have a .c file that provides interface functions to the
> wj200, a .comp to connect the device to HAL, plus a bunch of .c programs to
> test different parts of the C interface and perform specific actions with
> the wj200.  The .c utils probably don't belong in linuxcnc (their
> functionality should be exported to HAL by the .comp driver).  That would
> let you put the helper functions into the .comp file and simplify your
> build.
>
> The .comp file belongs in src/hal/user_comps.
>
>
> > How do I report an error from user_mainloop? If the driver crashes, or
> > errors out, how do I get the hal to automatically ESTOP and fail.  The
> > usermode comp does not seem to be able to report an error. The behavior
> so
> > far, seems to be that the pins and parameters just dissapear from the hal
> > if the driver exits for any reason.
>
> That is correct.  It's not great, but that's the way it currently is.  The
> way to have a failure of the driver cause an estop is to export a
> 'heartbeat' pin, and connect that to a watchdog component, and have
> watchdog failure cause an estop.  This works mostly, but it's not currently
> well documented or widely used.
>
>
> > Also, when logging information, does the hal watch stdout and stderr and
> > pass information along somewhere? I'm not sure if there is a page
> somewhere
> > that shows me how to do logging.
>
>
> I think if you print to stdout/stderr, it'll show up in the main
> linuxcnc.print and linuxcnc.debug files, respectively.  These live in /tmp,
> and they have random characters appended to the name so they're a little
> awkward to find.  Logging is another area of linuxcnc that's a but wonky
> still…  Looks like you're finding all our shortcomings!
>
>
> --
> Sebastian Kuzminsky
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> _______________________________________________
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to