What's new
What's new

Okuma macro programming - alarms and misc questions

Cwalster

Plastic
Joined
Sep 21, 2014
So it looks like I'm going to be doing some part family programming this week. I've done this before on our HAAS machines, but this is for our new Okuma lathe (OSP300L controller). I think I've got the basic syntax down, but had some questions on some stuff the manual didn't do a good job of explaining.

1: custom alarms - I know that VUACM calls the alarm, but the rest of the syntax is poorly explained. If all I want is to display a static message and prevent the machine from continuing, how would that call look?

2: NOEX - from what I understand, this is single block suppression, and on a per-block basis. Is there a way to turn off single block for a section of code? Can I have NOEX on a line with another N block so I can jump to that line?

Those are my two main questions. If there are any code snippets you could post of those two (or anything really, so that I can reverse-engineer it), I would be appreciative.
 
1: custom alarms - I know that VUACM calls the alarm, but the rest of the syntax is poorly explained. If all I want is to display a static message and prevent the machine from continuing, how would that call look?

hy :)

IF [ condition=true ] NJUMP
M0 ( message )
NJUMP

... or

IF [ condition=true ] NJUMP
NRPT M0 ( you shall not pass / program will not continue )
GOTO NRPT
NJUMP

i dont use VUACM because this may only be used once per program session / run, and it does not go of the screen, but it stays there

also this will block the displayng of other mesages by the control, so, if something happens, you wont be able to see the code on the screen if you displayed a message ... however, you can still see the codes/erros history in mac-man, but this is not the default way to use the machine :)

2: NOEX - from what I understand, this is single block suppression, and on a per-block basis. Is there a way to turn off single block for a section of code? Can I have NOEX on a line with another N block so I can jump to that line?

i supose that here are 2 questions :

a) Is there a way to turn off single block for a section of code?

GOTO NJUMP
code line 1
code line 2
etc
NJUMP

... or

/ code line 1
/ code line 2
/ code line 3
/ code line 4
... thus before each line is a / sign
... from machine panel, there is a button which toogles if such lines are executed or not
... pressing that button, thus requireing a status change, is not done instantaneously, but only from the 1st line after the read ahead
... there are codes that prevent the read ahead behaviour

b)
Can I have NOEX on a line with another N block so I can jump to that line?

i dont understand exactly what you wish, but i hope that these code examples will help you :) kindly !
 
I think in this case a true alarm would be more appropriate. The trick to this program isn't creating adjustable movement (There is so little that I will probably just create separate subroutines for each possibility), its in idiot-proofing the input received from the operator. There are about 7 different options, some of which are variable and others that are on/off options - many of whom effect each other. For example, if the part is cross-drilled, it can't be shorter than a certain amount or have a hex, o-ring, or end hole in it. If there was an invalid config entered, I want the machine to effectively tell him that it's not possible and to go fix his shit - and an alarm says that significantly better than M00.

Similarly, because there will be a large amount of IF statements checking all of this stuff, I was looking for a way to get through all the logical stuff and into the movement portion with single block on. It still needs to run all the logic to check the inputs, but it would be nice if the operator doesn't have to mash the button a hundred times before motion starts during a prove-out.
 
The following will generate an Alarm D when read:
VUACM[1]='YOUR MESSAGE HERE'
VDOUT[992]=9006

As mentioned above, there is a pretty good app available on the Okuma store called "Message Center" that works well too. Pops up an error and a picture if you so desire.

Following for sure works on the mills, not sure if it will work on the lathes or not, I'll look tomorrow.

M132 - Single block ineffective
M133 - Single block effective

EDIT:

Lathe control SB ignore commands:

G304 - Single Block Ignore OFF
G305 - Single Block Ignore ON

There is also a pretty handy screen available in the "Easy Op Display" (again, on the mills, I'll check a lathe tomorrow) that lets you see the named local variables and their values in the lower right quadrant of the screen (highlight the quadrant and page down IIRC) that is pretty handy for debugging macros.
 
Last edited:
hy Ispotts :)

Following for sure works on the mills, not sure if it will work on the lathes or not, I'll look tomorrow.

M132 - Single block ineffective
M133 - Single block effective

nice one :) i did not know this ... however, it seems 2 be available only on mill :)

The following will generate an Alarm D when read:
VUACM[1]='YOUR MESSAGE HERE'
VDOUT[992]=9006

VUACM[1]=max_16_chars :)
... and there is a trick that i was told by someone, like using VDOUT[99*]=number / common_variable, thus to show numbers inside the message text
... he was using it to show that tool_number_whatever had worked too much :) i hope i said it right :)

