Hello Guest it is April 18, 2024, 10:45:16 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - vansyle

Pages: 1
1
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

2
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.

3
@Scott:
Thanks for your help. I trying with your way but coordinates are still repeated as old one. I tried to increase/decrease Pulse time B / Delay till Repeat C through vaules 1, 0.1, 0.01 / 0.1, 0.001, 2 and run program. The results seem to be influenced by changing these values.

@RonGinger
these values in G-Code are not interpreted by my program. For example: G03 X1.Y2 I2.J3 only expresses  start-end and center points of circular arc, it not expresses the coordinates which tool is going pass on this circle. I want to grab these coordinates in interval and reconstruct circle by my Matlab. Matlab can    make smoothly from received coordinates. Thus, I only need grab interval of coordinates.
Do you know which tool can convert G-Code into coordinate values of X,Y,Z?

Thanks   

4
Thanks for your reply,

I want to save these coordinates as input datum of Malab to simulate cutting process. Exactly, I don't need all of coordinates, i only need to "snap" coordinates in interval as Scott said. My Matlab program can make smoothly toolpath from the saved coordinates.

Following Scott, I made a Userled and use pressing button to turn on/off this led as:

test = GetUserLED (1005)
If (test = false) Then
  Call SetUserLED (1005, 1)
Else
   Call SetUserLED (1005, 0)
End If 

And VB Script to save coordinates as:

Sub Main ()
 
Open "c:\TESTFILE.txt" For Output As #1 ' Open to write file.

Do While GetUserLED (1005)

    x = GetOEMDRO (800)
    y = GetOEMDRO (801)
    z = GetOEMDRO (802)     
    Write #1, x , y, z
   
Loop
Close #1
End Sub

The results are similar to previous one. could you help me ?
 


5
Thanks for your reply.

My model is very simple (100x100x30mm), and my program includes 30 commandlines. I don't know how to use C++ . I am trying make small program after reading Help.

Sub Main ()

Open "c:\TESTFILE.txt" For Output As #1 ' Open to write file.

 While IsMoving ()

    x = GetOEMDRO (800)
    y = GetOEMDRO (801)
    z = GetOEMDRO (802)
   
    Write #1, x , y, z
 Wend
Close #1
End Sub

And i received x,y,z coordinates but they are repeated many times.
60.263,-66.377,-1
60.263,-66.377,-1
60.263,-66.377,-1
60.263,-66.377,-1
60.263,-66.377,-1
....,....,....
60.064,-66.445,-1
60.064,-66.445,-1
60.064,-66.445,-1
60.064,-66.445,-1
60.064,-66.445,-1
...,....,....
59.856,-66.516,-1
59.856,-66.516,-1
59.856,-66.516,-1
59.856,-66.516,-1
59.856,-66.516,-1
................

Could you help me?     

6
Dear, Everybody

I saw values of x,y,z coodinates displayed on DROs when the program runs. How can i export all of these values with machining time. Anybody know which function and its using can do that, please tell me. Thank you very much
Best regards.

Pages: 1