Arduino I/O with Linuxcnc
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
Attachments:
Please Log in or Create an account to join the conversation.
This is just as old, but might work better: emergent.unpythonic.net/01198594294
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
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.
You do not have to worryI hope there are no problems caused by removing that line.
Source: Mex: forum.strojirenstvi.cz/viewtopic.php?t=3...ingleton+yes#p384233Singleton 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.
Please Log in or Create an account to join the conversation.