Ok was in a bit of a rush when I wrote that and see that would not be the best for a vacuum table if wanting to operate from G code.
So what you would do is have two custom macros, one to switch on, the other off.
So say m123.m1s for On, that would have
SetOutBit(90,0)
SetUserLED(1111,1)
Now m124.m1s for off, it would have
ReSetOutBit(90,0)
SetUserLED(1111,0)
In either macro there is no need to look at the UserLED state as you are switching on or off from the macros regardless and it doesn't matter if it is already on and you call m123 or already off and you call M124.
Now say you wanted to check from the M6 macro and turn it off if on then all you would do is have the VB to look at the LED state and if On then turn the output off and set the LED off, so
If GetUserLED(1111) = 1 Then
ResetOutBit(90,0)
SetUserLed(1111,0)
End If
Then if further on in the macro you wanted it switched back on you would have
If GetUserLED(1111) = 0 Then
SetOutBit(90,0)
SetUserLED(1111,1)
End If
Now for the screen button, you could have two separate buttons and set them as G Code buttons and have code "m123" in the On button and Code"m124" in the off button, same with panel buttons.
However with the buttons themselves it will likely make more sense to have them toggle buttons so you would just set the screen button as a VB button and have the code in the previous post in the button.
Same with the macropump looking at the physical buttons input.
So basically the problem you encountered with the coolant was because you had it set in Mach as Machs coolant where the vacuum is set via VB in all cases, so nothing will force it back on if switched off via VB and vice versa. The only important thing you need to remember is that from any VB you wish to control it from that you also remember to set the state of the UserLED accordingly.
Hood