
Load Theremino_Cobot.exe

Variable Numeric SlotCobotCommands = 1
Variable Numeric  SlotCobotResponses = 2
'SlotText SlotCobotResponses = "Editing"

Button 1 Text CloseAll

Stop

Label CloseAll
	CobotStopExecution
	CobotGotoCenter
	CobotGotoHome
	Load CloseApps
Return

Label CobotStopExecution
	CobotCommand = "StopExecution"
	SendCommandToCobot
Return

Label CobotGotoHome
	CobotCommand = "GotoHome"
	SendCommandToCobot
Return

Label CobotGotoCenter
	CobotCommand = "GotoCenter"
	SendCommandToCobot
Return

Variable String CobotCommand
Label SendCommandToCobot
	SlotText SlotCobotCommands = ""
	Wait Seconds 0.05
	SlotText SlotCobotCommands = CobotCommand
	Wait Seconds 0.05
	WaitCobotReady
Return

Label WaitCobotReady
	Wait SlotText(SlotCobotResponses) = "Ready"
	
	'For v1 = 0 To Infinity
	'	If SlotText(SlotCobotResponses) = "Ready"
	'		Exit
	'	EndIf
	'Next
	
	'Beep
Return




'EXEC SlotText 2 = "Ready"
