Thanks Stirling. I responded in the other post. You helped a lot. Got me on the path early on. Thanks,
So here is what I learned on the coolant.
There does not seem to be a way to monitor the outputs on the cslabs. Not directly anyway.
So, I had this.
If OEMLED(13) Then
Coolant=1
ReSetOutBit(90,2) 'coolant pump output
Else
Coolant=0
End If
So what happened here when the coolant was on is that my code works except Mach is apparently Setting the coolant ON over and over and over. So my Resetoutbit probably did work but Mach immediately turned it back On in its next communication with cslabs.
So simply replacing the ResetOutbit(90,2) with Code "M9" works perfectly well. Or doing the OEMButton. Exactly as Hood said. Its interesting to me anyway, that Mach constantly sends a SetOutBit to the controller. I would think that is the kind of thing that creates a lot of overhead in communications and speed. Or maybe thats not what's happening at all.
I want to figure out how to read the outputs if it is possible. I think the issue with Coolant is that Mach knows what that is, there is an OEMbutton/Led and Mach has control over it. I am wondering if I can simply use the UserLED's and turn them On and Off with the actual output that I map to it. For instance
SetOutBit(90,25) ' turn on my shop vacuum system
SetUserLed(1025,1) ' LED 1025 is now set to 1
.
.
ResetOutBit(90,25) ' Turn vac off
SetUserLed(1025,0)' Led 1025 is now set to 0
Then anywhere else I want to check on a particular output, I just Get the value in that UserLED. Only trick is to be sure you always change the USERLED when ever Output is changed. And avoid outputs that Mach has been configured to control. Will also need to know what happens to UserLed on Mach Startup. If they persist or even could persist, would need to initialize all of them.
Does this sound like an appropriate way to do this? Looks like the Reference manual (Page 36 GetUserLed()) is explaining that this is exactly how to do this.