i write this code and work well:
macropump.m1s
C = GetOEMled (813) ' Dwell LED
D = GetOEMled (11) ' Spindle ON LED
If C And D Then
SetVar(604,GetDro(16))
SetUserDro(1200,Getvar(604))
End If
'in fact C & D sense "M03" .have You a better suggestion ?
'A = GetOEMled (1140) / is Inactive because dont work well
'B = GetUserDRO (1140)
'If A And (B = 0) Then
'Code "M115"
'SetUserDRO(1140,1)
'End If
'If Not A And (B > 0) Then
'SetUserDRO(1140,0)
'End If
and
m115.m1s
DoButton(1) 'Feedhold
While IsMoving 'Wait for movement to stop
Sleep(100)
Wend
DoButton(3) 'Set Stop
Sleep(1000)
SetDro(16,(Getvar(604)+1))
Sleep(100)
DoOEMButton(156)
Sleep(100)
DoButton(0)
END
my problem is when i trigger "INPUT#1" ,dont trigger M115.
please help me.
OK I see a BIG safety concern
I use this code when cutting does not do well and we need to be done again
It is a bad idea to have statements(DoButton(0)) that control machine movement from the macropump
have You a better suggestion?