36
« Last post by Tecmaqcnc on June 06, 2025, 07:11:05 AM »
I've fixed the msg issue in the script.
The ActY takes data from the Yact machine, so it's invalid. We need MaxY and MinY from the G-code.
The code:
'Get the current values
ActY = GetOEMDro(801)
MinYCoord = GetOEMDro(5)
MaxYCoord = GetOEMDro(11)
MsgBox "ActY: " &ActY &" MinY: " &MinYCoord &" MaxYcoord; " &MaxYCoord
'front lowering
If ActY >= (MinYCoord) Then'<=
ActivateSignal(OUTPUT11)
End If
'front raising
If ActY <= (MinYCoord) Then'<=
DeActivateSignal(OUTPUT11)
End If
'rear lowering
If ActY >= (MaxYCoord) Then'<=
ActivateSignal(OUTPUT10)
End If
'front raising
If ActY <= (MaxYCoord) Then'>=
DeActivateSignal(OUTPUT10)
End If
If(GetInBit(90, 2)) And Not (GetOemLed(800)) Then
Code(" G55")
Espera
If getDro (24) = 2 Then
Code("G52 X-275.95 Y167.36 ")
Espera
End If
If getDro (24) = 3 Then
Code("G52 X-551.09 Y-2.87 Z0")
Espera
End If
Espera
End If
If(GetInBit(90, 3)) And Not (GetOemLed(800)) Then
Code(" G56")
Espera
If getDro (24) = 2 Then
Code("G52 X-275.95 Y167.36 ")
Espera
End If
If getDro (24) = 3 Then
Code("G52 X-551.09 Y-2.87 Z0")
Espera
End If
End If
End
' -----------------------------------------------------------------------------
Sub Espera ()
While IsMoving()
Sleep(15)
Wend
End Sub
' -----------------------------------------------------------------------------