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)
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
Quote:
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"
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....
Re: OSP-300 how to delete file
Quote:
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 works only with strings ( 0 < length <= 16 )
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 :)
1 Attachment(s)
Re: OSP-300 how to delete file
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 :)
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 !!! :)
1 Attachment(s)
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 )
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?
Quote:
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.
Quote:
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 :)
Re: OSP-300 how to delete file
Quote:
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 :)
Quote:
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 ...
Quote:
I exactly work on OSP-P300SA
most of my time goes into p300 :)
Quote:
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
Quote:
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
Quote:
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 !!! '
)
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.
Quote:
- you may use more than 1 put / line of code : PUT ' this ' PUT ' is ' PUT ' sparta !!! '
but this work perfectly! thanks a lot!
Re: OSP-300 how to delete file
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
Quote:
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
Quote:
it's work wright and give me what I want.
i guess is all ok for now :)
Re: OSP-300 how to delete file
Quote:
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.
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 :)
Re: OSP-300 how to delete file
Quote:
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 :D
1 Attachment(s)
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