Read name of PR given in PR Data list?

  • EDIT: Before "Why don't you just use KAREL?!", I don't have KAREL option on these Robots, or I would go down that route and learn me some more KAREL.


    Thinking of making some improvements to the robots for our customer while I have some downtime...Long story short, I'm wondering if the Comment you assign to a PR (a.k.a. the name you give it) is accessible through System Variables for use in TP Programming? I want to take the name of the PR, slap it into a single String Register and display it on a webpage, rather than writing each model name to its own String Register and reading the String Register (one less place for the customer to have to add to if they add a new model).


    I'm under the impression though that if I want to do anything more than PR = this or PR[x,y] = this + that in TP Programming, that I'm going to be SOL. That's why I ask the people much more knowledgeable here :grinning_face_with_smiling_eyes:


    Little more background if it helps: I have two operations, pick and place. I have multiple models, but the paths are all the same for each operation. The only change is the pick or place position. So I would like to swap over to using an Indirect Register within a single job for PICK and a single job for PLACE. Since this customer is new to robotics it may be confusing and/or intimidating to see PR[R[3]], so I would like to have a webpage that shows "Current Pick Position Register is:" "(PR #) (PR NAME)"...or something along those lines. So that they can have more confidence in teaching the Indirect Register with a visual aid / being able to confirm the Indirect Register is on the correct model. Obviously they should also have some faith and trust in the Integrator they are paying to program their new toy, but ya know - I like to get as close to a Mercedes when the customer pays for it with neat features.


    EDIT2: I may be able to do this a rough way and use a Label Control and margin/crop it until only the [Comment goes here] portion is the only thing showing out of the entire Position Register DataType...

  • Hi

    I'm sorry to tell you that without Karel you have no luck.

    I called Fanuc recently, I was talking to one of the guys with a lot of experience. One of the "repair man" you would like to talk to you when you have a problem.

    Anyway, he told me NO, You can not do it but just to be sure he was going to pass my question to the team specialized on that. The answer from the team was again, NO

    It's a shame , because with Karel takes like 5 lines of code to do it if you have a PLC


    This program contains two examples


    PROGRAM CommntPR

    -- Read PR[x] id from R[8]

    -- Reads the PR[x] comment and writes it on SR[8]

    VAR

    status: INTEGER

    pos_cmt: STRING[30]

    pr_nr:INTEGER

    real_flag :BOOLEAN

    int_value :INTEGER

    real_value :REAL



    BEGIN

    -- Initialize vars

    status=0

    pr_nr=0

    real_flag=FALSE

    int_value =0

    real_value =0

    pos_cmt = ' '


    -- Program

    -- Read value from register 8, flag it if it is integer or real

    GET_REG(8,real_flag,int_value,real_value,status)

    -- Read comment of an specific position register

    GET_PREG_CMT(int_value, pos_cmt, status)

    -- Write comment from PR to an specific string register

    SET_STR_REG(8,pos_cmt,status)


    END CommntPR

    Retired but still helping

  • Yeah it's OK, I figured that was going to be the case...I am looking at the webpage ActiveX Label Control and I do see that one of the DataTypes is "Dictionary Element"...So that would be the .ftx or .utx file format?? Even if so, that's still directly tied to a KAREL program because the KAREL program has to include/use the dictionary, right?


    BUT! I do see that the Position Register DataType under the Label Control includes ALL the information of a PR INCLUDING the NAME/COMMENT. So, with cropping/margins I can slim the box of information down to show the PR[#] GRP[#] and [COMMENT]. That may be good enough...now I just need to figure out how to display the PR being referenced within the Indirect Register. This already seems like too much work for what should be a VERY simple task!


    Thanks for the reply Fabian Munoz!

Advertising from our partners