Hi Guys
This is my first attempt at a brain so the solution to my problem may be human error and immediately obvious to someone. I hope!!!
I am working on my lathes 8 station tool turret which has 4 optical switches used to detect the current tool.
It's logic uses the following truth table
tool position 1 2 3 4 5 6 7 8
switch 1 1 1 1 1 1 1 1 1
switch 2 1 1 1 0 0 0 1 1
switch 3 1 0 0 0 1 1 1 1
switch 4 0 0 1 1 1 1 1 0
The switches are connected via a pokeys and are referenced to INPUT #1 , INPUT #2, INPUT #3, INPUT #4
when I rotate the turret the switch signals seem to follow the truth table pattern ok.
These signals are reflected accurately in both the first column of the brain program
(ie input colours blue/ green change to reflect truth table)
the pokeys status page and the mach3 diagnostics page so (I think) the input signals are fine.
(What I want to do is use a brain program (for speed) to set the current tool position then use a
simpler macro to control tool changes.)
The structure for the program is straight forward and I have attached a photo of my layout.
The problem is the second column of the program does not respond to the changes of the inputs.
ie the immediate compare isn't comparing.
More often than not the immediate compare boxes just retain there initial startup value ( ie blue or green)
very occasionally some will change but with an incorrect result.
I am not entirely convinced than my logic is correct
ie IF input 1 AND input AND input 3 And input 4 are correct then enter tool number into current tool DRO
I am not sure if changing the value in the dro changes the current tool value. I have the feeling that
SetCurrentTool () should be employed somewhere but to simplify the matter and to test the compare function
I have also done a version that removed the last two columns of the program and took out all reference
to current tool and changed it with a simple output 1 .......output8
this would also have benefit of letting me check the results on the diagnostics page
but result was just the same.
Any help would be greatly appreciated as I don't know what to try next.
cheers George
ps I don't know if this is normal or not but if I go into program edit then click on the comparison box
the compare immediate is highlighted but none of the other 3 options are highlighted
ie greater than , less than , or equal to
even though the comparison box shows the equal sign !!!