Hello Guest it is August 20, 2019, 02:06:12 AM

Author Topic: steps per by VisualBasic  (Read 4107 times)

0 Members and 1 Guest are viewing this topic.

Offline asrin

*
  •  19 19
    • View Profile
steps per by VisualBasic
« on: December 28, 2009, 11:56:34 AM »
Hi guys,

Is it possible to change the "steps per" ( Motor tuning ) with Visual basic ?

I would be very happy if this is possible.

With kindly regards from the Netherlands.

Riny

melee

*
Re: steps per by VisualBasic
« Reply #1 on: December 29, 2009, 10:23:22 AM »
Hi

As far as I am aware there is no interface to access the actual windows components, menus etc.

2 methods come to mind.

1)  Close Mach, then open NameOfYourProfile.xml in the ../Mach root directory.
     Search for <StepsX>???</StepsX>, where X is the 0 based number of your stepper drive you wish to access.
     Change the figure ??? to the new setting
     Relaunch Mach
     This could all be done through VB

2)  Simulate a physical entry into the Motor Tuning menu, by using SendKeys() to output the simulated keystrokes necessary to reach the appropriate      textbox and make an entry.

Since any change to steps/per will usually have necessitated a mechanical change, or more likely a change to the driver dip switch settings, it is unlikely to have been done with Mach running, so method 1 seems the best to me.

Not sure why you would need to do it, would be interesting to hear.

regards

Melee
 

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: steps per by VisualBasic
« Reply #2 on: December 29, 2009, 11:24:48 AM »
You can use SwapAxis() to switch between two axis with different settings.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline asrin

*
  •  19 19
    • View Profile
Re: steps per by VisualBasic
« Reply #3 on: December 29, 2009, 05:53:17 PM »
Hi Melee and Gerry,

Thanks for your replies.

I need this because I want use the 4e axis insteed of the Y axis for milling on a cylinder. Then I can make two buttons on my screen to change the units per rev and with a switch I change the motor in hardware.
So I can see on my screen what the settings are.
I have try-ed CNCwrapper, but these software can't swap circles. Then you have to use software that makes a circle with only little lines, this action is not possible in my software.
« Last Edit: December 29, 2009, 05:56:56 PM by asrin »

Offline Graham Waterworth

*
  • *
  •  1,865 1,865
  • Yorkshire Dales, England
    • View Profile
Re: steps per by VisualBasic
« Reply #4 on: December 30, 2009, 12:25:42 PM »
I would just set up another profile using your current one as a template.

Machine Standard

and

Machine Rotary

Graham
Without engineers the world stops
Re: steps per by VisualBasic
« Reply #5 on: April 08, 2010, 04:19:35 AM »
Hi

Just come across this post and realised I had seen something recently that might help.

Amongst the list of strings for use in the GetParam() and SetParam() functions in the wiki are

"StepsPerAxisX" = X Steps per unit from the motor tuning page

"StepsPerAxisY" = Y Steps per unit from the motor tuning page

"StepsPerAxisZ" = Z Steps per unit from the motor tuning page
etc. etc.

Haven't tried them yet, but it reads as though you should be able to set them on the fly from VBS.

regards

ArcEye
Re: steps per by VisualBasic
« Reply #6 on: April 08, 2010, 08:04:24 AM »
Yep,

Just tested it

X = GetParam("StepsPerAxisX")
SetParam("StepsPerAxisX", X * 2)


fetches steps per for X and then doubles it
You can see the X DRO change to compensate and the motor tuning entry is changed.

  ;D

Offline Tweakie.CNC

*
  • *
  •  7,884 7,884
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: steps per by VisualBasic
« Reply #7 on: April 12, 2010, 04:51:37 AM »
Excellent solution ArcEye.  :)

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.