Mach Discussion > VB and the development of wizards
Set Coordinates to SoftMin after Reference-Drive
Kissling:
Hello,
my Referece-Indicators are mouted at the right/back/botom Side of my machine.
After doing a reference-drive the maschine coordinates are set correct to
x=304
y= 477
Z= 20
Now I whant to have the same values in the local coordinate-system!
So, how can I get this done?
Here is my VB-Script:
REFCOMBINATION(4)
REFCOMBINATION(8)
REFCOMBINATION(2)
REFCOMBINATION(1)
after this I need:
Set X= "Homing&Limits"SoftMinX
Set Y= "Homing&Limits"SoftMinY
Set Z= "Homing&Limits"SoftMaxX
Can please anybody help me doing this?
Regards Ronald
TPS:
if you have a look to the DRO list:
https://www.machsupport.com/forum/index.php?action=dlattach;topic=6657.0;attach=18779
you will find them from 150 upwards
Kissling:
Thanks to TPS for your advice.
But:
I tried so many parameters of the list you gave me the in your reply.
But none of this parameters returned the value I need.
Can anybode the me whitch value(s) this is (are):
See attatched File ( I dont find how to poste a Picture at this place)
TPS:
this is a example how to read the offset's from the profile.xml
--- Code: ---Set xmlDoc = CreateObject("MSXML.DomDocument")
xmlDoc.Load "c:\Mach3\Mach3Mill.xml"
Set nodeslist = xmlDoc.selectNodes("/profile/Preferences/M0RefHome")
XHomeOffset =nodeslist(0).text
MsgBox XHomeOffset
Set xmlDoc = nothing
--- End code ---
Kissling:
@ TPS
Thanks so much.
This was a greate advice.
I did the following code working nearly perfect:.
'-----------------------------------------------------------------'
'-------------------- Referenzfahrt ausführen -------------------'
REFCOMBINATION(4)
REFCOMBINATION(8)
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
Navigation
[0] Message Index
[#] Next page
Go to full version