Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

GOTO branch inside CSE

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hello!

Controller "like FANUC", branch like GOTO 100, GOTO [#100] working well, no problem.

 

But - I need inside my MCF\CCF create some conditional branch like 

 

IfCommand

    Condition    getVariable("#200") > 200

       Then

           And here - HOW I CAN JUMP TO SOME LABEL INSIDE CURRENT PROGRAM?

 

 I know about CallRepeatSubProg, by description I must to set start and end labels (no problem, I can do it), optional search directions (no problem). AND - SubProg Name, optional, by Default - CURRENT PROGRAM. But - Not Working, I have error message "Program Name (and here start Label string) not found"

 

I know, inside MCF\CCF not commands like GOTO, GOTOF - it just on Parser level..

 

Thanks,

Yuri.

5 REPLIES 5

Re: GOTO branch inside CSE

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi Yuri

In which NX version are you trying to do it?
I am using commands like this (in NX12), and it is all simulated correctly:

 

WHILE[[#711]LE[3]]DO1
(...)
END1

or

IF[1NE#711]GOTO1001
(...)
N1001

or

GOTO2001


I didn't have to do any modifications in cse to handle it.

Marek Pawlus, NCmatic

Development: C#, Tcl/Tk, CSE

Re: GOTO branch inside CSE

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

 Hello, Marek!

Yes, it work correct, if you use GOTO (GOTO - on Parser level defined branch).

 

Try do a same, for example

 

G777

 

Where G777 is metacode "GOTO 2001"

 

Dont use PreprocessLine or any substitute.

Re: GOTO branch inside CSE

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

oh, now I see what is the problem.

Marek Pawlus, NCmatic

Development: C#, Tcl/Tk, CSE

Re: GOTO branch inside CSE

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I cannot to do final step to solution..

Now I change my Python parser, but cannot to compare Variable value with Integer, incompatible types.

 

        index = self.exprFactory.CreateVariableExpr('#5')
        if index > 0:
            pTargetExpr

Re: GOTO branch inside CSE

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Sorry for my panic. I have solution now. I use self.callFactory.CreateIfCall with boolean expression (True or False), this expression returned from defined Method self.exprFactory.CreateMethod

 

Learn online





Solution Information