Hello Guest it is March 28, 2024, 12:39:32 PM

Author Topic: Export coordinates with machining time in .txt file  (Read 17841 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Export coordinates with machining time in .txt file
« Reply #10 on: May 18, 2008, 07: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
fun times
Re: Export coordinates with machining time in .txt file
« Reply #11 on: May 19, 2008, 10: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.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Export coordinates with machining time in .txt file
« Reply #12 on: May 19, 2008, 11: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
fun times
Re: Export coordinates with machining time in .txt file
« Reply #13 on: May 19, 2008, 12:20:44 PM »
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
Re: Export coordinates with machining time in .txt file
« Reply #14 on: December 17, 2015, 04:01:43 PM »
This is great, is it possible to record the position one below the other and that does not erase the previous row
greeting
Re: Export coordinates with machining time in .txt file
« Reply #15 on: April 14, 2019, 08:24:02 AM »
This VB code didn't work me. It couldn't import the coodinate in txt file. Please   Can somebody help me?

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Export coordinates with machining time in .txt file
« Reply #16 on: April 15, 2019, 01:34:55 AM »
has the file "c:\TESTFILE.txt" been created ?
how do you call the code?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Export coordinates with machining time in .txt file
« Reply #17 on: April 15, 2019, 03:28:17 AM »
yes the file has been created, but only 1 line (x-y-z) coordinate was export in this file.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Export coordinates with machining time in .txt file
« Reply #18 on: April 15, 2019, 03:40:51 AM »
then replace:
Open "c:\TESTFILE.txt" For Output As #1 ' Open to write file

by:
Open "c:\TESTFILE.txt" For Append As #1 ' Open to write file
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Export coordinates with machining time in .txt file
« Reply #19 on: April 15, 2019, 09:35:42 AM »
Thanks ! But there is an other problem. The first and the last coordinates are multipled. And do you have idea to export the samling time to every export coordinate?