Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 01:54:50 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
Event Based Code
Pages:
1
Go Down
« previous
next »
Author
Topic: Event Based Code (Read 1610 times)
0 Members and 2 Guests are viewing this topic.
davidimurray
Active Member
Offline
Posts: 118
Event Based Code
«
on:
June 05, 2006, 04:10:05 PM »
Hi
I'm writing a wizard to assist in calibrating the spindle. What I want to do is this :-
1) Have a 'start calibration' button that contains the main code
2) When you click this, the spindle starts and the spindle speed is incremented by an amount previously chosen by the user.
3) The user then measures the speed and enters it into a DRO.
4) The user then clicks a 'Next' button which stores the two values in an array, and then increments the spindle speed again
5) The procedure continues as above until the max speed is reached.
I've got some of it working. But I don't know how to implement the 'Next' button - any ideas greatly appreciated !
Cheers
Dave
Logged
Brian Barker
Administrator
Offline
Posts: 3,383
Re: Event Based Code
«
Reply #1 on:
June 05, 2006, 05:33:21 PM »
The best way to do this in Mach3 is to have each Inc take you to a new screen... OR you can do it on the same screen with a counter running in the background. You could then do Counter * inc = Speed Call SetOEMDRO(1200.Speed) Something like that should work...
Logged
Fixing problems one post at a time
www.newfangledsolutions.com
www.machsupport.com
davidimurray
Active Member
Offline
Posts: 118
Re: Event Based Code
«
Reply #2 on:
June 06, 2006, 07:54:27 AM »
Hi Brian
I've got the speed increment working - but I'm not quite sure where is the best place to put the code. Two theories :-
1) Have a 'start' button which initiates everything then the actual increment button writes the values to a 2d array. Each time I click the button will the array remain there? Oh and so far I can only get 1d arrays to work!
2) Have a start button that contains all the code and while loops looking for a button condition - I've tried this and can't get it to work.
The idea I'm working on is to interpolate points between those entered by the user to create enough to allow linearity.dat to be written to and produce a series of straight lines between known points. By allowing the user to enter the value there is no need to have a spindlex index sensor as I would never need one on the mill for what I do.
Cheers
Dave
Logged
Brian Barker
Administrator
Offline
Posts: 3,383
Re: Event Based Code
«
Reply #3 on:
June 06, 2006, 12:45:25 PM »
I have not setup any array's in VB
I can tell you how to do it in C++.. I will have a look at the house and see what I have for code that I can give you
Logged
Fixing problems one post at a time
www.newfangledsolutions.com
www.machsupport.com
davidimurray
Active Member
Offline
Posts: 118
Re: Event Based Code
«
Reply #4 on:
June 07, 2006, 04:34:56 AM »
Brian
I may have an alternative, allthough cheating, method. Simply append each entry to a text file and then re-read it later. I've got the text file creation working, now I just need to spend some time reading it back in - that will have to wait until my next coffee break at work!
Cheers
Dave
Logged
Brian Barker
Administrator
Offline
Posts: 3,383
Re: Event Based Code
«
Reply #5 on:
June 07, 2006, 06:14:18 AM »
If you are going to do that write theit as a Ver in Mach3... This is how I did a 2X10 array:
For i=0 To 19 Step 2
Call setVar ((120 + i), GetUserDRO(1140 +i))
Call setVar ((121 + i), GetUserDRO(1141 +i))
Next
to read the array I did the following:
For i=1 To 10
onOff = Int( LEDonOff / ((10^ i)/10)) - Int( LEDonOff / ((10^(i+1))/10))*10
X = FormatNumber (GetVar(100 +((i-1)*2)),4)
Y = FormatNumber (GetVar(101 +((i-1)*2)),4)
If onOff = 1 Then
If Nc=0 Then
Call Drill_cycle(X,Y,Z,Q,R,F)
Else
Code " X" & X & " Y" & Y
End If
Nc=1
End If
Next
I did this so I could have a gobal variable... I also used a register to save the led's states and that tells the loop if the point is used... I know it is not how you would do it if you were doing real VB but it works!
Logged
Fixing problems one post at a time
www.newfangledsolutions.com
www.machsupport.com
davidimurray
Active Member
Offline
Posts: 118
Re: Event Based Code
«
Reply #6 on:
June 07, 2006, 07:14:05 AM »
Ah ha
Strangely, doing it that way had crossed my mind but I decided not to go down that route - haven't got a clue why!
The only potential issue is how many user variables are there available ? I imagine that other users with a greater spindle speed range may want to use a large numbered of measured speeds. My spindle only goes from 0-2200 in high gear!
Cheers
Dave
Logged
Brian Barker
Administrator
Offline
Posts: 3,383
Re: Event Based Code
«
Reply #7 on:
June 07, 2006, 05:21:04 PM »
You have from 0-1999 that you can use if you need to
Logged
Fixing problems one post at a time
www.newfangledsolutions.com
www.machsupport.com
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...