JR1050 wrote:net AUTO_MODE halui.mode.is-auto
This might not be doing what you want. This creates a HAL "signal" called AUTO_MODE, but that is not the same as the AUTO_MODE "pin" that is created by your .comp component, which is called buttonlogic.0.AUTO_MODE.
In the declaretion section of my first comp file(which at this time is named buttonlogic.comp)which is the logic for that pushbutton,I have this..
pin in bit PB_CYL_START;
This will create a HAL "pin" called buttonlogic.0.PB_CYL_START, to use that in your HAL file you will need something like:
net pb_cyl_start_signal buttonlogic.0.PB_CYL_START <= hm2_5i20.gpio.049.in_not
This creates a HAL "signal" called pb_cyl_start_signal (you can use any name you like) which follows the value of the output pin to which it is assigned (hm2_5i20.gpio......) and writes that value to any input pin to which it shares a "net" command, in this case buttonlogic.0.PB_CYL_START.
And in the same file I am attempting to use the bit like so
if(((PB_CYL_START)==1)&&((AUTO_MODE)==1||(MDI_MODE)==1))
RUN_PROGRAM=1;
I am confused when you say "in the same file". The line above is C / .comp syntax, but "net" commands are HAL file syntax.
I think that the logic above belongs in your .comp file, and the HAL file should just be "net"-ing the RUN_PROGRAM HAL pin to a physical output pin.
You _can_ do that sort of logic in HAL, but that involves netting together a bunch of and2 and or2 HAL components (which are written in .comp)
Incidentally, that line would work just as well as:
if (PB_CYL_START && (AUTO_MODE || MDI_MODE )) RUN_PROGRAM=1;
In fact this is better, as "TRUE" parport pins in HAL simply have a non-zero value, not necessarily 1. (hm2 gpio pins are always 1 == true, though)