okuma user task 2 for ops 300l
hello to everyone !
I am working on Okuma ops300l and i created a user sub programming, base on the user task2 programming book said if local variable defined as here > IF ABC GOTO N1000, which meant if that local variable show up then jump to N1000 if not show up it will read the following line but somehow this OSP 300l control give me an alarm 2227-01 alarm b or local variable a side? if anyone have any clues please help...
Re: okuma user task 2 for ops 300l
hy, debuging code with variables may be tricky ... if you wish, pls describe what you wish to achieve, pls share a small full program that erors out, and i will take a look / kindly :)
Re: okuma user task 2 for ops 300l
What the alarm is saying... is that you have not completed the question
ABC is what ... if true then jump to N1000... if false then continue on with the next line.
What you could have is IF ABC EQ NULL... IF ABC GT 0 ... etc
Re: okuma user task 2 for ops 300l
You’re going to need brackets [ABC] in there for it to work correctly. Check and post your exact format if it’s not working.
IF [ABC EQ 1]N100
ABC will need to be defined earlier if you plan to use it.
ABC=1
Re: okuma user task 2 for ops 300l
Quote:
if that local variable show up then .... if not show up ....
pls be careful bih-minh, this approach won't work if you try to pass a local variable to a soubroutine, because, once created at a specific level, a local variable is available on all higher nesting levels; in other words, it will manifest inside a soubroutine, even if it had not been passed to it, but created before the call statement; mills controles behaves different on this issue :)
Quote:
have not completed the question ... need brackets
brackets are required only if statement uses at least one operator like lt,le,eq, etc, otherwise, like when checking for a local var existence, they can be omitted
syntax like IF LV NJUMP is osp compatible, and allows more coding tricks
at least theoritcal, IF LV NJUMP has same meaning like IF [ LV NE EMPTY ] NJUMP; theoretical, because EMPTY errors out on p300l
i use it to overload soubroutines, making them behave differently, in respect to the size of the set of values which is sent to a soubroutuine; sometimes i regard this as an interlock inside a soubroutine
teahole showed me this, and maybe it is also inside the manuals ( to avoid doubts, i mean that teahole may be inside the manuals ... page 3 ? ) / kindly :)