586,956 active members*
2,909 visitors online*
Register for free
Login
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2007
    Posts
    219

    Need help with VB script Syntax Please.

    If userled(178) = 1 Then
    swapaxis(3,6)
    Else
    resetaxisswap()
    End If

    That what I have to start with. I am very familiar with vb and vb.net, Im just not sure what to call in mach 3. Im trying to check the state of the swap axis on a button press and switch it to what its not. So either set or reset. After much searching, I found out that led oem # 178 lights when an axis swap has occurred. I added this led to my screen. Maybe somebody can help? -Adam
    www.adambrunette.com - Converting My Harbor Freight X2 And My Jet Jvm-830 Knee Mill, As well as many other projects.

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    I answered you on the Yahoo group, but I'll repeat it here. I think this will work, but you'll have to try it and see. I've never tried an if...then.....else... in Mach.

    If not getoemled(178) then
    swapaxis(3,6)
    else
    resetaxisswap()
    end if
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Jan 2007
    Posts
    219
    THANKS Gerry! Works great. dose exactly what I want/need it to do. -Adam
    www.adambrunette.com - Converting My Harbor Freight X2 And My Jet Jvm-830 Knee Mill, As well as many other projects.

  4. #4
    Join Date
    Mar 2003
    Posts
    35538
    I have two buttons on my screen, One to swap and one to reset. When I redo it, Now I'll only need one.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  5. #5
    Join Date
    Jan 2007
    Posts
    219
    I have one more question that you might be able to answer for me. The next part of my project requires seeing what g codes are being read to know when to call the swap axis.

    If I could just read then codes and pop up a message box that would be a huge start.

    My knee mill has the knee and quill retrofitted and I want to swap to use the quill for things like drilling, while using the knee for pocketing.

    Thanks again. -Adam
    www.adambrunette.com - Converting My Harbor Freight X2 And My Jet Jvm-830 Knee Mill, As well as many other projects.

  6. #6
    Join Date
    Mar 2003
    Posts
    35538
    You can't read the code as it's running (At least I don't think you can). Can you add an M01 where you want to swap? You can configure Mach to stop and wait when it gets to M01.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  7. #7
    Join Date
    Jan 2007
    Posts
    219
    What I am trying to do is make it totally automatic. I dont want to have to edit the code because I could be running it on a different machine also. -Adam

    P.S. I am going to start a new thread , as you answered the question in this one. Thank you.
    www.adambrunette.com - Converting My Harbor Freight X2 And My Jet Jvm-830 Knee Mill, As well as many other projects.

Similar Threads

  1. Need a bit of help identifying some syntax
    By ethyrial in forum G-Code Programing
    Replies: 3
    Last Post: 07-24-2008, 03:05 AM
  2. VB6,VB.net,VB script,What one???
    By hydrospin01 in forum Visual Basic
    Replies: 11
    Last Post: 05-25-2008, 02:09 AM
  3. Syntax or just wont work???
    By murphy625 in forum CamSoft Products
    Replies: 1
    Last Post: 04-06-2005, 01:16 AM
  4. syntax error
    By pyroracing85 in forum G-Code Programing
    Replies: 9
    Last Post: 01-28-2005, 02:09 AM
  5. Syntax question
    By doug6949 in forum Mastercam
    Replies: 2
    Last Post: 12-13-2004, 08:14 PM

Posting Permissions

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