Hello Guest it is April 25, 2024, 07:15:46 AM

Author Topic: Set Coordinates to SoftMin after Reference-Drive  (Read 1069 times)

0 Members and 1 Guest are viewing this topic.

Set Coordinates to SoftMin after Reference-Drive
« on: June 03, 2023, 08:14:22 AM »
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

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Set Coordinates to SoftMin after Reference-Drive
« Reply #1 on: June 03, 2023, 09:47:18 AM »
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
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Set Coordinates to SoftMin after Reference-Drive
« Reply #2 on: June 05, 2023, 05:42:17 AM »
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)
« Last Edit: June 05, 2023, 05:47:09 AM by Kissling »

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Set Coordinates to SoftMin after Reference-Drive
« Reply #3 on: June 05, 2023, 06:30:08 AM »
this is a example how to read  the offset's from the profile.xml

Code: [Select]
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
« Last Edit: June 05, 2023, 06:32:07 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Set Coordinates to SoftMin after Reference-Drive
« Reply #4 on: June 05, 2023, 03:37:19 PM »
@ 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
« Last Edit: June 05, 2023, 03:39:36 PM by Kissling »

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Set Coordinates to SoftMin after Reference-Drive
« Reply #5 on: June 06, 2023, 02:12:32 AM »
this code:

Code: [Select]
While Ismoving()
  Sleep(20)
Wend
after the references
will "pause" the macro until movement is finished

https://www.machsupport.com/forum/index.php?action=dlattach;topic=12740.0;attach=17815
https://cnc4you.co.uk/resources/VBScript-Commands.pdf
« Last Edit: June 06, 2023, 02:16:21 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.