Schaublin 125-CNC retrofit.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1584
- Thank you received: 581
30 Mar 2026 16:09 #344959
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Hi Andy,
I got the Schaublin updated to Trixie and 2.9.8.
I really like the update you did to the look and button layout of Lathe macros. Thanks.
I was trying to work out how to address not having any feedback on the turret arriving in position. Because I am a shit programmer, I tried Chat GPT yesterday.
This is the set of requirements I gave:
The AI summary is rather accurate.
After a couple of back and forth, adding requirements, and accepting some AI suggestions, the result is the attached files.
Scary good how fast and efficient this is for a small project with very limited requirements, and how well it documents and explains the code. It would have taken me a few evening to get to this level, and my code would have been a mess of half-arsed work-around to avoid the gaping holes in my programming knowledge.
It failed to compile yesterday, due to some unknown character. I suspect the apple text editor has added some hidden ascii code. The attached files I cut paste into a different text editor. Off to test them now.
Cheers,
Mark
I got the Schaublin updated to Trixie and 2.9.8.
I really like the update you did to the look and button layout of Lathe macros. Thanks.
I was trying to work out how to address not having any feedback on the turret arriving in position. Because I am a shit programmer, I tried Chat GPT yesterday.
This is the set of requirements I gave:
The AI summary is rather accurate.
After a couple of back and forth, adding requirements, and accepting some AI suggestions, the result is the attached files.
Scary good how fast and efficient this is for a small project with very limited requirements, and how well it documents and explains the code. It would have taken me a few evening to get to this level, and my code would have been a mess of half-arsed work-around to avoid the gaping holes in my programming knowledge.
It failed to compile yesterday, due to some unknown character. I suspect the apple text editor has added some hidden ascii code. The attached files I cut paste into a different text editor. Off to test them now.
Cheers,
Mark
Please Log in or Create an account to join the conversation.
- RotarySMP
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1584
- Thank you received: 581
30 Mar 2026 18:01 #344964
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Okay, now I am understanding the pain of AI. I went in circles with compiling errors and format.
Now it compiles, but I get
hal:turret:1: character unknown ' '
and the invisible character search didn't turn up anything.
Any ideas what I have wrong in this comp appreciated...
Now it compiles, but I get
hal:turret:1: character unknown ' '
and the invisible character search didn't turn up anything.
Any ideas what I have wrong in this comp appreciated...
Please Log in or Create an account to join the conversation.
- JacobRush
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
30 Mar 2026 20:19 #344971
by JacobRush
Replied by JacobRush on topic Schaublin 125-CNC retrofit.
I asked my imaganiry AI friend to take a look at it thusly:
"A friend of mine is trying to get a custom linuxcnc HAL component up and running and he's getting an odd runtime error of "hal:turret:1: character unknown ' '"
The documentation for hal stuff is here:http://linuxcnc.org/docs/html/hal/comp.html take a look and see if you see anything out of place."
While sending the comp file along.
The replies seem pretty reasonable:
I see two issues:
1. The actual error (line 1) — almost certainly smart quotes
The "character unknown ' '" error on line 1 means the halcompile lexer is hitting a byte it doesn't recognize. Line 1 has a doc string:
component turret "4-position pneumatic...";
Those " " quotes are probably Unicode smart/curly quotes (U+201C/U+201D) instead of plain ASCII double quotes (U+0022). Super common when the file was written or pasted through a rich text editor, Google Docs, macOS Notes, Word, etc.
Fix: Have him run this to check:
cat -A turret.comp | head -1
If he sees M-bM-^@M-^\ or any multi-byte sequences where the quotes are, that's the culprit. Replace all smart quotes with plain ASCII " quotes. Quick fix:
sed -i 's/[\xe2\x80\x9c\xe2\x80\x9d]/"/g' turret.comp
2. Secondary bug — FUNCTION name mismatch
He declared function _; (underscore = unnamed/default) but then used FUNCTION(turret) in the C section. Those have to match. Should be either:
FUNCTION(_) {
Or better yet since it's a single-function component, just skip the FUNCTION() wrapper entirely and put bare C after ;; — like the ddt example in the docs.
3. Minor — int diff inside switch/case
case 0:
...
int diff = target - position;
Declaring a variable inside a case without braces can choke some C standards. Wrap it:
case 0: {
...
int diff = target - position;
...
break;
}
The smart quotes are almost guaranteed to be the "character unknown" error. The FUNCTION mismatch will bite him right after he fixes that.
"A friend of mine is trying to get a custom linuxcnc HAL component up and running and he's getting an odd runtime error of "hal:turret:1: character unknown ' '"
The documentation for hal stuff is here:http://linuxcnc.org/docs/html/hal/comp.html take a look and see if you see anything out of place."
While sending the comp file along.
The replies seem pretty reasonable:
I see two issues:
1. The actual error (line 1) — almost certainly smart quotes
The "character unknown ' '" error on line 1 means the halcompile lexer is hitting a byte it doesn't recognize. Line 1 has a doc string:
component turret "4-position pneumatic...";
Those " " quotes are probably Unicode smart/curly quotes (U+201C/U+201D) instead of plain ASCII double quotes (U+0022). Super common when the file was written or pasted through a rich text editor, Google Docs, macOS Notes, Word, etc.
Fix: Have him run this to check:
cat -A turret.comp | head -1
If he sees M-bM-^@M-^\ or any multi-byte sequences where the quotes are, that's the culprit. Replace all smart quotes with plain ASCII " quotes. Quick fix:
sed -i 's/[\xe2\x80\x9c\xe2\x80\x9d]/"/g' turret.comp
2. Secondary bug — FUNCTION name mismatch
He declared function _; (underscore = unnamed/default) but then used FUNCTION(turret) in the C section. Those have to match. Should be either:
FUNCTION(_) {
Or better yet since it's a single-function component, just skip the FUNCTION() wrapper entirely and put bare C after ;; — like the ddt example in the docs.
3. Minor — int diff inside switch/case
case 0:
...
int diff = target - position;
Declaring a variable inside a case without braces can choke some C standards. Wrap it:
case 0: {
...
int diff = target - position;
...
break;
}
The smart quotes are almost guaranteed to be the "character unknown" error. The FUNCTION mismatch will bite him right after he fixes that.
Please Log in or Create an account to join the conversation.
Moderators: piasdom
Time to create page: 0.513 seconds