I have a Okuma LB 12 with OSP 500-LG controls, I running the loop program with this,
N11 V01=1
N112 V01=V01+1
( PROGRAM )
/ IF [ V1 LE ? ] N112
M2
( ? number of parts )
But for the life of me I cant figure out where the part counter is, and if I interupt the loop by reseting the count starts over.
Does any one know how to bring up the counter, and keep the count the same even after reseting.
Similar Threads:
hello bob i will begin with the code that you shared
it is messy ... i have written a few tips below + some explanations
about your question, i will open a new thread; pls check it out / kindly
Code:( original ) N11 V01=1 N112 V01=V01+1 ( PROGRAM ) / IF [ V1 LE ? ] N112 M2 ( ? number of parts ) ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ( removing not needed addresses ) ( initalizing counter with ZERO instead of ONE ) ( replacing V1 with V01; because god of simetry ) ( removing bottom comment; way too obvious ) ( M02 instead of M2; adding leading zeros, because also V01 is written like that ) (using leading zeros from time to time, means that the mind loses focus when is writing codes ) ( is a simple task, so try to make it always the same ) ( also, using leading zeros from time to time, affects code simetry; it can not be read fluidly ) V01 = 0 N000 V01 = V01+1 ( PROGRAM ) / IF [ V01 LE ? ] N000 M02 ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ( replacing ? with variable ) ( spaces arround + ) V02 = 30 V01 = 0 N000 V01 = V01 + 1 ( PROGRAM ) / IF [ V01 LE V02 ] N000 M02 ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ( kitty default : 4 blanks for indentation ) ( blank lines insert + '(*)' between V02 and the rest of the code ) ( this is intended to separate editable variables from the rest of the code ) V02 = 30 ( * ) V01 = 0 N000 V01 = V01 + 1 ( PROGRAM ) / IF [ V01 LE V02 ] N000 M02 ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ( using / only to toogle counter behaviour may affect other places where / would be required ) ( i recomand avoiding / for looping ) ( initialize V02 with 0 or 1 ) V02 = 0 or 1 ( * ) V01 = 0 N000 V01 = V01 + 1 ( PROGRAM ) IF [ V01 LE V02 ] N000 M02 ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ( is not ok to have the counting line near the begining of the program ) ( move it near the end, so to count "executed parts", and not to count "begining of executing" ) V02 = 0 or 1 ( * ) V01 = 0 N000 // program V01 = V01 + 1 IF [ V01 LE V02 ] N000 M02 ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ( check also this equivalent sample, that does not use explicit conditional and counting codes ) ( you achieve same result, with less code ) ( you may also use *.sdf files ) CALL OSUB Q30 M02 OSUB RTS ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ( if you wish to use /, so to toogle counting behaviour from cnc panel buttons, thus ) (without editing the code, pls consider that there are some methods ) ( they work on newer osps, but maybe also on elder osps can be found some alternatives ) ( however, toogling counting behaviour without editing the code seem a bit low-life ) ( thus it seems to be an inappropriate solution, for a problem with unknown causes )
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 ...
ok, i am done :
... in that new thread, you have general directions about counting parts
... in previous reply, you have samples about updating your code; pls check especially the one written with blue
well, accordingly to your code, the counter is always increased before begining to cutBut for the life of me I cant figure out where the part counter is
you can check it's value inside the parameter page; if it shows 17, it means that you have 16parts completed, and the 17th is being cut
if you don't have buff-prohibit codes, then is really hard to follow ... so be sure that the counting sequence is buffer-prohibited, thus the counter is not going way in front of the real situation
another way to deal with this, is to simply count the real parts; if this can not be done ( for example there are many parts being cut during a small period of time ), then you definetly need to buff-prohibit the counter
1) stop initalizing the counting inside your main program; do it in a different program ( solution 3 in here : https://www.cnczone.com/forums/okuma...ml#post2232934 ), or manually reset it inside the paramter pageif I interupt the loop by reseting the count starts over
2) tune your program ( solution 2 in here : https://www.cnczone.com/forums/okuma...ml#post2232934 )
3) some cnc's have a default counter; if it is there, try to use it; i never use it, because it will lead to downtime for me; i invest time in codes, so to make life easier on the long-run
buff-prohibit proof counting; i also recomand you to move V1=V1+1 near the end of the program, so to count finished parts / kindlyDoes any one know how to bring up the counter, and keep the count the same even after reseting
ps : always listen to kurmay
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 ...
Thank you, very much
okey, i hope you find something usefull
if you have questions, pls feel free to ask
when i replied to you, my mind was pretty clear ( i guess ), and in such moments i share many details
i use counters in many situations, for example, on some setups :
... only by zeroing the face, thus based on program zero value, it is decided to how many parts can be cut without opening the chuck
... based on counter value, when at least 2 parts are machined without opening the chuck, some operations may be skipped, for example like runing the puller code only when last part was cut
... if the face of the material is tilted too much, the operator may choose to execute 1, or 2, or more extra face cuts, only with a single keystroke, and a counter inside the program is initialized in this manner, so to execute a number of cuts accordingly to operator's choice( it is a fast way to deal with a common aspect, that involves extra-clearances, so to limit the number of face cuts, in order to avoid hitting the chuck when machining the main part )
... etc etc / kindly