OSP-300 how to delete file


Results 1 to 15 of 15

Thread: OSP-300 how to delete file

  1. #1
    Member mikrej's Avatar
    Join Date
    Aug 2020
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default OSP-300 how to delete file

    Hi,

    I work on Okuma Multus U3000 witf Renishaw probe RMP60.
    Every measuring are send to file RESULTS.TXT.
    But after every each of part I do the measures are write after previous part.
    I wanna do Macro witch in front of the cnc program will be erase file RESULTS.TXT or delete this file.

    Is this possible at all ?

    Thanks af any advice.

    (I'm new. Sorry if I wrote in wrong section)

    Similar Threads:


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

    Default Re: OSP-300 how to delete file

    hy use an in-file search to find " fwritc results.txt ", then replace ;A with ;C

    A : previous data is stored
    C : previous data is deleted

    string should be inside a *.msb, but don't go this way if you don't know this technique; at least back-up the file 1st

    like this, the file will store only data from the last probing session

    I wanna do Macro witch in front of the cnc program will be erase file RESULTS.TXT or delete this file
    i am afraid that what you wish for can not be done through code :
    ... file-operations are targeting file content, not file-self, thus you may read/write content, but not delete a file
    ... is not possible to write an empty buffer, thus is not possible to create a file with 0 size

    you may, however, write a space char :

    Code:
    [ file : erase.min ]
    
        FWRITC results.txt;C
      ( NOEX )  PUT " "
        WRITE C
      ( CLOSE C )
    
    M02
    if above code:
    ... works fine, then try to activate also "noex"
    ... does not work, then activate "close c" and/or use caps for file name ( RESULTS.TXT )

    kindly

    ps : PUT "max 16 chars"

    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


  3. #3
    Member mikrej's Avatar
    Join Date
    Aug 2020
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: OSP-300 how to delete file

    "hy use an in-file search to find " fwritc results.txt ", then replace ;A with ;C

    A : previous data is stored
    C : previous data is deleted"

    yes, but this work with RENW command. In one part I have 18 measures.
    Everytime when I use RENW the data will be erase.

    I want to save 18 measures and on end of part printing results of probing and after that erasing file for next part.

    One part - 18 maesure - one raport - erasing = so entering a space isn't a solution for me...

    Thanks anyway for Your time


    EDIT:

    Also I tried;

    FWRITC results.txt;C
    ( NOEX ) PUT " "
    WRITE C
    ( CLOSE C )


    but I don't know how correctly PUT backspace from ASCII table. And loop it 1000 times. And with this solution get what I want. But still I have an error with wrong syntax.

    VDOUT want work correctly with PUT.
    When I use

    PUT [2],08

    I have an error then I dont have VDOUT

    but when I used that together

    VDOUT PUT [2],08

    I have error about wrong syntax...

    VDOUT [2],08 - also want work....

    Last edited by mikrej; 08-13-2020 at 04:08 PM.


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

    Default Re: OSP-300 how to delete file

    I want to save 18 measures and on end of part printing results of probing and after that erasing file for next part.

    One part - 18 maesure - one raport - erasing = so entering a space isn't a solution for me...
    delete* the file at program start, or right before the 1st measurement

    also, if you are printing through code, then delete* the file after the printing operation ( but this won't work if printer failed )

    delete* = write space

    PUT backspace
    put works only with strings ( 0 < length <= 16 )

    PUT [2],08
    put [] is not allowed, but only put "your_string_here" or put variable/local variable

    V1=2
    PUT V1
    will write " 2" or " 2";i don't remember exactly the default length for numbers

    V1=2
    PUT V1,3
    will write " 2"

    PUT V1,3 is equivalent to PUT V1 , 3 but this is not relevant for your situation

    ps : i don't think you can use vdout in file-operations; is late for me

    Last edited by deadlykitten; 08-13-2020 at 04:17 PM.
    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


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

    Default Re: OSP-300 how to delete file

    backspace
    hello, next code uses a backspace hex ( see attached ), but unfortunatelly it does not work

    Code:
        FWRITC a3.txt;C
        PUT '123'
        WRITE C
        PUT '456'
        PUT $08
        WRITE C
        CLOSE C
    however, even if it would work, it may only affect the current buffer that is sent to the file, and not the existing content



    another solution would be to find the procedure that writes data to results.txt ( i guess is inside a *.msb ), see what variables it uses, and simply copy them using g-code, and create a file how you like ( i have done that in order to create custom probing procedures )

    if you could read those variables, then you will no longer need results.txt; somehow is possible to disable the creation of results.txt, thus there may be a setting to disable printing probing results to a file ( this setting exists on newer machines )



    last, but not least, write a space before the set of those 18 measurements / kindly

    Attached Thumbnails Attached Thumbnails OSP-300 how to delete file-untitled-png  
    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


  6. #6
    Member mikrej's Avatar
    Join Date
    Aug 2020
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: OSP-300 how to delete file

    Hi, today I was in work and for me perfectly work

    Code:
    FWRITC MD1:RESULTS.TXT;C
    PUT $08
    WRITE C
    CLOSE C
    Thanks a lot for Your help !!!



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

    Default Re: OSP-300 how to delete file

    hello again it worked, not because of $08, but because of ;C

    you may replace $08 with a space, or any char, and in the end file size should be 3 bytes ( the char that you used in put + end of line + new line )

    i have run a few tests, in order to see if $08 works, and it failed ( attached shows files created by this code ) :

    Code:
    ( this test checks if $08 can delete chars from current buffer )
    ( final content should be '123'+new_line+'45', but $08 does not work, so there is also displayed '6' and also the $08 char )
    
        FWRITC a1.txt;C
        PUT '123'
        WRITE C
        PUT '456'
        PUT $08
        WRITE C
        CLOSE C
    
    
    ( these test checks if $08 can delete chars from existing content )
    ( 1st is created a file with content '123'+new_line+'456' )
    
        FWRITC a2.txt;C
        PUT '123'
        WRITE C
        PUT '456'
        WRITE C
        CLOSE C
    
    ( this tries to open the above created file, and delete a char from it's content )
    ( code fails, and by so, '6' still remains inside the file, and also $08 is displayed )  
    
    
        FWRITC a2.txt;A
        PUT $08
        WRITE C
        CLOSE C
    
    with okuma g-code, i recomand writing only read-able text inside a file



    so far, this is it with file-operations, but if you target probing results in order to create a list of measurement, you may futher more customize it by using excel; imagine that after the measurement, an xls file is generated, with layout as you wish, and also results coments, like "ok", "towards minus", "0.02 under lower limit", etc ... this speeds up the reading&interpretation, thus imagine that you see a column that is all green : you will no longer care what values are the actual measurements, simply because you see in <1second that all are ok

    okuma osp comes with excel, so such reports can be created on the machine / kindly

    ps : you may use FWRITC results.txt;C instead of FWRITC MD1:RESULTS.TXT;C ... all files are written to MD1( so far i never succed in writing to a different path ), so no need to specify it, and CAPS are not a must ( at least for osp-p300 )

    Attached Thumbnails Attached Thumbnails OSP-300 how to delete file-untitled-png  
    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


  8. #8
    Member mikrej's Avatar
    Join Date
    Aug 2020
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: OSP-300 how to delete file

    Ok.

    So, if I want to add to beginning of the measures file for each part something like this:

    Code:
    FWRITC results.txt;C
    PUT 'NAME OF DETAL'
    WRITE C
    PUT 'NUMBER OF OPERATION'
    WRITE C
    PUT 'SERIES:__________'
    WRITE C
    PUT 'PART:_________'
    WRITE C
    CLOSE C
    (yes, only 16 chars for one PUT command)

    It will be all what I want because of using ;C parameter, yes?


    ps : you may use FWRITC results.txt;C instead of FWRITC MD1:RESULTS.TXT;C ... all files are written to MD1( so far i never succed in writing to a different path ), so no need to specify it, and CAPS are not a must ( at least for osp-p300 )
    I exactly work on OSP-P300SA.


    so far, this is it with file-operations, but if you target probing results in order to create a list of measurement, you may futher more customize it by using excel; imagine that after the measurement, an xls file is generated, with layout as you wish, and also results coments, like "ok", "towards minus", "0.02 under lower limit", etc ... this speeds up the reading&interpretation, thus imagine that you see a column that is all green : you will no longer care what values are the actual measurements, simply because you see in <1second that all are ok
    In my company we have a monocolor printers and ultimately in neerest future we won't have access to machine eccept basic function (the keys will be taken), but this is tempting vision to use

    Once again thanks for all Your advices

    Last edited by mikrej; 08-17-2020 at 04:41 PM.


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

    Default Re: OSP-300 how to delete file

    It will be all what I want because of using ;C parameter, yes?
    yup, ;C simply vanishes current file content ... is like the file was never there

    So, if I want to add to beginning of the measures file for each part something like this:
    that code looks ok at the bottom, you may find a futher development ...

    I exactly work on OSP-P300SA
    most of my time goes into p300

    this is tempting vision to use
    using an xls works nice, but there is possible to create a custom file also by g-code : thus, you may check and comment your measurements through g-code, and create a report that is fast to inspect; imagine that you see a column full of "okeys", or "go", etc, and simply no longer care about absolute measurements values

    thus is possible to read results.txt, analyze it's data, and create a report, by using g-code

    ultimately in neerest future we won't have access to machine eccept basic function (the keys will be taken)
    protection is ok for proofed setups, but still is needed to analyze each reason of downtime, thus is needed to analyze the feed-back from the machine ... protection without feed-back is not ok

    there are methods to :
    ... protect, even if keys are still there
    ... edit, even if keys are gone
    * so is relative

    i think that is all fine as long as you are able to test whatever you wish

    Once again thanks for all Your advices


    Code:
    
    (
        you can write A-Z and a-z, thus smalls and CAPS
        i like to indent code
    )
    
    
        FWRITC results1.txt;C
        PUT ' detail'
        WRITE C
        PUT ' operation'
        WRITE C
        PUT ' series : '
        WRITE C
        PUT ' part : '
        WRITE C
        CLOSE C
    
    
    (
        PUT handles 16chars maximum, but is
    possible to write longer lines, by using
    at least 2 PUT's
        next code output's same text as
    previous, only that it will all be
    on a single line
        however, there is a line length limit
        last time i checked, it was :
           - 1000 chars for p300
           -  160 chars for p200
           * earlier p300's couldn't handle more than 160,
          but that was fixed among the way
    )
    
    
        FWRITC results2.txt;C
        PUT ' detail'
        PUT ' operation'
        PUT ' series : '
        PUT ' part : '
        WRITE C
        CLOSE C
    
    
    (
        next code outputs same result as the 1st
    one, only that it performs noex-faster
    )
    
    
        FWRITC results3.txt;C
        NOEX PUT ' detail'
        WRITE C
        NOEX PUT ' operation'
        WRITE C
        NOEX PUT ' series : '
        WRITE C
        NOEX PUT ' part : '
        WRITE C
        CLOSE C
    
    
    (
        this one performs even faster
    because WRITE C is used only once, even
    if there will be written multiple lines
       WRITE C writes the buffer to the file
    and creates a new line; you may create a
    new line also by using PUT $0D0A
       in the end is still required a WRITE C
    in order to write the buffer to the file
        WRITE C performs slower than PUT,
    because it needs to print the buffer to
    the file-phisical-path, while PUT only
    writes chars to the buffer-virtual-variable
        final result, thus the file, may look
    to have separate lines, or maybe 1 single
    line, depending how your text-editor behaves
        also, file layout may change from
    multiple lines to single line only after
    it had been opened with a text editor; it
    sounds a bit weird, like file may get messed
    only if it is opened, so why would one create
    a file that is not stable ? but the purpose
    is to shorten g-code duration, and use a 3rd
    application to read the output file, thus to
    avoid file handling by a person; this trick
    may be too much for a few probing results, but
    it comes in handy when you record many data from
    the machine, in order to create time-charts
        i use timecharts, in order to detect anomalies
    when a program runs, thus i may locate a donwtime
    even if an operator is not noticing it; it's a nice way
    to play it smooth, non-intrusive
    )
    
    
        FWRITC results4.txt;C
        NOEX PUT ' detail'
        NOEX PUT '$0D0A' 
        NOEX PUT ' operation'
        NOEX PUT '$0D0A' 
        NOEX PUT ' series : '
        NOEX PUT '$0D0A' 
        NOEX PUT ' part : '
        WRITE C
        CLOSE C
    
    
    (
        last but not least, a few
    cosmetic tips :
         - you may write tabs : PUT '    '  that's a tab, not many spaces :]
         - you may use more than 1 put / line of code : PUT ' this ' PUT ' is ' PUT ' sparta !!! '
    )


    Last edited by deadlykitten; 08-18-2020 at 03:55 AM.
    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


  10. #10
    Member mikrej's Avatar
    Join Date
    Aug 2020
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: OSP-300 how to delete file

    Code:
    FWRITC results4.txt;C
        NOEX PUT ' detail'
        NOEX PUT '$0D0A' 
        NOEX PUT ' operation'
        NOEX PUT '$0D0A' 
        NOEX PUT ' series : '
        NOEX PUT '$0D0A' 
        NOEX PUT ' part : '
        WRITE C
        CLOSE C
    this causes weird chars in RESULTS.TXT file.

    but if I use:


    Code:
    FWRITC results3.txt;C
        NOEX PUT ' detail'
        WRITE C
        NOEX PUT ' operation'
        WRITE C
        NOEX PUT ' series : '
        WRITE C
        NOEX PUT ' part : '
        WRITE C
        CLOSE C
    it's work wright and give me what I want.


    And how do You print measures results? It is nessecery to has speciffing code in .MIN program or it must be doing manually?
    It's just started in my company and I don't any idea how it would to looks like.


    - you may use more than 1 put / line of code : PUT ' this ' PUT ' is ' PUT ' sparta !!! '
    but this work perfectly! thanks a lot!



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

    Default Re: OSP-300 how to delete file

    weird chars
    yes, it may happen, depending on text-editor... i only shared to show what is possible : there are ways to shorten duration for file-operations, and files created on the machine may be paired with custom software, or even analized with g-code

    print measures results?
    you can print that file like any other file, since osp is running on windows

    on older models, it was possible to print from g-code, having a printer conected to the machine; there is a printing example inside the manual, but no need to worry with actual osp

    it's work wright and give me what I want.
    i guess is all ok for now

    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


  12. #12
    Member mikrej's Avatar
    Join Date
    Aug 2020
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: OSP-300 how to delete file

    okuma osp comes with Excel
    on my machine doesn't exist Excel program. It is a problem with create .xls file from .MIN program? (maybe it is a very stupid question, I know...)

    EDIT:

    however, sorry for my poor english. I hope You understand me enough.



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

    Default Re: OSP-300 how to delete file

    hy, machine options are not always the same, it depends on dealer, region/location, etc

    i have received excel cd, documentation, xls files for probing and example of full machine setup template

    however, you may install xls on the machine, or simply, you may use the xls that you allready have on your pc

    i will try to send you some files related to probing measurement interpretation, so to have a clue

    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


  14. #14
    Member mikrej's Avatar
    Join Date
    Aug 2020
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: OSP-300 how to delete file

    i will try to send you some files related to probing measurement interpretation, so to have a clue
    I will be very approciete of cource. It could tell me anything about that and I'll could test it, which I loved to do that

    Last edited by mikrej; 08-19-2020 at 04:41 PM.


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

    Default Re: OSP-300 how to delete file

    hy please find attached example about what can be done using g-code; with excel, can be added more formatting, maybe traffic lights, etc

    if you wish for something, just say / kindly

    ps : sorry if the image seems too crowded ... text file is more airy; i had to squeeze all those, so to avoid image compresion when uploading

    Attached Thumbnails Attached Thumbnails OSP-300 how to delete file-untitled-png  
    Last edited by deadlykitten; 08-24-2020 at 06:04 PM.
    the human body has enough iron to make a nail ... i can also make the hammer :) i mean a plastic hammer


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

OSP-300 how to delete file

OSP-300 how to delete file

OSP-300 how to delete file