Hello Guest it is April 26, 2024, 11:18:24 AM

Author Topic: Digitizer output comand?  (Read 6487 times)

0 Members and 1 Guest are viewing this topic.

Digitizer output comand?
« on: November 03, 2012, 03:00:13 PM »
Is there a macro/command to output the current XYZ and A/4th encoder DROs to a txt file?
Built a large digitizing machine and want to update a file to read into ACAD.
If not can somebody post an example macro?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Digitizer output comand?
« Reply #1 on: November 03, 2012, 04:25:23 PM »
From a CB script use

OpenDigFile()
CloseDigFIle()

From a G code file use

M40
M41

(;-) TP
Re: Digitizer output comand?
« Reply #2 on: November 03, 2012, 08:45:11 PM »
Ok, that opens a file... but what do I use to write the current encoder position DROs to a line in the file?
 

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Digitizer output comand?
« Reply #3 on: November 03, 2012, 10:21:23 PM »
Those processes are for using the G31 probe routine and they record the Trip position of the probe tip. IF you are going to use a probe to gather the data then when you open the file MACH3 writes to that file automatically on each probe trip Until you close the file.

IF you are going to gather data any other way you will have to write your OWN script(plugin or CB macro) to record the data to a file.

Hope that helps, TP
Re: Digitizer output comand?
« Reply #4 on: November 04, 2012, 12:54:22 AM »
If I manually "trip" the probe input via hotkey, it should record the current position... right?
What makes the choice to record the Encoder DRO or the Machine postion DRO ?

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Digitizer output comand?
« Reply #5 on: November 04, 2012, 07:13:29 AM »
If I manually "trip" the probe input via hotkey, it should record the current position... right?

Only if your in the middle of a G31 move.
Quote
What makes the choice to record the Encoder DRO or the Machine postion DRO ?

There is no choice. It will only write the coordinates from the position DRO's.

As Terry said, you're probably going to need to write your own macro to do what you want.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Digitizer output comand?
« Reply #6 on: November 04, 2012, 09:20:07 AM »
Exactly HOW do you plan to use your machine to digitize a part. Maybe we can help.

(;-) TP
Re: Digitizer output comand?
« Reply #7 on: November 04, 2012, 12:07:22 PM »
I've written some macros but I have no clue what the command to write the Encoder DROs to a file would look like.
I have a visual laser probe and once I have it aligned I would like to push a button or hotkey to write the cords.
Anybody care to post what the write command would look like>?
Re: Digitizer output comand?
« Reply #8 on: November 04, 2012, 02:19:22 PM »
N/M
With some hacking and the power of google I've answered my own issue.
M103
Code: [Select]
Open "M:\digitize\currentproject.txt" For Append As #1
  X = GetDRO(170)
  Y = GetDRO(171)
  Z = GetDRO(172)
  Print #1, X,",",Y,",", Z
  Close #1
Now all I need to do is make an M103 button.

I do have one more question tho, can I hook this M-code to an input?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Digitizer output comand?
« Reply #9 on: November 04, 2012, 03:13:30 PM »
SUre,

If Isactive(input1) then

   Open "M:\digitize\currentproject.txt" For Append As #1
  X = GetDRO(170)
  Y = GetDRO(171)
  Z = GetDRO(172)
  Print #1, X,",",Y,",", Z
  Close #1

End If
End


But there MAY be an easier way, Let me check back through some notes when I was working on a MACH3 CMM Machine. What I did was use the M40 function to open the Points FIle and then use a G31 call to nowhere to force MAch3 to write the point values to the file for me. Then move to where ever is next and make the call again.  It worked well back then just not sure of the call I created .

(;-) TP