CamBam number format


Results 1 to 10 of 10

Thread: CamBam number format

  1. #1
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default CamBam number format

    I normally work in millimeters on a Mach3 CNC mill. So my program looks like this:

    Code:
    G0 X123.456 (rapid move to X=123.456mm)
    Problem is, now I need to generate a program for a Syntec machine that works in thousandths of a millimeter. So I need my program to look like this:

    Code:
    G0 X123456 (rapid move to 123456/1000 = 123.456mm)
    I can make CamBam output exactly 3 decimal places after the point by tweaking the post processor:

    Code:
    <NumberFormat>0.000</NumberFormat>
    But how do I get rid of the decimal point, short of doing "Search and replace" in a text editor?

    Similar Threads:


  2. #2
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: CamBam number format

    hope attached finds you well

    Attached Thumbnails Attached Thumbnails CamBam number format-untitled-png  
    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  3. #3
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: CamBam number format

    Quote Originally Posted by deadlykitten View Post
    hope attached finds you well
    Thanks Kitten, but Find/Replace is exactly what I was hoping to avoid.



  4. #4
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: CamBam number format

    then how else you wanna fix it in a text editor ? aaaa, you mean to edit the post ... sorry, can't help with that

    but i can create a small program, to fix your file / background work service

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  5. #5
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: CamBam number format

    Thanks for the offer Kitten, but that would be overkill. I only had 3 programs to make for the Syntec, so I did it in the text editor.

    Still would be nice to find a solution for the post processor though.



  6. #6
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: CamBam number format

    i no longer deal with posts edit ... regardless of cam, as long as its generates a file, i can take it from there

    all this methods for post edit, different implementations, diff softwares ... is a mini madness, even if you know them all not to mention the duration of learn curves

    so, there is a common part in all of them, if you can see it

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  7. #7
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: CamBam number format

    I wrote a Powershell script that converts all numbers for X, Y, Z, A, I, J (but leaves alone F).

    I wonder if there is a way to run the script automatically from the post processor? I think I might have seen something like that in the CamBam documentation...

    Code:
    rem Processes all .nc files in the current directory.
    rem Replaces X123.456 with X123456 for my Syntec controller
    
    for %%a in (*.nc) do (
    echo %%a
    powershell -Command "(gc %%a) -replace '([X|Y|Z|A|I|J]\-?\d{1,4})(\.)(\d\d\d)', '$1$3' | Out-File -encoding ASCII %%~na-Syntec%%~xa" )




  8. #8
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: CamBam number format

    so it simply scans all *.nc files, and replaces all X***.*** with X***** ? who runs it ? you have to execute it manually ?

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  9. #9
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: CamBam number format

    Quote Originally Posted by deadlykitten View Post
    so it simply scans all *.nc files, and replaces all X***.*** with X***** ?
    Yes. The results are saved as new files ("-Syntec" is added to the original file name). The original files remain intact.


    who runs it ? you have to execute it manually ?
    For now I run it manually after posting a program. There might be a way to automate it in CamBam, I don't know for sure yet.



  10. #10
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: CamBam number format

    hy citizen ( of dreams ) i automate by creating a service, or having exe hidden startup run, then loop repeat

    having them to fix post files, idea come when someone complained about having to fix the file each time after post

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


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

CamBam number format

CamBam number format