1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
Everywhere
  • Everywhere
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Members
  3. AnisFrej

Posts by AnisFrej

  • Recording system data from a FANUC robot with the Karel program

    • AnisFrej
    • March 5, 2022 at 6:11 PM
    Quote from Erik Olsen

    I would try again and make sure you remove/comment out where you write the torque to the log file. I was able to run your program and make a valid angle log using the following code:

    If you still want to log the $CUR_TORQUE, $TORQUE or $MAX_TORQUE Variables you need to use the correct DATA types. These system variables are stored as SHORT data types and your GET_VAR instructions were trying to write into REAL variables. SHORT data needs to be assigned to BYTE or INTEGER variables. After changing your data types and a couple of CNV instructions I was able to make a valid log containing both Angle and CUR_TORQUE values:

    Thank you very much for your precise answer :smiling_face: :smiling_face: :smiling_face: , but in the obtained file some values are saved as * as in the attached file from you .

    So do you have any idea how to extract the value correctly?

    And do you have any idea which variables I should use to extract or save the speed of the motors or encoders and the speed of the joints ?

  • Recording system data from a FANUC robot with the Karel program

    • AnisFrej
    • March 5, 2022 at 2:12 AM
    Quote from Erik Olsen

    When you run the program are you getting uninitialized data on line 125 of your karel program?

    The Torque values stored in $MOR_GRP[1].$CUR_TORQUE[] are some cursed UINT Values as detailed by this thread: FANUC PROJECT: Data recording with background Karel program - Fanuc Robot Forum - Robotforum - Support and discussion community for industrial robots and cobots (robot-forum.com) I think trying to get/convert/write these UINT Values is causing your issue.

    Judging by the variable names you used, you've already looked over part of this thread, however, I don't think the thread landed on a Karel happy solution. If you remove the torque logging from your program the rest works just fine.

    Yes I tried to run the program without the part of torque, but it didn't work

    So, is there any other method to save the values in real time more reliable than this one ?

  • Recording system data from a FANUC robot with the Karel program

    • AnisFrej
    • March 3, 2022 at 7:43 PM

    Hello,

    I tried to program this Karel function to extract the data from the system of a FANUC LR mate 200ic 5L robot and save this data in a ".dt" file.

    Code
    ! TP Code
    DO[1] = ON
    RUN dataextract
    J P[1] 100% CNT100
    J P[2] 100% CNT100
    J P[3] 100% CNT100
    WAIT 3.00 (sec)
    J P[1] 100% CNT100
    J P[2] 100% CNT100
    J P[3] 100% CNT100
    DO[1] = OFF
    
    PROGRAM dataextract
    
        %COMMENT = 'LOG DATA RECORD'
        %SYSTEM
        %NOLOCKGROUP
        %NOABORT=ERROR+COMMAND+TPENABLE
        %NOPAUSE=ERROR+COMMAND+TPENABLE
        %NOPAUSESHFT
        
        
        VAR
                     
            logFile    : FILE
            filename   : STRING[16]
        
            duration   : INTEGER
            clock_var  : INTEGER 
            period     : INTEGER
            timeInt    : INTEGER
            timeStr    : STRING[18]
        
            IntTQa1,IntTQa2,IntTQa3,IntTQa4,IntTQa5,IntTQa6    : REAL
            IntTQa1Str,IntTQa2Str,IntTQa3Str,IntTQa4Str,IntTQa5Str,IntTQa6Str : STRING[4]
             
            IntANGa1,IntANGa2,IntANGa3,IntANGa4,IntANGa5,IntANGa6    : REAL
            IntANGa1Str, IntANGa2Str, IntANGa3Str,IntANGa4Str, IntANGa5Str, IntANGa6Str: STRING[4]
     
            entry      : INTEGER
            status     : INTEGER
    
            test       : INTEGER
            clocky     : INTEGER
    
    
    
        -- routine to get internal torque measured on axis
        ROUTINE GET_INT_TQ(active : BOOLEAN)
            
            BEGIN
    
                IF active=TRUE THEN
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP[1].$CUR_TORQUE[1]', IntTQa1, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP[1].$CUR_TORQUE[2]', IntTQa2, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP[1].$CUR_TORQUE[3]', IntTQa3, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP[1].$CUR_TORQUE[4]', IntTQa4, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP[1].$CUR_TORQUE[5]', IntTQa5, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP[1].$CUR_TORQUE[6]', IntTQa6, status)        
                  ENDIF
    
        END GET_INT_TQ
    
        -- routine to get angle of axis 
        ROUTINE GET_INT_ANG(active : BOOLEAN)
    
            BEGIN
    
                IF active=TRUE THEN
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP_SV[1].$CUR_SV_ANG[1]', IntANGa1, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP_SV[1].$CUR_SV_ANG[2]', IntANGa2, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP_SV[1].$CUR_SV_ANG[3]', IntANGa3, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP_SV[1].$CUR_SV_ANG[4]', IntANGa4, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP_SV[1].$CUR_SV_ANG[5]', IntANGa5, status)
                    GET_VAR(entry, '*SYSTEM*', '$MOR_GRP_SV[1].$CUR_SV_ANG[6]', IntANGa6, status)
                ENDIF
    
        END GET_INT_ANG
    
        -- main routine
        
        BEGIN -- execute the program
        
        clock_var = 0
            
            -- begin the clock time count
            CONNECT TIMER TO clock_var
        
            period = 10 -- ms
            duration = 100000000  -- ms
        
            filename = 'UD1:\'+'Test'+'.txt'
        
            entry = 0
            status = 0
        
            -- tests
            test = 0
            clocky = 0
        
            -- get actual time and convert it into string
             GET_TIME(timeInt)
            CNV_TIME_STR(timeInt, timeStr)
        
            -- open the log file
            OPEN FILE logFile ('AP', filename)
    
            -- write actual time and make a carriage return
            WRITE logFile (timeStr, CR)
            
            REPEAT  
                -- start recording
        
                    clocky = clock_var
                    test = clocky+period
                    
                    GET_INT_TQ(TRUE) -- call internal torque routine
                    
                    CNV_REAL_STR(IntTQa1, 2, 2, IntTQa1Str)
                    CNV_REAL_STR(IntTQa2, 2, 2, IntTQa2Str)
                    CNV_REAL_STR(IntTQa3, 2, 2, IntTQa3Str)
                    CNV_REAL_STR(IntTQa4, 2, 2, IntTQa4Str)
                    CNV_REAL_STR(IntTQa5, 2, 2, IntTQa5Str)
                    CNV_REAL_STR(IntTQa6, 2, 2, IntTQa6Str)
                    
                    GET_INT_ANG(TRUE) -- call internal angle routine
                    CNV_REAL_STR(IntANGa1, 2, 2, IntANGa1Str)
                    CNV_REAL_STR(IntANGa2, 2, 2, IntANGa2Str)
                    CNV_REAL_STR(IntANGa3, 2, 2, IntANGa3Str)
                    CNV_REAL_STR(IntANGa4, 2, 2, IntANGa4Str)
                    CNV_REAL_STR(IntANGa5, 2, 2, IntANGa5Str)
                    CNV_REAL_STR(IntANGa6, 2, 2, IntANGa6Str)
                    
                    WRITE logFile(clock_var)
        
                    WRITE logFile(';')
                    WRITE logFile(IntTQa1Str,CR)
                    WRITE logFile(IntTQa2Str,CR)
                    WRITE logFile(IntTQa3Str,CR)
                    WRITE logFile(IntTQa4Str,CR)
                    WRITE logFile(IntTQa5Str,CR)
                    WRITE logFile(IntTQa6Str,CR)
                    
                    WRITE logFile(';')
                    WRITE logFile(IntANGa1Str,CR)
                    WRITE logFile(IntANGa2Str,CR)
                    WRITE logFile(IntANGa3Str,CR)
                    WRITE logFile(IntANGa4Str,CR)
                    WRITE logFile(IntANGa5Str,CR)
                    WRITE logFile(IntANGa6Str,CR)
                    
                      DELAY(period)
            
            UNTIL DOUT[1]=OFF
            
             -- stop recording, close log file
             CLOSE FILE logFile
    
    END dataextract
    Display More

    But unfortunately, I got only an empty file and there is no result in the file, only that :

    03-MAR-22 17:33

    0;

    And here is an example of the file I got

    can you help me find out where the issue is coming from or can you give me another solution to save in real time the system data like internal joint torque, joint speed, etc...

    Thanks in advance

    Test.txt

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download