- Hardware & Machines
- CNC Machines
- Turning
- Small victory in the war against the Cincinnati cinturn 12u
Small victory in the war against the Cincinnati cinturn 12u
I thought that I had explained this, but the HAL file is read only once, at the beginning.So, Hal reads and executes the file how often ? Is it a single loop subroutine ? or a single loop open ended main routine with a need for a callback to start ?
All the HAL pins are connected up as defined by the net commands (if you are interested, all that really happens is that the internal variables of the C-code that defines the functions internally that are part of the same net are moved into the same memory address. So a variable called "out1" of one bit of code will have the exact same memory address as the pins "in2" and "latch" (for example) of other bits of code)
Then, every SERVO-THREAD period all the functions that have been "addf-ed" to the SERVO-THREAD are executed in strict one-by-one sequence.
Each component reads its inputs, does it's internal thing, and updates its outputs. Then the next function is executed.
The same is true of BASE-THREAD.
Some components have more than one function, for example the software stepgen has a very fast, integer-only BASE-THREAD function to create pulses and a more complicated one that runs in the SERVO-THREAD to calculate the required step rate.
And the Mesa driver has separate READ and WRITE functions, so that all inputs are read at the start of the thread cycle, and all outputs are updated at the end.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
-
- Posts: 660
- Thank you received: 113
net.toolchange,output is a run once, or it runs on every call to M6 , does it store the variable of the tool number somewhere in hal or do I have to declare the storage or is it part of the component.
Is there a way to fetch without grep the commands in each component or better to just read the C file?
Also is the carousel component called on every m6, or just each time through the main hal routine ? just trying to wrap my head around how the program works, my mind needs to connect things like virtual physical blocks with a label assigned to each block. sounds weird but I see things as complex interacting machines as mental visual images. So I will often design a part in my head before I begin making it. that's why most of the tutorials are useless until I see the code as the parts and how they interact as functional mechanisms and I can label them. at some point it'll hopefully just click
Please Log in or Create an account to join the conversation.
net.toolchange,output is a run once, or it runs on every call to M6 , does it store the variable of the tool number somewhere in hal or do I have to declare the storage or is it part of the component.
Components can store their own internal data, they are just small programs.
Is there a way to fetch without grep the commands in each component or better to just read the C file?
Components don't have commands. They only have inputs and outputs. (which are just numbers)
Also is the carousel component called on every m6, or just each time through the main hal routine
carousel sits there, generally doing nothing. Every thread cycle it checks to see if the "enable" input pin has gone high. If it has, and if the pocket-number pin has a different number to what the feedback sensors are telling it, then it enters a different state, and outputs a motor command on an output pin.
Then, when the position feedback input pins tell it that it is in the right place, it turns off the motor controls pins, signals "ready" and goes back to waiting.
So, the only way that caraousel knows that there is a tool change going on is generally when the iocontrol.0.tool-change pin goes high. (And that _is_ directly controlled by the M6 command)
Please Log in or Create an account to join the conversation.
To see the pins and functions of any hal component, either use "man name" at the command line (eg, "man carousel")
Or, more legibly and less geekily, look in the web docs:
linuxcnc.org/docs/stable/html/
The realtime and userspace components are all listed at the bottom.
There are many of them, and it's possibly worth a _very_ superficial skim through them to get a feel for what they do.
Most are very simple. motion is very complicated (it's the entire motion controller).
The main ones to look at for everyday reference are motion, halui and io.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
-
- Posts: 660
- Thank you received: 113
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
-
- Posts: 660
- Thank you received: 113
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
-
- Posts: 660
- Thank you received: 113
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
-
- Posts: 660
- Thank you received: 113
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
-
- Posts: 660
- Thank you received: 113
Please Log in or Create an account to join the conversation.
- Hardware & Machines
- CNC Machines
- Turning
- Small victory in the war against the Cincinnati cinturn 12u