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
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Fanuc Robot Forum
  5. Manuals, Software and Tools for Fanuc Robots (you should look here first before posting)
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Syntax for command files (.CM)

  • Nation
  • November 28, 2016 at 5:13 PM
  • Thread is Resolved
  • Nation
    Typical Robot Error
    Reactions Received
    521
    Trophies
    9
    Posts
    1,900
    • November 28, 2016 at 5:13 PM
    • #1

    It is unfortunate that this is not documented anywhere, but I found the IF statement synax in one of Fanuc's .cm files.

    Here it is:

    Code
    IF VAR $APPLICATION[2] "V7.30P/*"
      SETVAR $CCSCB2_GRP[1].$FS_TYP2 1
    ELSE
      IF VAR $APPLICATION[2] "V7.40P/*"
        SETVAR $CCSCB2_GRP[1].$FS_TYP2 1
      ELSE
        IF VAR $APPLICATION[2] "V7.50P/*"
          SETVAR $CCSCB2_GRP[1].$FS_TYP2 1
        ELSE
          IF VAR $APPLICATION[2] "V7.60P/*"
            SETVAR $CCSCB2_GRP[1].$FS_TYP2 1
          ENDIF
        ENDIF
      ENDIF
    ENDIF
    Display More

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • Go to Best Answer
  • skalactik
    Reactions Received
    12
    Trophies
    3
    Posts
    111
    • February 15, 2017 at 5:24 PM
    • #2

    More commands found in various .CM files :

    # PCVLOAD namefile - to load namefile.SV
    # TXPLOAD namefile - to load namefile.TX
    # ASLOAD namefile - to load namefile.AS (assembly files - used internally)


    #PCCLEAR namefile - to clear namefile.PC
    #DELFR FR:namefile.filetype - to delete namefile.filetype from FROM
    #DEL filepath:\filename.filetype\ - to delete filename.filetype located in filepath

  • Chander_hxj
    Reactions Received
    4
    Trophies
    3
    Posts
    20
    • April 5, 2017 at 1:51 PM
    • #3

    You are a very great guy, nobody can learn these great info. from any FANUC manual.
    I have a question about '*.as file' which seems that you are good at it, I got a as-file, however, I can not understand the code inside.
    by the way,can you share more about karel software development, I am also interested in it.

  • skalactik
    Reactions Received
    12
    Trophies
    3
    Posts
    111
    • April 6, 2017 at 5:43 PM
    • #4
    Quote

    I have a question about '*.as file' which seems that you are good at it, I got a as-file, however, I can not understand the code inside.


    .as files are Assembly files, basically they are used to perform direct manipulation of internal memory (or registry) of the Operating system

  • Chander_hxj
    Reactions Received
    4
    Trophies
    3
    Posts
    20
    • April 8, 2017 at 5:58 AM
    • #5

    thanks for your advice
    I'm totally agree with you, the info., in the karel manual, sometimes makes me waste much time to understand, because some incorrect info. will mislead me and i have to do many experiments to get one point from it.
    as you said, the motion part in J3iB Karel manual can not be found in the new manual. however, as a software developer, it's important.
    I am learning from your *.CM FILE, and I'll work hard on karel programming, there's so much fun in it.
    if you have any info, about karel, i will be your first fan to follow it.

  • Chander_hxj
    Reactions Received
    4
    Trophies
    3
    Posts
    20
    • April 8, 2017 at 6:08 AM
    • #6
    Quote from skalactik


    .as files are Assembly files, basically they are used to perform direct manipulation of internal memory (or registry) of the Operating system


    i got two *as file, however, I really dont understand about it's rules in it.
    e.g.
    1:% ASM #2 EMCD #2#1
    2:$0a000000 #31 $F4 !Online shift use$CUSTOMMENU[4]

    i can understand the first line, but, I cant transfer the second line's code one by one
    i can guess the function about the second line.

    the other prog.
    1:% ASM #2 TOPK #2#3#1
    2:07000000#31 $F5 !F7:CAN/STR(CANCEL/Start line)
    3:08000000#31 $F6 !F8:LOG/END(Log/End line)
    4:09000000#31 $F7 !F9:CAN/STR(Start/Convert)

    if you have any advance to share, feel free. thanks.

  • Fabian Munoz
    Reactions Received
    133
    Trophies
    9
    Articles
    1
    Posts
    1,517
    • April 12, 2017 at 2:58 PM
    • #7

    Hi Chander_hxj

    I don't know much about these AS files,
    I just want to ask you if this last post is related to Fanuc As. files ?
    Also, Should that post start a new thread ?

    Fabian

    Retired but still helping

  • Chander_hxj
    Reactions Received
    4
    Trophies
    3
    Posts
    20
    • April 22, 2017 at 6:22 AM
    • #8
    Quote from Fabian Munoz


    Hi Chander_hxj

    I don't know much about these AS files,
    I just want to ask you if this last post is related to Fanuc As. files ?
    Also, Should that post start a new thread ?

    Fabian

    Hi Fabian,
    I'm sorry to make this mistake.
    Chandler_HXJ

  • Chander_hxj
    Reactions Received
    4
    Trophies
    3
    Posts
    20
    • April 22, 2017 at 6:29 AM
    • #9
    Quote from skalactik


    More commands found in various .CM files :

    # PCVLOAD namefile - to load namefile.SV
    # TXPLOAD namefile - to load namefile.TX
    # ASLOAD namefile - to load namefile.AS (assembly files - used internally)


    #PCCLEAR namefile - to clear namefile.PC
    #DELFR FR:namefile.filetype - to delete namefile.filetype from FROM
    #DEL filepath:\filename.filetype\ - to delete filename.filetype located in filepath

    Display More


    I've been learning cm.file for two weeks, and I found [PCVLOAD] also used in the *.vr and *.pc files.
    when used in *pc.file load, it's also same to PCLOAD.
    if anything is incorrect, thanks for your suggestion.

  • Chander_hxj
    Reactions Received
    4
    Trophies
    3
    Posts
    20
    • April 22, 2017 at 6:46 AM
    • #10



    Hi,master bidzej
    I'll add some syntax about CM-file, which I also don't know about its function.However, I wish master bidzej or someone will fix it out oneday. :nanananana:
    the structure is
    1.#SPEP_ON.........#SPEP_OFF
    2.#FRCLRPR.........#FRSETPR

    another question is about [How to Start the CM.file]
    if there's no KCL command in the cm.file,I can start the CM.file.
    However, if the cm.file contains the KCL command, I need to set the varaible [$RMT_MASTER] to '1', disable the teach pedant, and switch to AUTO mode. In the case, I can start the CM.file finally

  • lexx905
    Reactions Received
    11
    Trophies
    3
    Posts
    82
    • May 1, 2017 at 3:08 PM
    • #11

    Ciao

    CLRALMH - Clear alarm history
    RE_POWER - Restart system

  • lexx905
    Reactions Received
    11
    Trophies
    3
    Posts
    82
    • May 1, 2017 at 3:38 PM
    • #12

    And still, using such a construction -> SETVAR $ CCSCB2_GRP [1]. $ FS_TYP2 1, you do not ever refer to a variable of type STRING.
    It is better to refer to the variables like this:
    KCL SET VAR $ ATCELLSETUP. $ HOME_MACRO = 'BLA_BLA'
    KCL SET VAR $ ACC_MAXLMT = 15
    KCL SET VAR $ AP_AUTOMODE = TRUE

  • lexx905
    Reactions Received
    11
    Trophies
    3
    Posts
    82
    • May 25, 2017 at 7:45 PM
    • #13

    Ciao


    MKDIR UD1:test
    IGALBKUP UD1:\test
    EXIT


    This code will automatically create a TEST folder on the USB and put AOA and IMAGE on it :smiling_face:

    Edited once, last by lexx905 (May 27, 2017 at 9:39 AM).

  • lexx905
    Reactions Received
    11
    Trophies
    3
    Posts
    82
    • May 25, 2017 at 8:41 PM
    • #14

    Change Status - Di\Do\Ri\Ro\Flag

    !***************
    !DI 33 SET Sim Mode and True
    SETIOVAL 1 33 1 0 1

    !DI 34 SET Sim Mode and False
    SETIOVAL 1 34 1 0 0

    !DI 35 SET UnSim Mode
    SETIOVAL 1 35 0 0 0

    !***************
    !DO 33 SET Sim Mode and True
    SETIOVAL 2 33 1 0 1

    !DO 34 SET Sim Mode and False
    SETIOVAL 2 34 1 0 0

    !DO 35 SET False
    SETIOVAL 2 35 0 0 0

    !DO 36 SET TRUE
    SETIOVAL 2 36 0 1 0

    !************
    !RI 1 SET Sim Mode and True
    SETIOVAL 8 1 1 0 1

    !RO 1 SET Sim Mode and True
    SETIOVAL 9 1 1 0 1

    !************
    !Flag[10] = true
    SETIOVAL 35 10 0 1 0

    !Flag[11] = false
    SETIOVAL 35 11 0 0 0

  • robotomation
    Reactions Received
    1
    Trophies
    3
    Posts
    3
    • July 27, 2017 at 5:41 PM
    • #15

    I recently used a Command File to populate UALRMs on several(16) robots. It took minutes, instead of hours to do.
    I was quickly and easily able to implement 200+ User Alarms :top:

    Sample of syntax:
    SETVAR $UALRM_MSG[1] "Invalid Argument"
    SETVAR $UALRM_MSG[3] "BG Logic 1 not running"
    SETVAR $UALRM_MSG[4] "BG Logic 2 not running"
    SETVAR $UALRM_MSG[5] "BG Logic 3 not running"
    SETVAR $UALRM_MSG[6] "BG Logic 4 not running"
    SETVAR $UALRM_MSG[7] "BG Logic 5 not running"
    SETVAR $UALRM_MSG[8] "BG Logic 6 not running"
    SETVAR $UALRM_MSG[9] "BG Logic 7 not running"

    - - - MH - - -

  • bencor21
    Reactions Received
    10
    Trophies
    3
    Posts
    109
    • August 30, 2017 at 4:48 PM
    • #16

    DELTP program - deletes the specified .TP program from the Robot memory

    Use this before TPLOAD device:program.tp (like loading from USB). It won't alarm if the file exists in Robot memory where the TPLOAD will if the file exists & it ends the execution of the .cm file.

  • bencor21
    Reactions Received
    10
    Trophies
    3
    Posts
    109
    • September 1, 2017 at 7:11 PM
    • #17

    If the .tp file already exists in the Robot controller, say TEST.tp & the TPLOAD UT1:Test.tp command is given, there will be a message displayed "Program already exists" & you will have it hit F4 (OK), it's the only choice given. At that point, the .cm file has not completed. Just to be on the redundant side, on the line before the TPLOAD command, give it the DELTP TEST, & even if that file does not exist in the Robot, all will be fine.

  • robotomation
    Reactions Received
    1
    Trophies
    3
    Posts
    3
    • September 6, 2017 at 7:52 PM
    • #18

    Another way to work around the overwriting problem is to use the Karel equivalent in the CM file:

    KCL LOAD TP <FILENAME> <OVERWRITE - OPTIONAL>
    KCL LOAD TP ALARM OVERWRITE

    Instead of:
    TPLOAD ALARM.TP (which will abort the CM if the file already exists)

    - - - MH - - -

  • Online
    mortoch
    Reactions Received
    15
    Trophies
    3
    Posts
    197
    • September 8, 2017 at 2:24 PM
    • #19

    Will these work in the RJ2?
    We have a sh*t load of these dinosaurs they bought from a defunct GM plant for dirt.
    :wallbash:

  • rf103
    Reactions Received
    17
    Trophies
    4
    Posts
    264
    • September 9, 2017 at 3:08 PM
    • #20

    yes. According to the Karel manual (Chapter: File System): ".CF: KCL command files are ASCII files that contain a sequence of KCL commands for a command procedure."

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  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