text data to G code?


Results 1 to 15 of 15

Thread: text data to G code?

  1. #1
    Member zcases's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    345
    Downloads
    0
    Uploads
    0

    Default text data to G code?

    I have a large file of X, Y and Z coordinates (too many rows of data for Excel!). Does anyone know a good way to add the appropriate G code to each piece of data?

    For example.....the raw text file is just the numbers, say, 1000, 5000, 200 (in X, Y, Z order). I want to find a way to have each line look formatted like - G1 X1000 Y5000 Z200.

    Any ideas? It would also be good if I could do math on it and get it scaled for my table. Sounds like I need to hire a programmer?

    Thanks
    Scott

    Similar Threads:


  2. #2
    Registered
    Join Date
    Apr 2004
    Location
    Wartrace, TN
    Posts
    162
    Downloads
    5
    Uploads
    0

    Default Math & Formatting on the Data files..

    Question 1: What format is the file in? is it a plain ASCII Text file?

    Question 2: What version of Windows are you running? if I recall correctly, Windows98 still contained the QBASIC file in the WINDOWS/COMMAND directory. If I am correct in that, I could whip together a quick program to do whatever you need to the data..

    do a search of your system, and see if it contains a file containing QB.EXE or QBASIC.EXE, and we can go from there.. Unfortunately, i have quit programmin, so I keep no compilers installed any longer..

    Eddie

    OH YEAH .. what is the formatting of the file?

    is it, for example:

    100,2300,245
    126,2234,567

    or is it:

    100 2300 245
    126 2234 567

    these two are referred to as Comma Delimited and Space Delimited respectively. There are also formats that place quotes around each value..



  3. #3
    Member zcases's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    345
    Downloads
    0
    Uploads
    0

    Default

    Eddy -
    1) I believe its a plain ASCII. I can read it with notepad. It is space delimited, and comes into excel nicely, but excel only has about 65K rows and it chops off a lot of the data. I have ~260K rows!
    2) I have a bunch of computers and just upgraded them to XP. I cannot find anything with the search "QB". I could power up an old computer with 98 on it later and look there.



  4. #4
    Registered MetLHead's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    765
    Downloads
    0
    Uploads
    0

    Default

    Scott,

    I will put together a program to do this for you and post it later today.

    Could you post a sample file?

    Regards,
    Scott



  5. #5
    Member zcases's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    345
    Downloads
    0
    Uploads
    0

    Default

    Geez - fantastic MetLHead. I can't believe the wealth of information on the CNCZone. Two other considerations.......

    1)Is there a way to do scaling and offsets on the raw data?
    2)This one gets tricky......The way the raw data is sorted.....I either need to put in a line every so often to lift z to go back and begin the next cut (maybe I could tell it to do this every "n'th" line)? Or - is there a way to re-sort the data so the cut can go back and forth? Seems like this would be more difficult. Know what I mean?

    I feel like a beggar who is also trying to chose.

    Attached Files Attached Files


  6. #6
    Registered MetLHead's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    765
    Downloads
    0
    Uploads
    0

    Default

    Scott,

    Here it is, version 1.0000 of Point2GCode

    Give it a try and let me know if there's anything you need changed.

    Regards,
    Scott

    Attached Files Attached Files


  7. #7
    Member zcases's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    345
    Downloads
    0
    Uploads
    0

    Default

    MetLHead - that is excellent, I am impressed! Is it possible to scale Z with a different value than the x,y, scale? Look for a PM also...........



  8. #8
    Registered MetLHead's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    765
    Downloads
    0
    Uploads
    0

    Default

    Here's an update for the Points2GCode program. This update adds the Z Scale factor seperate from XY.

    Scott

    Attached Files Attached Files


  9. #9
    Member zcases's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    345
    Downloads
    0
    Uploads
    0

    Default

    Geez MetLHead your good. I owe you....................



  10. #10
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    180
    Downloads
    0
    Uploads
    0

    Default

    MetlHead- What programming language do you use?



  11. #11
    Registered MetLHead's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    765
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by rweatherly
    MetlHead- What programming language do you use?
    This was written in Visual Basic. It's based on a file converter template that I use once in a while. I've attached the VB source for anyone who's interested.

    Scott

    Attached Files Attached Files


  12. #12
    Member zcases's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    345
    Downloads
    0
    Uploads
    0

    Default

    So far I find this works very well. It does exactly what I want, as long as I calculate the offsets and scaling properly it does a great job.



  13. #13
    Registered
    Join Date
    May 2004
    Location
    United States
    Posts
    314
    Downloads
    0
    Uploads
    0

    Default

    hey metlhead, thats cool that you could help out on that deal. I have a cnc related programming issue that maybe you could address, it wouldnt be as easy a project as this, but if it works it could be a money maker. contact me at erase42@Aol.com

    ED



  14. #14
    Registered
    Join Date
    Oct 2006
    Location
    South Africa
    Posts
    48
    Downloads
    0
    Uploads
    0

    Default

    Hey.. Not to take any glory away from MetLHead and his fantastic program... but just to comment... Excel can store 65k rows.. the new excel (2007) i think can store 350k... (stand to be corrected).. alternatively, you can use similar commands from excel and just import your data into Access, and you will be virtually unlimited to the number of rows that you can use... the reason why i mention this is because you can also develop VB applications from within Ms Access or Excel and you will not need to have the full VB package..

    Just a comment. i am not implying that this is in any way better than a custom built application that reads the txt file automatically



  15. #15
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    180
    Downloads
    0
    Uploads
    0

    Default

    I use VB in Excel all of the time -- you just can't make a stand-alone program (like MetLHead's) with it. But to overcome the 65K line limit, just forget importing the data. Read from the file to be converted, and write the G-code to a new file.



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

text data to G code?

text data to G code?