Need Help! Mach3 Robotic arm VBScript vertical Move until input


Results 1 to 1 of 1

Thread: Mach3 Robotic arm VBScript vertical Move until input

  1. #1
    Registered Dovah's Avatar
    Join Date
    Aug 2018
    Posts
    0
    Downloads
    0
    Uploads
    0

    Question Mach3 Robotic arm VBScript vertical Move until input

    Hello CNCZone Forum,

    I am currently programming robot arm for my self but ran into some problems.

    What I want is that Z & Y Moves down at the same time to create a vertical move until a sensor is activated then waits for 2 sec and then starts moving back up.


    It should look something like this:
    Move vertical down ---> (Sensor On) Stop moving ---> Wait 2 sec ---> move vertical back up


    I know little to none about programming with VBScript i have attempted to make a code by my self but i can't get it to work like i want.

    To make it a vertical move i have to move Z & Y at the same time but, when I use a probe G-code (G31) he only moves Z until the sensor is activated after that he doesn't do anything until the sensor is deactivated and then he continues his probe down wards instead of moving back up.
    I tried to use a G0 instead of an G31 code but, then he didn't stop while the sensor was activated

    ============Notes============

    The robotic arm is controlled by an NVEM CNC controller and Mach3

    Input1 & Probe are both connected to the same sensor



    My G-code:

    G0 X0 Y0 Z0
    G0 X-10
    M1002
    G0 X-10 Y0 Z0
    G0 X0




    My VBScript (M1002) code:

    MaxR = 1

    If IsActive(Input1) Then
    MaxR = 0
    End If
    While MaxR = 1
    Code "G31 Y -15 Z -20 F80"
    While isMoving()
    If IsActive(Input1) Then
    MaxR = 0
    End if
    Wend
    Wend
    Sleep 100
    Exit Sub

    Similar Threads:
    Last edited by Dovah; 08-13-2018 at 04:33 PM.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Mach3 Robotic arm VBScript vertical Move until input

Mach3 Robotic arm VBScript vertical Move until input