Kirk Wallace wrote: > I agree that Modbus should only be used for non-reatime functions, but I > didn't see anyone suggest to the contrary in the recent posts. I did try > to imply that whatever HAL component is written needs to do what it > needs to do within the time available in the thread that it lives in. I > had trouble with my SPI component due to this. I think just about > everything you would want to with spindle speed and most other I/O can > be done in non-realtime.
I think some confusion is because of your use of the term "thread". EMC and HAL use the term "thread" to specifically refer to a _realtime_ thread with a specific period, but you seem to be using "thread" while talking about a non-realtime component. Realtime HAL components export functions, and those functions are linked into realtime thresds. Each function in a HAL thread runs one after another, and all of them _must_ be complete before the next time the thread is due to run. Non-realtime HAL components do not export functions. A non-realtime HAL component is an ordinary Linux process. It has its own memory space and runs just like any other user space program. It has no restrictions about calling blocking functions. It can use read(2) and write(2) to access files (including /dev files). It can use select(2) with or without timeouts. It can use sleep(3) if it wants to poll HAL pins periodically. And it can use normal Linux drivers for things like the serial port. Such a component will _usually_ be quite responsive, but response times are not guaranteed. Spindle control was mentioned as a use case - that would be fine for normal milling, but I wound not use it for rigid tapping. EMC issues a command to reverse the spindle as the tap approaches the bottom of the hole. A user space HAL component would probably send that command to the spindle drive quickly 99% of the time, but it only takes one time with a half-second delay to break a tap. Regards, John Kasunich ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
