> -----Original Message-----
> From: Les Newell [mailto:[email protected]]
> Sent: February-17-20 11:23 AM
> To: [email protected]
> Subject: Re: [Emc-users] RPI4 is pretty close to a decent machine control
> solution...
>
>
> > I've done something similar for a client with a PiZeroW that took 18 seconds
> to boot but the logging of CAN messages was required on power up. I ended
> up using a PIC32 since it had enough RAM and it also used a SPI interface to
> transfer data once the Pi was awake and ready to talk. Even Python on the Pi
> was way too slow to keep up with the data so the Pi Code was C. The PIC32
> code was C.
>
> Well, you have programmed a Pi in C using SPI. Arduino uses C/C++ you
> should be pretty comfortable having a go at making your own LinuxCNC
> step module.
Can't stand Arduino development environment or that you can't do breakpoints
and look at what the processor is doing. Handy for quick little projects but
every single Arduino library I've used for LED lighting control tends to reset
or halt sometime after it's been running. With no clue as to why.
Ran into a similar problem with a Python program on a Pi Using the Enviro+
module I thought would be ideal for some sensing applications I had in mind.
About 7 hours in it throws out a memory pointer error. This is from inside a
python SPI library. Not a lot of use for either Python nor Arduino.
Autonomous garbage collection at inopportune times is the bane of real time
software.
Writing your own hal modules is pretty easy. Take a look at
> the documentation for halcompile
> <http://linuxcnc.org/docs/html/hal/comp.html>. Halcompile does a lot of
> the hard work for you.
>
Thanks. I'll take a look.
>
> > If you consider that LinuxCNC, (and so many of the other Linux
> applications) which are done by volunteers, likely have Completion time set
> as the principal goal. After all, they have busy lives and have other
> interesting things to do too so finishing and getting it out there as quickly
> as
> possible certainly makes sense.
>
> Not really. LCNC's source is reasonably well documented. The LinuxCNC
> core developers are unlikely to accept submissions that are difficult to
> understand. Generally it is more a case of people working on things that
> they need or they are particularly interested in. For instance I needed
> a carousel tool changer module for two of my machines. I couldn't find
> anything in LCNC that suited so I wrote one. After tidying it up a bit
> and documenting it I submitted it to be added to LCNC.
>
> Les
>
Here I think we disagree in a major way. LinuxCNC writing guideline
specifically states that functions should be small and not have any
documentation in them. The idea that if you need to explain what you are doing
then it's too complicated. Yeah right. So flipping back and forth through
files reading 20 different 4 line functions is a better solution? In
reality, someone working for me writing code the way it's done for Linux
wouldn't be employed by me for very long.
I agree this is pretty crappy documentation
TempVar = OtherTempVar + 5; // Add 5 to OtherTempVar and store to TempVar
and best not even put in the code.
TempVar = OtherTempVar + 5;
This is better but doesn't explain much.
tempPositionIndex = LocalPositionIndex + TABLE_RECORD_SIZE;
This is best because it says 'why' not 'what'.
tempPositionIndex = LocalPositionIndex + TABLE_RECORD_SIZE; // adjust index
to access the next passed parameter
Upper case on Local says it's static or Global and holds the value between
invocations. Lower case on temp says it's local variable that is not static.
Upper case on constant tell us it's not a variable. This could also be a
sizeof(T_TABLE_RECORD) depending on what's going on under the covers.
Most of the LinuxCNC code I've looked at falls into the second example except
the variables are c,I, j,j, etc. and say even less.
The moment you have to page to another file or section of a document you've
failed.
IMHO.
And I know many who disagree with me.
John
>
>
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users