Hmm, some progress.
I now have the macro pump updating the A axis DRO nicely, calibrated the display, got sensible data showing. The +Index pulse only needs to go low once after Mach comes out of reset each time.
Anyway, next issue seems to be that the macro code will not write to the tool table anymore?
Here's the button code, basically a hacked-down version of a previous attempt but one which did update the table ok.
It's not just writing a zero, i tested it by changing the DRO value with a fixed number and it would not write that either.
Sub Main()
Dim Response, Style, Tool
Style = 48
If GetOemLED(800) Then
Response = MsgBox ("Mach In Reset, Enable And Start Again", Style, "Tool-Height Setting")
End
End If
Style = 65
Response = MsgBox ("Ensure Toolsetter Is Empty, Reading Is Zero, Place Tool In Setter", Style, "Tool-Height Setting")
If Response = 2 Then End 'user pressed cancel
Tool = Question("Enter Tool Number For This Offset, Enter -1 To Abort")
If Tool = -1 Then End
Code "G90" & "G10" & "L1" & "P" & Tool &"Z" & GetOEMDRO(803)
DoOemButton(121) 'show the tooltable
Style = 64
Response = MsgBox ("Tool No." & Tool & " Height Set", Style, "Tool Height Setting")
End Sub
Feet were aching a bit by now so i gave up without trying a PC reboot, will be back on the case in the morning but is there anything that can stop the code updating the table??
Also, when writing to the tool table in code then loading it via DoOEMBUTTON(121) why doesn't the new value show up, if you close and reload it it shows?? This was when it was working BTW.