Hello Guest it is September 20, 2019, 08:49:47 AM

Author Topic: Mach3 VB Script Help  (Read 12583 times)

0 Members and 1 Guest are viewing this topic.

Offline RICH

*
  • *
  •  7,361 7,361
    • View Profile
Re: Mach3 VB Script Help
« Reply #60 on: February 13, 2016, 06:45:12 AM »
Trying to be additive to TP's reply #59.
The questions below may impact what and how you do script. Actually they should be asked before one starts.

-------------------------------------------------------------------

What do you want to accomplish with the probing?
OR
Why am I probing the hole?


What data/info do you want and what do you want to do with the info after probing is done?
OR
How and when will the info be used?


What is the probing based on?

Configuration ( understand it's impact on what you are doing )
- Units
- absolute / incremental
- referenced or not referenced machine
- What coordinate system are you in? Machine / Part
- Initialization String
- Work Offset
- Default feed rate

Do you want to automate some manual moves in addition to just probing
before / after the probing?

Do you want the probing to be functional for any condition?

RICH
Re: Mach3 VB Script Help
« Reply #61 on: February 13, 2016, 07:04:59 PM »
I get what all your saying but its just wigging oout. I just tried to run the program and it worked great when
I fired up the system and tried 5 times, then out of no where it starts going opposite ways on a G31 call???? I have G90 above it say G31 X-3.5 F20 and it moves POS?? I swear I get to the last 3 lines 10 time and it wigs out.. this time was only half way through..

I do get the ),) or ),-10 thing. Right now it only works at 0,0 But I wanna get that working then worry about any placement on table
Re: Mach3 VB Script Help
« Reply #62 on: February 13, 2016, 07:21:55 PM »
Here is a issue I'm running into... It looks like placement changes every thing, can someone explain this. See notes in code

Code "G90"
Code "G31 X-7 F20"   
While IsMoving()
Sleep(200)
Wend                                         
X1 = GetVar(2000)
Sleep(90)                                   
Code "G91 G0 X.10"
While IsMoving()
Sleep(100)
V1=GetOemDro(800)                  'Here
Wend
XF1 = GetOemDro(800)               'and here should equal the same number??
Sleep(90)                                          'V1 shows -.6846 which is right           
SetDro(2,V1)                                     'XF1 shows +.7418 AAAAAHHH Im so lost
SetDro(3,XF1)
Code "G31 X7 F20"
While IsMoving()
Sleep(400)
Wend
X2 = GetVar(2000)
XF2 = 2.2*GetOemDro(800)
Sleep(90)   
XC1=X2-X1+.05
Sleep(90)
XC2 = XC1/2
Sleep(200)
Code "G91 G0 X" & -XC2   

Code "G90"
Code "G31 Y-3 F20"   
While IsMoving()
Sleep(90)
Wend                                         
Y1 = GetVar(2001)
Sleep(90)                                   
Code "G91 G0 Y.10"
YF1 = .87*GetOemDro(801)
While IsMoving()
Sleep(90)
Wend
Code "G90"
Code "G31 Y3 F20"
While IsMoving()
Sleep(150)
Wend
Y2 = GetVar(2001)
YF2 = 2.3*GetOemDro(801)
SetDro(4,YF2)
Sleep(200)   
YC1=Y2-Y1
Sleep(90)
YC2 = YC1/2
Sleep(120)
Code "G91 G0 Y" & -YC2

While IsMoving()
Sleep(150)
Wend
Sleep(90)
Code "G90"
Code "G91 G0 X" & XF1
While IsMoving()
Wend
Code "G31 X-3.5 F4"
Sleep(150)
X1 = GetVar(2000)
While IsMoving()
Wend
           
End If 



Tried it a second time with the bottom XF1 move changed to V1 and now
V1=-.5957
XF1=-.5417

Then I switched it back to XF1 since that last mesument was correct and now it works WTF!!!
« Last Edit: February 13, 2016, 07:28:15 PM by nissan20det »
Re: Mach3 VB Script Help
« Reply #63 on: February 13, 2016, 07:29:55 PM »
OH well Just A remembered I havent downloaded the real licensed version on this computer its the pirated one, may that where the glitchs are coming from????
Re: Mach3 VB Script Help
« Reply #64 on: February 13, 2016, 07:31:00 PM »
Do I just save my XML and download the licenced version and place that in C:/Mach? so I dont have to reprogram everything?

Offline BR549

*
  •  6,895 6,895
    • View Profile
Re: Mach3 VB Script Help
« Reply #65 on: February 13, 2016, 07:37:38 PM »
The problem is your code is wacked out and simply wrong in so many ways , not teh machine (;-)

(;-) TP
Re: Mach3 VB Script Help
« Reply #66 on: February 13, 2016, 08:00:19 PM »
Please inform me Why V1 should not equal XF1 in this case I would love to hear this.
Does Wend Change something?

Okay well Licensed version got rid of glitchs as well program is running smoother.

Thank you guys so much Im ganna make you all a free piece and mail it to you lol
« Last Edit: February 13, 2016, 08:13:37 PM by nissan20det »

Offline BR549

*
  •  6,895 6,895
    • View Profile
Re: Mach3 VB Script Help
« Reply #67 on: February 13, 2016, 09:12:19 PM »
YOu are the type that does not listen and is unwilling to learn (;-). You cannot seem to shake that % of a move move thing you have going on in your head. NOW you are even trying to LIE to teh machine by changing teh DRO values to BEND its will to MAKE it do what you want.

It ain't NEVER gonna happen this way sport  . You were given teh working code long ago all you had to do was finish the equation to find Center of 2 points and you blew all that off because it did not fit your% of a move move thingy (;-)

Sad part is if your were really cleaver there is another working example of teh Center of circle code right here on this site. Probably MORE than one at that.

I suggest you stop what you are doing and go back and learn basic Gcode controlling of your machine. Then when you fully understand Inc and Abs modes AND teh quadrant MATH and after you have read all the ink off all teh pertanent manuals on macro programing give this another shot. It ain't rocket science it is basic Gcode Macro programming. It is meant to be very simple and IF you understand Gcode and basic programming it is.

Good Luck, And may the Force be with you (;-)TP
« Last Edit: February 13, 2016, 09:18:45 PM by BR549 »

Offline BR549

*
  •  6,895 6,895
    • View Profile
Re: Mach3 VB Script Help
« Reply #68 on: February 13, 2016, 09:39:48 PM »
And YES  just for the record I do know why you are getting 2 different values for V1 and XF1. V1 is captured while the axis is moving and teh XF1 is taken AFTER the axis has stopped. It is just doing exactly what you told it to do.

(;-) TP
Re: Mach3 VB Script Help
« Reply #69 on: February 14, 2016, 12:31:04 AM »
Well I cant find Teh stuff anywhere What does that stand for? and for the math other the -3 and +3 not being 0 or 3 away but 6 what other math is there?

Maybe a link?