Hey all, I have been working on this script and it will only run within the editor. I tried to run it in the Macro pump and via the part program as "M1000". As a Macropump it does nothing as M1000 the program halts at the M1000 command.
I created a button to call the script and it also halts the Gcode from processing.
I added the DoOEMbutton (1000) to the script for testing and it works perfectly.
Any help would be appreciated.
Sub Main()
SetuserLed (1003,1)
Open "c:\TESTFILE.csv" For Output As #1 ' Open to write file.
Dooembutton (1000) 'added to test the script
oldX = GetOEMDRO (800)
oldY = GetOEMDRO (801)
oldZ = GetOEMDRO (802)
oldL = GetOEMDRO (816)
Write #1, "X", "Y","Z","Line","Time","Date"
Write #1, oldX, oldY, oldZ,oldL, Time (Now), Date()
Do While GetoemLED (804)
newx = GetOEMDRO (800)
newy = GetOEMDRO (801)
newz = GetOEMDRO (802)
OldL = GetOEMDRO (816)
If oldX <> newX Or oldY <> newY Or oldZ <> newZ Then
oldX = newX
oldY = newY
oldZ = newZ
OldL = oldL
Write #1, oldX, oldY, oldZ,oldL, Time (Now), Date()
End If
'Filter timer - a low value will collect more data points
'a high value will collect fewer data points
'1 sample per second = 1000, 10 persecond = 1
Sleep (500)
Message "Recording Started"
Loop
Close #1
SetuserLed (1003,0)
Message "Recording Stopped"
End Sub