@ TPS
Thanks so much.
This was a greate advice.
I did the following code working nearly perfect:.
'-----------------------------------------------------------------'
'-------------------- Referenzfahrt ausführen -------------------'
REFCOMBINATION(4)
REFCOMBINATION(

REFCOMBINATION(2)
REFCOMBINATION(1)
'----------------------------------------------------------------'
'------------------ Konfigurationsdatei öffnen ------------------'
Set xmlDoc = CreateObject("MSXML.DomDocument")
xmlDoc.Load "c:\Mach3\Mill.xml"
'----------------------------------------------------------------'
'------------------------ Werte auslesen ------------------------'
Set nodeslist = xmlDoc.selectNodes("/profile/Preferences/Enc0")
XHomeOffset =nodeslist(0).text
'MsgBox XHomeOffset
Set nodeslist = xmlDoc.selectNodes("/profile/Preferences/Enc1")
YHomeOffset =nodeslist(0).text
'MsgBox YHomeOffset
Set nodeslist = xmlDoc.selectNodes("/profile/Preferences/Enc2")
ZHomeOffset =nodeslist(0).text
'MsgBox ZHomeOffset
'----------------------------------------------------------------'
'---------------------- Koordinaten setzen ----------------------'
MsgBox XHomeOffset
SetDRO(0, XHomeOffset)
MsgBox YHomeOffse
SetDRO(1, YHomeOffset)
MsgBox ZHomeOffset
SetDRO(2, ZHomeOffset)
'----------------------------------------------------------------'
Set xmlDoc = Nothing
'-----------------------------------------------------------------'
There is only one proble to be solved:
The code is working to fast!
The command:
"SetDRO(0, XHomeOffset)"
and
"SetDRO(1, YHomeOffset)"
and
"SetDRO(2, ZHomeOffset)"
is executed bevore the mashine has reached the switches.
Question:
Is there a way to wait till the reverece-drive has reached his switch
Something like:
"wait till reached switch"
regards Ronny