As mentioned above, there is a pretty good app available on the Okuma store called "Message Center" that ...

... that requires API :)

There is also a pretty handy screen available in the "Easy Op Display" (again, on the mills, I'll check a lathe tomorrow) that lets you see the named local variables and their values in the lower right quadrant of the screen (highlight the quadrant and page down IIRC) that is pretty handy for debugging macros.

Please Ispotts, i think at one day i find this, and after that i lost it ... can you help me locate it again ? kindly !
 
I think in this case a true alarm would be more appropriate

hy Cwalster :) besides that the machine will always run with the red_line_on, i also noticed that operators were a bit stressed when seing it, because they were used with the machine running clean, and suddenly, a lot of meesages will appear, and 1st reaction is not to chill out + read, but stress+worry because something may happen

is not the message body, but the fact that it is displayed as an error :)

i give up using this ... for me it was enough to see this reactions only once :)

Similarly, because there will be a large amount of IF statements checking all of this stuff

I understand that you wish for a code, that will run some specific sections, coresponding to the part that you wish to do

In my opinion, try to avoid IF branches, because they will make you go crazy ... in the end, code will work, but .... well, just do it your way :)

I would write a modular structure, and try to reduce the number of conditions to a minimun, or maybe, to eliminate them all

Thus code will still perform particular, but less IF branches will make it run linear :) kindly !

ps : this is just an idea ... i dont know exactly what you are after :)
 
Thus code will still perform particular, but less IF branches will make it run linear

Code:
part1.min
    CALL OS01
    CALL OS02A
    CALL OS03
M02

part2.min
    CALL OS01
    CALL OS02B
    CALL OS03
M02

part3.min
    CALL OS01
    CALL OS02B
    CALL OS04
M02

... and the OS procedures in another file/files

somehow is the same thing as when using PSELECT, only that there is no machine stop between programs ... this may help, for example, when coding variants for the same operation, that begins in the same manner for most parts, but after a while it changes ... thus you can have a continous cutting for each part, even if toolpath is not the same after the middle


now another samples, for parametric codes :

Code:
part1.min
    CALL master_reset
    CALL OMAIN   V1 = 1   V2 = 1   V3 = 1
M02

part2.min
    CALL master_reset
    CALL OMAIN   V4 = 1
M02

part3.min
    CALL master_reset
    CALL OMAIN   V1 = 2   V4 = 1 
M02

master_reset
    V1 = 0
    V2 = 0
    V3 = 0
    V4 = 0
RTS
kindly !
 
The following will generate an Alarm D when read:
VUACM[1]='YOUR MESSAGE HERE'
VDOUT[992]=9006

The cat is correct, there is a character limit on the error description, but you get the idea.


Following for sure works on the mills, not sure if it will work on the lathes or not, I'll look tomorrow.

M132 - Single block ineffective
M133 - Single block effective

Appears that the lathes use G305 (SB Ignore ON) & G304 (SB Ignore OFF). I will edit the above post as well.

There is also a pretty handy screen available in the "Easy Op Display" (again, on the mills, I'll check a lathe tomorrow) that lets you see the named local variables and their values in the lower right quadrant of the screen (highlight the quadrant and page down IIRC) that is pretty handy for debugging macros.

Doesn't appear that this screen is available on the lathes, took a quick look this morning and it was not in the same place as the mills. I'll keep an eye out for it though.
 
Appears that the lathes use G305 (SB Ignore ON) & G304 (SB Ignore OFF). I will edit the above post as well

hy :) i only checked the availability of M132&133 on lathe ... i did not though to look for an alternative

so far i did not encounter a situation where i needed to toogle single_block behaviour from code

Doesn't appear that this screen is available on the lathes, took a quick look this morning and it was not in the same place as the mills. I'll keep an eye out for it though.

Please, at least where is this inside the mill manual or screen ? kindly !
 
or if you have the message function you can display a message without an alarm

MSG( EFF YOU BOB )
M00
NMSG

NMSG TAKES IT OFF- MSG DISPLAYS EVERYTHING IN PARENTHESES UNTIL NMSG
 
That G304/5 looks like it will do what I want. Strange how its an M code on a mill and a G code on a lathe. I could see it being different numbers, but swapping between letters is just weird.

Correct me if I'm wrong, the VDOUT afterwards is what triggers the alarm (red light and halt of program), where the 3 numbers dictate what level alarm it is, and the VUACM creates the message, which is designated by what is in the ' ' marks.

Time to get coding.
 








 
Back
Top