- Configuring LinuxCNC
- HAL
- custom hal component failed to compile, undeclared (first use in this function)
custom hal component failed to compile, undeclared (first use in this function)
- tommylight
- Away
- Moderator
Less
More
- Posts: 19204
- Thank you received: 6437
18 Dec 2022 20:03 #259850
by tommylight
Hal is the main reason i love LinuxCNC.
Replied by tommylight on topic custom hal component failed to compile, undeclared (first use in this function)
NoooooooI really think hal, should embrace a basic, like YAB or similar.
Hal is the main reason i love LinuxCNC.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
18 Dec 2022 22:29 - 19 Dec 2022 02:15 #259858
by smc.collins
Replied by smc.collins on topic custom hal component failed to compile, undeclared (first use in this function)
C is a great language, but hal is already behaving like a Basic type language. it'd make more sense to have a basic type of syntax in hal. Back to my mess, I can get it to compile, but I still can't get it to work. If someone can explain why this doesn't work, I'd love to hear the explanation. latest source and config.
Last edit: 19 Dec 2022 02:15 by smc.collins.
Please Log in or Create an account to join the conversation.
19 Dec 2022 23:26 #259910
by andypugh
The custom comps _have_ to be C files as they are compiled into Linux kernel modules and C is the only language allowed in the kernel.
Replied by andypugh on topic custom hal component failed to compile, undeclared (first use in this function)
HAL files can be Tcl files, if you want actual code in there.C is a great language, but hal is already behaving like a Basic type language. it'd make more sense to have a basic type of syntax in hal.
The custom comps _have_ to be C files as they are compiled into Linux kernel modules and C is the only language allowed in the kernel.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
20 Dec 2022 01:57 #259920
by smc.collins
Replied by smc.collins on topic custom hal component failed to compile, undeclared (first use in this function)
i got some motion today, sniffing out a logic problem but i think i might be on the correct path now.
any idea why iocontrol doesn't fetch the tool number from the component when homing ???
any idea why iocontrol doesn't fetch the tool number from the component when homing ???
Please Log in or Create an account to join the conversation.
20 Dec 2022 14:12 #259955
by andypugh
Replied by andypugh on topic custom hal component failed to compile, undeclared (first use in this function)
iocontrol sits there waiting to handle specific tool-related NML messages. If it doesn't see any then it doesn't do anything.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
20 Dec 2022 14:24 #259956
by smc.collins
Replied by smc.collins on topic custom hal component failed to compile, undeclared (first use in this function)
wouldn't it make sense to have iocontrol poll for the changer or tool number ??? or provide a path for iocontrol to receive a pocket or tool number at startup, or a way to have a persistent tool state.
is all the tool code in iocontrolv2 or is it spread out everywhere
is all the tool code in iocontrolv2 or is it spread out everywhere
Please Log in or Create an account to join the conversation.
21 Dec 2022 01:06 #259987
by andypugh
You could run a T command in [RS274NGC]RS274NGC_STARTUP_CODE
There are some posts on the forum about persistent tool numbers. But you shouldn't need that for a lathe, as the system knows where the changer is at all times.
Replied by andypugh on topic custom hal component failed to compile, undeclared (first use in this function)
wouldn't it make sense to have iocontrol poll for the changer or tool number ??? or provide a path for iocontrol to receive a pocket or tool number at startup, or a way to have a persistent tool state.
You could run a T command in [RS274NGC]RS274NGC_STARTUP_CODE
There are some posts on the forum about persistent tool numbers. But you shouldn't need that for a lathe, as the system knows where the changer is at all times.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
21 Dec 2022 02:50 - 21 Dec 2022 03:06 #259992
by smc.collins
Replied by smc.collins on topic custom hal component failed to compile, undeclared (first use in this function)
working on that issue of " knowing where the turret is parked" I decided to do a complete rewrite of the component.Let me know if you see any obvious errors. I ran out of time tonight. I got it debugged enough to build. I really don't care for the syntax of C very much, but it is what it is
edit, noticed a misplaced pair of brackets
edit, noticed a misplaced pair of brackets
Last edit: 21 Dec 2022 03:06 by smc.collins.
Please Log in or Create an account to join the conversation.
21 Dec 2022 14:01 #260008
by andypugh
Replied by andypugh on topic custom hal component failed to compile, undeclared (first use in this function)
Your switch statement is malformed. The format is
You don't have the opening and closing brace for the switch, and have the "switch(progress_level)" several times inside itself.
You don't always need, or want, the "break" but it's a good idea to comment a deliberate "fall through" to the next state.
switch(value) {
case 1:
stuff
break;
case 2:
more stuff
break;
default:
default stuff
}
You don't have the opening and closing brace for the switch, and have the "switch(progress_level)" several times inside itself.
You don't always need, or want, the "break" but it's a good idea to comment a deliberate "fall through" to the next state.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
21 Dec 2022 14:46 #260014
by smc.collins
Replied by smc.collins on topic custom hal component failed to compile, undeclared (first use in this function)
default or fault ??
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- HAL
- custom hal component failed to compile, undeclared (first use in this function)
Time to create page: 0.135 seconds