Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: zeeschuim on February 24, 2016, 01:06:28 PM

Title: message if the Y distance is to big
Post by: zeeschuim on February 24, 2016, 01:06:28 PM
I am busy with  a wizzard.
I have a code what add some values to find a Y position.
Code: [Select]
If GetUserLED(1071) Then
Code"G00 Z"& SafeZ &"X0 Y" & een + ZgD + twee + ZgD + drie + ZgD + vier + ZgD + vijf + ZgD + zes + ZgD + zeven + ZgD + acht
I want to make a messagebox what will tell me when the sum off the values exceed the machine boundry in the Y axe.
Is this possible and how?
Title: Re: message if the Y distance is to big
Post by: BR549 on February 24, 2016, 01:56:46 PM
This will ONLY work if you have properly referenced your machine so it know exactly where it is. AND you have properly setup Softlimits as the Max table distances it can Move +/-.

GetOemDro(151) will retreive teh Y softMax distance of the table. So then you simply compare the calculated Move value that you have to the Ysoftmax value. If teh move exceeds  the YsoftMax Value then it is an Error.

(;-0 TP

Title: Re: message if the Y distance is to big
Post by: zeeschuim on February 25, 2016, 12:46:56 AM
So it will be something like this?
Code: [Select]
If GetOemDro(151)<1750 Then
Code "(MSG,te groot voor de tafel!)"
End If
Title: Re: message if the Y distance is to big
Post by: BR549 on February 25, 2016, 02:14:06 PM
I don't have any idea what teh message said  but you need to develop a stop mechanism IF the answer said it failed.

If GetOemDro(151)<1750 Then
MsgBox ("MSG,te groot voor de tafel!")
Dobutton(3)   ' Cancel the Gcode program if loaded
End               ' End the script

ELSE

Do what ever

End If