What I mean is that I would like to place a custom userDRO on the screen that would display what tool number is next in line to run after the current tool finishes. This way while tool A is running, I can look on the screen and find which tool to get ready for the next manual tool change. I figure when the tool change macro is ran, I'll use some script to scan ahead and find which tool is next.
So far, I have been able to get the macro to find the line the next tool change is on and post the entire line of code to the message bar, but I'm not sure how to post just the T number (word) to a DRO. I want it posted to the DRO because any messages are immediately replaced in the history file.
Dim currentfile As String
Dim filesys, filetxt, lastline, oldline As String
Dim currentLine As String
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
currentLine = GetOEMDRO(816)
Found = False
currentfile = FileName
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)
Dim i As Integer
i = 0
Do While filetxt.AtEndOfStream <> true
linestring = UCase(filetxt.ReadLine()) & " "
If linestring <> " " Then
i = i+1
If i > currentLine Then
If ((InStr(linestring,"M6" ) >0 Or InStr(linestring,"M06" )>0)) Then
Message "()" & linestring 'post the entire line of code to the history folder
Found = True
MsgBox " Your next toolchange position is at line "& i
Exit Do
End If
End If
End If
Loop
If Found = False Then
MsgBox "No M6/M06 Found after LINE:"& currentLine
End If
filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing
My question is, how can I get the tool number (T word) set to a user dro.