Hey all, it's been a while!
I need to add a sendserial command to the stop and reset buttons to turn off some external devices. They already come on and off as needed in the m6start and m6end files, but I'd like them to shut down in emergencies, and that requires the sendserial command.
In screen4 or machscreen, I can see the STOP and RESET buttons are referencing the system function STOP FILE and RESET. Is there a way in a script that I can call these functions manually? I know it can be done with buttons and such, but can't seem to find how to call these system functions directly.
Thanks
Reset is DoOEMButton(1021) ........ I think thats what you want. You would make your reset button a VB button in MachScreen and add the code to it. Make sure you do what ever else you need to do before sending the reset because it will stop sending the serial bits once reset is activated if i'm not mistaken. If you want a serial connected device to request Reset you could add the code to your MacroPump.m1s to do that.
SendSerial("Hello World")
SendSerial("Goodbye')
Sleep(100)
DoOEMButton(1021) 'Reset.....I do not like a delay at all on a reset button so you would have to weigh it out and see if it will work for you.
If GetInBit(*********) Then
DoOEMButton(1021)
End if