Include New Library For own Hal-Componet

More
5 years 8 months ago #199929 by TheRoslyak
Hi everyone
Can someone tell you step by step how to import a library to create a new hal component. Or if it's not difficult to write a guide for dummies. What to put in what folders and etc.
The example requires using the SQLite library. or simpler Stdio

Please Log in to join the conversation.

More
5 years 8 months ago #199962 by rodw
Code:
halcompile --install mycomp.comp
You may need to use sudo if not run in place

But calling SQL from within a real time environment that has to execute every one millisecond is a really bad idea. It can't work.

It needs to be called from user space (probably in python) where its not real time

Please Log in to join the conversation.

More
5 years 8 months ago #200014 by TheRoslyak
I didn't mean it.
I meant how can I import my library (for example SQLite)
Now If now I just write #include <sqlite.h> - then I get an error.
I just don't know how to put it in the right folders. sqlite.h & sqlite.c in derectory Linuxcnc-dev.
I will explain what I want to implement:
The data that is written to the database appears after the camera is detected object.
Objects appear as the conveyor moves. I want to calculate where this object will be located after some time.
To do this, I attach an encoder and find the real position of the object

Please Log in to join the conversation.

More
5 years 8 months ago #200029 by tommylight
Not LinuxCNC related, but it does apply to what you need done:

He has many more of those videos.

Please Log in to join the conversation.

More
5 years 8 months ago #200061 by Mike_Eitel
Yes a very clever guy..
And consider how precise he is able to position the stock via "cables"

Please Log in to join the conversation.

More
5 years 8 months ago #200469 by andypugh

TheRoslyak wrote: I didn't mean it.
I meant how can I import my library (for example SQLite)
Now If now I just write #include <sqlite.h> - then I get an error.


To include a library in a .comp you need to use the "include" command above the ;;

"include" is a halcompile directive which puts the "#include" in the right place in the generated C file.

linuxcnc.org/docs/2.8/html/hal/comp.html#_syntax

Please Log in to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum