Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 02:09:29 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  steps per by VisualBasic
Pages: 1   Go Down
Print
Author Topic: steps per by VisualBasic  (Read 1043 times)
0 Members and 1 Guest are viewing this topic.
asrin
Active Member

Offline Offline

Posts: 19


View Profile
« 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
Logged
melee
Guest
« 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>Huh</StepsX>, where X is the 0 based number of your stepper drive you wish to access.
     Change the figure Huh 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
 
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 2,612



View Profile WWW
« Reply #2 on: December 29, 2009, 11:24:48 AM »

You can use SwapAxis() to switch between two axis with different settings.
Logged

asrin
Active Member

Offline Offline

Posts: 19


View Profile
« 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 » Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,665


West Yorkshire, England



View Profile WWW
« 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
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
ArcEye
Active Member

Offline Offline

Posts: 10


View Profile
« Reply #5 on: April 08, 2010, 03: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
Logged
ArcEye
Active Member

Offline Offline

Posts: 10


View Profile
« Reply #6 on: April 08, 2010, 07: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.

  Grin
Logged
Tweakie.CNC
Active Member

Offline Offline

Posts: 3,257


Super Kitty.


View Profile WWW
« Reply #7 on: April 12, 2010, 03:51:37 AM »

Excellent solution ArcEye.  Smiley

Tweakie.
Logged

Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!