Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 10:44:56 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
| | |-+  Export coordinates with machining time in .txt file
Pages: « 1 2   Go Down
Print
Author Topic: Export coordinates with machining time in .txt file  (Read 1116 times)
0 Members and 1 Guest are viewing this topic.
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« Reply #10 on: May 18, 2008, 06:30:18 PM »

Perhaps you can store a copy of the X, y, z value as an "Old Value toward the end of the loop. you could then compare the new value verses the old value, if they are different then in the if code compare, the write function would execute. If they where = then the If would drop out that has the write in it. and thus not write the change.

scott
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.
vansyle
Active Member

Offline Offline

Posts: 6


View Profile
« Reply #11 on: May 19, 2008, 09:56:47 AM »

Thank your very much.
Scott... Good idea, I solved this problem. it is very important that the pulses must be synchronised. My VB Script can save all of coordinates when tool is moving.

Best regards.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« Reply #12 on: May 19, 2008, 10:36:57 AM »

So Others may benefit, if you solved it, post your code.

I would like to see what changes you made, others here might want to do similar things.

We (as a group), try to post solutions since somebody, somewhere will have that same issue.

Unless your stuff is secret or something.

scott
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.
vansyle
Active Member

Offline Offline

Posts: 6


View Profile
« Reply #13 on: May 19, 2008, 11:20:44 AM »

I completely support to your idea about posting solutions. Anybody can refer these code for their applications. This is my code to get coordinates:

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

Thank you for your helps
Best Regards
Van Sy
Logged
Pages: « 1 2   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!