Arduino I/O with Linuxcnc

More
10 Oct 2020 11:55 #185595 by zz912
Replied by zz912 on topic Arduino I/O with Linuxcnc
Hello,

I am trying use your code, but I can not compile it:
cnc@LinuxCNC:/usr/share/linuxcnc/src/hal/components$ halcompile --compile serialreceive.comp
gcc -I/usr/include -I/usr/include/linuxcnc -URTAPI -U__MODULE__ -DULAPI -Os  -o serialreceive /tmp/tmpT2HXKd/serialreceive.c -Wl,-rpath,/lib -L/lib -llinuxcnchal 
/tmp/tmpT2HXKd/serialreceive.c: In function ‘__comp_parse_count’:
/tmp/tmpT2HXKd/serialreceive.c:79:13: error: ‘count’ undeclared (first use in this function)
             count = strtoul(&argv[i][6], NULL, 0);
             ^~~~~
/tmp/tmpT2HXKd/serialreceive.c:79:13: note: each undeclared identifier is reported only once for each function it appears in
/tmp/tmpT2HXKd/serialreceive.c: In function ‘__comp_parse_names’:
/tmp/tmpT2HXKd/serialreceive.c:106:17: error: ‘names’ undeclared (first use in this function)
                 names[j] = strtok(p, ",");
                 ^~~~~
Makefile:2: návod pro cíl „serialreceive“ selhal
make: *** [serialreceive] Chyba 1

Could you help me somebody please? I am programmer beginner.

Thank you

File Attachment:

File Name: serialreceive.c
File Size:7 KB

File Attachment:

File Name: serialreceive.comp
File Size:3 KB
Attachments:

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

More
10 Oct 2020 14:04 #185604 by andypugh
Replied by andypugh on topic Arduino I/O with Linuxcnc
This is a very old thread, much of it is likely to be out of date.

This is just as old, but might work better: emergent.unpythonic.net/01198594294

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

More
10 Oct 2020 14:50 #185606 by zz912
Replied by zz912 on topic Arduino I/O with Linuxcnc
Thank you for link, but I am not friend with Python. I want use ArcEye's code for a template. I would like make own code for Arduino and own component for LinuxCNC.

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

More
11 Jan 2021 20:05 #194947 by bondglen
Replied by bondglen on topic Arduino I/O with Linuxcnc
I am having the same problem. My code will compile fine with an older system, but when I upgraded it no longer compiles. I still have an old system to compare to.
I think this is a compiler problem that is not related to hal or linuxCNC.

If anybody has any suggestions, I would like to hear them.

Thanks

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

More
11 Jan 2021 20:49 #194953 by zz912
Replied by zz912 on topic Arduino I/O with Linuxcnc
You should try remove "option singleton yes;" from source code.

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

More
13 Jan 2021 01:27 #195163 by bondglen
Replied by bondglen on topic Arduino I/O with Linuxcnc
That did the trick.
It compiles fine now.
I hope there are no problems caused by removing that line.

Thanks.

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

More
13 Jan 2021 07:38 #195193 by zz912
Replied by zz912 on topic Arduino I/O with Linuxcnc

I hope there are no problems caused by removing that line.

You do not have to worry

Singleton means that only one component can run. Otherwise, it is generally possible to load components in multiple instances.
The singleton then has no instance number in the signal name, because it is the only one possible.

So a normal component has eg serialreceive.0.bit-14,
singleton should eg serialreceive.bit-14.

Source: Mex: forum.strojirenstvi.cz/viewtopic.php?t=3...ingleton+yes#p384233

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

Time to create page: 0.071 seconds
Powered by Kunena Forum