Types of IF Instructions

  • I have programmed some types of robot controllers.


    I noticed few of them, including of same controller model, are there ways of write them differents than other.


    I want to know why and if there is any way to change the form of predefined in IF/Select menu.


    Thanks to all readers.

  • Place your Ad here!
  • Fanuc robot controllers with version 7.7 and under have next syntax:

    Code
    IF (condition), decision(jump/call)


    Everything that you can find above 8.* you have choice to use old style if logic or you can do regular for everybody

    Code
    IF (condition) THEN
    !do smth
    (optional)ELSE
    (optional) !do else logic
    ENDIF

  • I'm unsure of what you mean, do you mean your conditions that you pass in the IF statement or something different?


    i.e. IF DI[1] (IF statement with IO condition)
    IF F[1] (IF statement with Flag condition)


    I am writing my memory, I cant now write real examples.


    For example I can in few robots use IF DI[1]=ON, DO[2]=ON but in other I have to do it with Jump Label/Call


    Quote

    IF DI[1]=ON, JUMP LBL[1]
    ...
    ...
    LBL[1]
    DO[2]=ON



    Fanuc robot controllers with version 7.7 and under have next syntax:

    Code
    IF (condition), decision(jump/call)


    Everything that you can find above 8.* you have choice to use old style if logic or you can do regular for everybody

    Code
    IF (condition) THEN
    !do smth
    (optional)ELSE
    (optional) !do else logic
    ENDIF


    So, only is version of robot??


    There is any way to add/change the predefined kind of IFs?


    Thanks all guys =) :top: :top:

  • I think my issue is related to this thread...…..


    I have been programming using Roboguide using a Controller with:

    V8.30P/48


    I have written many subroutines which use the syntax:

    IF...……...THEN.....ELSE.....ENDIF


    I have just been provided a backup from another system, opened it up in Roboguide and that version is:

    V8.20P/31


    I have found none of my programs that contain the IF.....THEN......ELSE......ENDIF syntax will load into it...……:wallbash:

    An example below:

    Code
      20:  IF (F[10:Pallet 1 Ready]=(ON) AND F[18:Pallet 1 Unload]=(OFF)) THEN ;
      21:  R[7:Target Pallet No]=1    ;
      22:  F[14:Pallet 1 In use]=(ON) ;
      23:  JMP LBL[2] ;
      24:  ENDIF ;

    Is there anything I can do about this in terms of being able to use my pre-written subroutines?

    Any assistance with this would be very much appreciated, as this leaves me with a hell of a lot of work to do otherwise?


    On another note, I have to express my disappointment with Fanuc Products if this results in me having to re-write my code.

    I sincerely hope this is down to myself making errors and not the product itself, as this is not good at all...…………:censored:

    • Helpful

    It looks like the IF-Then-Endif statement was not introduced until v8.3.


    I think you will either need to re-write your code or update the robot software. If you update the robot software you will want to make sure you take an image backup before in case something goes wrong with the update.

  • Ooooh Man.....I really wished you had a golden nugget you could hand me...………..:computerhit:

    Fanuc was edging Kawasaki in many areas and this has just swung the vote to Kawasaki.

    With this archaic syntax now will have me bouncing around programs like a monkey on a bungee.

    Still, if that's how it is, I just need to now run out of tears so I can see clearly enough to mod away...…..:bawling:


    I suppose it'll be a question of whether to upgrade software just for this purpose.....I'll have to at least ask the question.

    Does Fanuc charge for upgrade of software (I don't know whether I can hear you laughing at me for asking this)?

  • To be fair, both FANUC's TP and KAREL programming languages have been extremely stable for decades, especially in a forward-compatible direction (i.e. code written in 1999 will probably work on an R-30iB+ controller).


    It is a bit baffling that IF-THEN-ELSE controller structures weren't supported until R-30iB, but I'm glad we finally have them. It's too bad you happened to be on v8.20 and not v8.30 :loudly_crying_face:

  • Baffling for sure...….and there is probably a good reason behind it too embedded in the realms of some boffins logic who gets paid a hell of a lot more than me.....Not that I'm bitter at all...Heehee


    Still, glad I've found a 'breakpoint' between these versions early doors.....it's not a job stopper, just what I call one of those 'buggeration' factors that appear small, but carry a nasty nip.

  • The strange thing is, this system has just been installed and the existing systems (hence the reason I had a backup of one) are on later versions to this.

    I shall explore this now as a viable option as it would be better to at least have some continuity throughout regarding software levels.


    HawkME

    Many thanks for that, much appreciated.....that's half a golden nugget at least...……….:top:

  • Quote

    if you have a login to the Fanuc CRC then you can get the auto-update software for free. You would want to download the latest version of version 8 software which is: V8.30P/52 AUTO Update.

    Unfortunately it's not as simple as that...…………..I'm in the UK and Fanuc's policy regarding software here is soooooo restricted indeed.

    No option of you doing any option install or software upgrade yourself, you have to provide an image to them and they do the work for you.

    And yes, everything you have to pay for, even for a software update from 8.20 to 8.30.

    To be honest, I'm really hacked off with their approach regarding software options and updates, I wish I was in the USA sometimes.

    I'm in the process of trying to source alternative solutions...…..do you know if Fanuc US will deal outside of their region?

    I'm going to find out I think anyway...………….

  • When I call Fanuc tech support it is either $500 or $2000 to do what I'm asking about.


    I recently had a EOAT that required 5 32bit floating point parameters over Profi-Net. I asked if there was some kind of translating subroutine as the robot has a 16bit Motorola processor. They sent me a .pdf for mapping global data. (no mention of converting the data). Fortunately the PLC programmer on the job took the communications for the EOAT and we handshaked the IO for me to control it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners