Wrapper command for hal_ready() in haltcl?

More
14 Apr 2017 06:22 - 14 Apr 2017 06:25 #91344 by screwtop
I'm having a go at writing a userspace Modbus component in haltcl, and can't find how to call the C layer's hal_ready() function - the "hal" Tcl command doesn't seem to expose it. As a result, LinuxCNC just waits for the component, even though it's running. I realise I can run loadusr without -W, but I'd like to try to do this "properly". :)

Similarly, should userspace components call hal_exit() before they end?
Last edit: 14 Apr 2017 06:25 by screwtop. Reason: Clarified that this is a userspace/non-RT component

Please Log in or Create an account to join the conversation.

More
15 Apr 2017 09:56 #91403 by screwtop
I get the impression from further reading that haltcl is really just intended for use at setup time, allowing programmatic constructs like calculations and loops in machine definitions. However, is there any reason not to use it for building a non-realtime component? From my testing so far it seems to work just fine - you can set up and tear down signal connections and set values that are received in LinuxCNC via HAL - and there seem to be other components out there written in scripting languages. Tcl's event handling, exceptions, channels (serial), and SQLite binding are making this fairly straightforward to put together. :)

Please Log in or Create an account to join the conversation.

More
15 Apr 2017 11:20 #91407 by bkt
sorry ... but in hal is quite hard to make a if statement for example (hard when compared with c/c++ ... ) ... but if you are usual to Tcl you can try ... write my rtuserver.com = 10min .... understand the right use and sequence of Lcnc command 3 year... and he's still learning ...
So I do not think that the language to be used is the main problem.

Regards
Giorgio

Please Log in or Create an account to join the conversation.

More
15 Apr 2017 11:27 #91408 by bkt
:lol: :lol: :lol:

I not read these post .... hal if clause ....

Any how using Tcl instead C/C++ maybe a good exercices and nice ... I do not think I will ever have time for this ..

Regards
Giorgio

Please Log in or Create an account to join the conversation.

More
19 Apr 2017 16:09 #91645 by andypugh

I'm having a go at writing a userspace Modbus component in haltcl, and can't find how to call the C layer's hal_ready() function


An interesting question. And one that you might have to ask on the developers mailing list to get an answer to.

Looking in the existing Tcl files, only one of them contains the word "ready" and not in this context:
github.com/LinuxCNC/linuxcnc/search?l=Tc...type=&utf8=%E2%9C%93

So it isn't looking promising.
The following user(s) said Thank You: screwtop

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum