Understanding hal components/pins
His component creates pins that the only use for them is to connect hardware connections to. I'm using a Mesa 7i76e, and the way I understand it Hostmot2 is a driver or component for the board that is like the lowest layer that the board can be addressed at. It creates the pins for the physical connections as well as counters and stuff that is interpreted.
So where I get lost is AFAIK you can only connect a pin to a signal, you can't connect 2 pins together. So what is the purpose of a pin in a component if the actual hardware pin already has a HAL pin? Component creates signal, connects to component pin, but can't connect directly to the HM2 pin? The only way I see that working is if there was another signal connected in between. If that's the case is the signal just something that's made up and only exists in that hal file? Or am I completely misunderstanding this?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
Hal pins and component pins, hardware driver pins (in hal), Hostmot2 pins and HM2 pins, are all the same thing. They are all Hal pins.
Hal pins are created by components (programs). These are either "real time" or "user space" programs.
The Hostmot2 driver is a real time component that connects the Mesa hardware to Hal via the Hal pins it creates.
Pins in HAL are connected together by signals.
Yes, Signal names are just arbitrary names for the connections between hal pins. A new signal is created by hal every time a net command with a new signal name is listed in the hal file or net command in a Halcmd prompt.
Please Log in or Create an account to join the conversation.
This convention is standard in schematic capture/ netlist/EE field so its not surprising that it is done this way
since LinuxCNCs HAL was created by a EE
Sometimes I do think it might be nice to have anonymous signals generated if you connect two or more hal pins
with no signal specified. This would avoid having to make up signal names for say intermediate terms in
complex multi-component hal constructions. Schematic capture programs do this with unnamed wires
( generate non-colliding but normally hidden names like $$$1234 )
Please Log in or Create an account to join the conversation.
Hal pins are created by components (programs). These are either "real time" or "user space" programs.
The Hostmot2 driver is a real time component that connects the Mesa hardware to Hal via the Hal pins it creates.
Well the programmer was asking for actual pin names/designations (which I already sent to him just cuz). All I kept thinking is that he's under the impression that it's like an arduino or similar microcontroller that you write a program in C+ for and compile it to machine code with the IDE. I know the hm2.0.whatever.00... is just another software pin but I was just trying to affirm that this is as close to the actual pin as you get in HAL.
The thing that's really been throwing me off is that since I'm NOT a programmer, but from time to time have to modify a C+ or Python program you look for the rule that exists around this "signal". Like loading components and adding functions are usually placed at the top of the HAL file. So I look for a signal to be defined somewhere in the file and it's not. Then I realize "oh......it's just made up on the fly and you can carry it around". I realize some rules exist and some signals come from components.....which made sense but it threw me off when I was trying to figure out where random signals came from with no explanation.
I've heard that hal was designed by electrical engineers. On an electrical drawing it's obvious that somebody drew it, and thought up a name or number for that wire.....though it's not always intuitive. When I look at a hal file I'm looking for these signals to be defined or referenced to something. Makes a lot more sense when you know that's not the case.
Please Log in or Create an account to join the conversation.
All signals are created by net commands ( or the obsolete newsig command )
So the basic hal file connection rules are that components make pins and the net command allows you to link
pins from component to component. Pins linked by a signal must be of the same type.
You could use completely arbitrary names for all the signals in a hal file or set of hal files and it would function properly
( though it might be quite difficult to read )
Please Log in or Create an account to join the conversation.
they say to think of the signal as a wire but it's placement in the line and the name signal isn't really intuitive.
They should just call it a wire, or conduit or something. if it went between pins it would "look" more obvious.
The EE's probably intended each signal to be named like "A103" or "2103", something you'd see in an electrical drawing labeling a wire.
Please Log in or Create an account to join the conversation.
This makes for a very modular approach to customisation and if one component crashes, the others should not be affected.
Please Log in or Create an account to join the conversation.
i tried these
net program-start-btn halui.mode.auto and2.0.in0 <= <your input pin>
net program-run-ok and2.0.in1 <= halui.mode.is-auto
net remote-program-run halui.program.run <= and2.0.out
but it says pin is not defined
will you kindly elaborate where to paste those line and why the and2 component doesnt loading pins
Please Log in or Create an account to join the conversation.
not to the main HAL
as it is POSTGui after Linuxcnc has loaded the mashine
1000times per second reding the Button
so folow tha advice in the other post you opend
please
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.