ini to HAL communication

More
29 Mar 2021 02:44 #203974 by clive
I have two questions. One is conceptual and the other very specific.

The conceptual one first. What is the information linkage between the ini file and the HAL file. I'm hand editing these, BTW. The ini file refers to [JOINTS] and the HAL file obviously defines the signal at a hardware level (in my case printer port pins). The ini file describes things at a higher, generic level. The HAL file is just wiring. However, I don't see any variables that link these. I'm puzzled.

The specific question. I have a router that is turned on/off with a relay. I've used the M03/M04 and M05 G-Codes in the past with MACH3 and the arrangement worked, the relay is controlled via pin 17 on the parallel port. I put some code in the HAL file to activate that pin.

net spindle-enable spindle.N.on => parport.0.pin-17-out

Is the variable spindle-enable a fixed name for the spindle? Are all the names in the HAL file reserved, fixed names? I'm a programmer, I'm used to writing my own variable names...

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 04:02 #203977 by cmorley
Replied by cmorley on topic ini to HAL communication
The INI file is a list of import information that any program in linuxcnc can read.
ie HAL can read the INI for settings or names.
or the motion component can read the INI and export extra HAL pins based on the information it finds.

in your example 'spindle-enable' is a signal name. Signal names are user defined.

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 08:03 #203990 by Clive S
Replied by Clive S on topic ini to HAL communication

net spindle-enable spindle.N.on => parport.0.pin-17-out

Is the variable spindle-enable a fixed name for the spindle? Are all the names in the HAL file reserved, fixed names? I'm a programmer, I'm used to writing my own variable names...


The first name after a NET is a signal and can be anything you like. The signal is then connected to HAL pins

linuxcnc.org/docs/2.8/html/hal/intro.html

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 14:51 - 29 Mar 2021 15:08 #204046 by clive
Replied by clive on topic ini to HAL communication
So is the spindle.0.on identifier a reserved, fixed name? I'm trying to understand how the information flows from an M03 G-Code command through to a parallel port pin.

I had imagined that the ini file would act as a level of indirection between the conceptual and the physical. The physical being defined in the HAL file. Perhaps not?

My thought was that variables would be defined in the ini file and that the HAL file would associate the ini variables with physical devices. So that the signal spindle-enable would be defined in the ini file and then associated with pin 17 by a reference in the HAL file?

In my, probably mistaken, conception the ini file would define things that are entirely machine independent and only the HAL file would be machine specific.
Last edit: 29 Mar 2021 15:08 by clive.

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 15:12 - 29 Mar 2021 18:37 #204053 by Aciera
Replied by Aciera on topic ini to HAL communication

So is the spindle.0.on identifier a reserved, fixed name?


Yes that is a HAL Pin that is defined. Although it doesn't seem to be a valid hal-pin in version 2.8:

linuxcnc.org/docs/2.8/html/man/man9/spindle.9.html


Once you run LCNC the system will check if the hal-pins used in HAL are actually available and abort with an error if it comes across a missing pin.

In my, probably mistaken, conception the ini file would define things that are entirely machine independent and only the HAL file would be machine specific.


Roughly the ini file defines values and paths while the hal file defines signals and their connections.
Last edit: 29 Mar 2021 18:37 by Aciera. Reason: WRONG MAN PAGE!
The following user(s) said Thank You: clive

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 15:26 #204057 by cmorley
Replied by cmorley on topic ini to HAL communication
in master branch 'spindle.0.on' is a reserved pin name but you could actually still use it as a signal name -but I don't recommend doing that.

m3 is interpreted by the rs274 interpreter which sends a NML message to the motion component to set the spindle HAL pin appropriately.

linuxcnc.org/docs/devel/html/code/code-n...rchitecture_overview

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 15:31 #204059 by clive
Replied by clive on topic ini to HAL communication
The document says:

spindle.N.enable bit in -- If FALSE, the spindle is stopped at the gear’s maximum deceleration

So I presume N is a number that identifies which spindle on a machine that might have more than one. However, the M03 code is specifically associated with spindle.0.enable and not any possible others?

I know I'm asking theoretical questions but I'm simply trying to grasp the information flow.

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 15:33 #204061 by cmorley
Replied by cmorley on topic ini to HAL communication
mo3 defaults to spindle 0
are you looking at the correct docs for master?
linuxcnc.org/docs/devel/html/gcode/m-code.html#mcode:m3-m4-m5
The following user(s) said Thank You: clive

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 15:39 #204062 by Aciera
Replied by Aciera on topic ini to HAL communication
With the introduction of multiple spindle support M03 can be used together with an additional '$' argument that defines spindles other than 0.

linuxcnc.org/docs/html/getting-started/u...iple_spindle_support
The following user(s) said Thank You: clive

Please Log in or Create an account to join the conversation.

More
29 Mar 2021 16:55 #204069 by clive
Replied by clive on topic ini to HAL communication
I'm now at my actual machine.
I get an error message when LinuxCNC 2.8.1 starts up that the pin spindle.0.enable doesn't exist .

Please Log in or Create an account to join the conversation.

Time to create page: 0.118 seconds
Powered by Kunena Forum