Home
Downloads
Mach and LazyCam
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
German Forum
Italian Forum
Portugese Forum
Resources
Links
User Reviews
User Videos
Contact Us
CNCZone
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
December 01, 2008, 10:47:37 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
Writing coordinates to a file
Pages:
1
Go Down
« previous
next »
Author
Topic: Writing coordinates to a file (Read 982 times)
0 Members and 1 Guest are viewing this topic.
phnxgold30
Active Member
Offline
Posts: 7
Writing coordinates to a file
«
on:
May 04, 2008, 11:45:24 PM »
Ok, so I got Mach3 setup to my mill table, and use a ModIO which I hooked up a laser displacement sensor mapped through an analog input to a DRO (haven't figured out which one yet, so just using the manual feed override DRO as instructed in the tutorial videos.
I'm just stuck ion two more points and was wondering if anyone could offer any advice.
First off.......Can I map an analog input to a DRO such as my A-axis readout on the main screen??
Second.......is there a tutorial around that demonstrates how to take the X, Y and Laser displacement value and write them to a file?? I'm a VB.net guy, so the legacy vb is a bit rough for me, but I'm looking for something very similar to the digitizing wizard, but instead of the Z value, it would record the analog input.
Any advice??
Thanks a lot, this program is killer and I plan on making my purchase soon!
Dan
Logged
Chaoticone
South Carolina, US
Administrator
Online
Posts: 2,809
Precision Chaos
Re: Writing coordinates to a file
«
Reply #1 on:
May 04, 2008, 11:53:41 PM »
Quote
First off.......Can I map an analog input to a DRO such as my A-axis readout on the main screen??
I think you could do this with a brain. There are videos in the video section about brains.
Brett
Logged
If you could see the things I have in my head, you would be laughing too.
www.precisionchaos1.com
My guard dog is not what you need to worry about!
phnxgold30
Active Member
Offline
Posts: 7
Re: Writing coordinates to a file
«
Reply #2 on:
May 05, 2008, 07:21:32 AM »
Ok, I do see this with assigning the termination to a DRO. Is there any function of BRAINS to do writing to a file, or is that only done with VB script?? I did find the syntax for creating a writing a file, but in the videos it says BRAINS are much faster, but if that's not an option, I'll go ahead and do the VB script for the file operation.
Thanks for the heads up!
Dan
Logged
Chaoticone
South Carolina, US
Administrator
Online
Posts: 2,809
Precision Chaos
Re: Writing coordinates to a file
«
Reply #3 on:
May 05, 2008, 08:38:18 AM »
I'm not sure so you may want to wait on someone who is. I think to write to a file you'll have to do that in VB or maybe flash.
Brett
Logged
If you could see the things I have in my head, you would be laughing too.
www.precisionchaos1.com
My guard dog is not what you need to worry about!
Ron Ginger
Active Member
Online
Posts: 266
Re: Writing coordinates to a file
«
Reply #4 on:
May 05, 2008, 06:43:45 PM »
File I/O is pretty basic in VB, to make a bad pun. Something like:
open "filename.txt" For Output as #1
Write #1 "some junk in the file"
Write #1 Xval, Yval
Close #1
There is a complete Basic manual on this site under the documents section.
Logged
phnxgold30
Active Member
Offline
Posts: 7
Re: Writing coordinates to a file
«
Reply #5 on:
May 08, 2008, 09:24:09 AM »
Ok, well I was able to get the laser sensor reading my distance with surprisingly good accuracy to a DRO on the main screen. I still haven't figured out how to override the z-axis value since my z-axis isn't really moving, but I went ahead and made the z-axis scale DRO as my measurement in mm.
So after looking at the digitize wizard, I've noticed the following:
- I could modify the script to take out the z-axis plunging.
- Since there is no way to modify the G31 and DigitizeFile settings (or is there?), I remove the digitize open file (M40) code
-With the above in thought, I also remove the G31 code within the macro.
-I make my own M##.m1s file that I can call from within the g-code
-In this macro, it opens the file for appending.........and adding the x, y and z coordinates, then closes the file.
-GCode moves my laser to the next coordinate.
-My custom M##.m1s file is run again
and so on
I would LOVE to test this, but I'm at work. Is there anyone that can confirm this for me just from experience? I've a serious CNC noob, but actually a software developer by trade, so I'm constantly thinking of this. I'm having to learn vb-script as it's a bit different from vb.net, but it's not too bad.
Thanks again for the help.
Dan
Logged
phnxgold30
Active Member
Offline
Posts: 7
Re: Writing coordinates to a file
«
Reply #6 on:
May 08, 2008, 10:34:20 AM »
Ok, well I tried running an M-code macro from within the g-code and it just stops and I have to hit "Cycle Start" again to get it to move to the next coordinate.
is it better to run a vb macro from gcode?
Or is it better to run G-Code from a vb script?
Logged
Ron Ginger
Active Member
Online
Posts: 266
Re: Writing coordinates to a file
«
Reply #7 on:
May 09, 2008, 07:38:38 PM »
Any macro can be a VB function and it should run fine. It should not require a Cycle Start unless something in the macro causes a stop.
It is fine to run gcode form VB scripts, many wizards do that.
What is not allowed is for a VB macro to call another VB macro. I think that causes strange hang conditions.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Online
Posts: 770
Briceville, TN, USA
Re: Writing coordinates to a file
«
Reply #8 on:
May 22, 2008, 09:53:09 AM »
Here is a Coordinate capture Macro I just helped a guy with.
Sub Main ()
Open "c:\TESTFILE.txt" For Output As #1 ' Open to write file.
oldX = GetOEMDRO (800)
oldY = GetOEMDRO (801)
oldZ = GetOEMDRO (802)
Write #1, oldX , oldY, oldZ
While GetUserLED (1005)
newx = GetOEMDRO (800)
newy = GetOEMDRO (801)
newz = GetOEMDRO (802)
if oldX <> newX or oldY <> newY or oldZ <> newZ Then
oldX = newX
oldY = newY
oldZ = newZ
Write #1, oldX , oldY, oldZ
End If
Wend
Close #1
End Sub
Here is the "Brain" that goes with it.
What it does, is the Brain "Strobes" and LED at a set interval (you can modify the timer in it for your situation), when it goes to ON, the Write coordinates will execute. (NOTE you have to have another on/off button with a Control LED, that you use as your Record Function.
The code it self will compare, coordinates and only update changed coordinates in the file.
In your Case you can ADD or Change the Z value to "GetUserDRO(*********x)" that is the DRO where you are dropping your Analog value.
Further: You can have that Analog value dynamically control the Z axis hiegth, through Brains as well. (If you need to do that). You would "0" your Z axis to some minimum hiegth. Then the Analog value Range would scale through a formula in brains and that result would goto another Terminator UserDRO. This would be units, above your "0" point. Then I would in the Macro pump, put in a statement to grab this dro and put those units into a movement Code for your Z. (I would probably put another Control LED in there that would allow me to turn on and off that ability). Since it would be running in the Macro pump it would execute anywhere from 4-10 hrts frequency (depending on your comps speed, and if you already have other Macropump overhead issues.
Scott
FileSampleBrain2.brn
(1.73 KB - downloaded 27 times.)
Logged
All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
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.
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*e*i*n*g
=> Mach Screens
=> Feature Requests
=> Non English Forums
=> FAQs
===> Finished Plugins for Download
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
-----------------------------
*****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
=> Lazy Cam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> dspMC/IP motion controller
=> Third party software and hardware support forums.
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Promote and discuss your product .
=> Sieg Machines
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
=> One on one phone support.
=> Forum suggestions and report forum problems.
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
Loading...