Configure Group I/Os with .cm file

  • Hello everyone,

    currently i am trying to create a .cm file to auto configure my Group I/Os. I think i have a pretty good idea on how to do it but i am missing 1 essential information. I would like to use the "KCL SET VAR" command to set the SYS vars of the Group I/Os RACK, SLOT, START PT and NUM PTS but i dont know where to find them. Has anyone an idea how these sys vars are called. Or mabye there is a better way to perform this configuration in a .cm file, like a specific command or something.


    Thanks for help

  • I'm not aware of any system variables that can be set for the port configuration, but afaik there are two options:


    1) Load a DIOCFGSV file containing the desired IO configuration, I would expect this can be done using a *.CM file


    2) Use a KAREL program with the built-in function SET_PORT_ASG that you can RUN with a KCL command


    Sidenote, when looking into the ASCII version of DIOCFGSV.VA, this is just a list of variables in 'program'/namespace/... [MDIO_MAIN]. This makes me wonder if it's possible to 'KCL SET VAR' on these variables to directly change port configurations from a *.CM file. If the other two options aren't quite what you need it might be worth checking out

  • I picked this command out of another thread, and through trial and error I think I've got it somewhat figured out. "DIOASG # # # # # # #" is a CM file command.


    Below is my understanding not anything I've been able to find documentation on, however it matches similarly to the KAREL Command SET_PORT_ASG:


    EDITTING as I learn more.


    DIOASG Io_Type Range_Begin Range_Length Rack Slot Io_Type Start_Point

    • Io_Type: This determines whether you are assigning Digital Inputs, Digital outputs, UOPs, etc. It seems to follow the numbers from KLIOTYPS.KL (see THIS thread).
    • Range_Begin : Starting index of the IO that you are configuring
    • Range_Length: Number of sequential IO indices to configure
    • Rack: Physical location of the IO board/module
    • Slot: Space on the rack where the IO is connected
    • Io_Type: I don't really understand what this is supposed to be, but making it the same as the first number seems to work, Unless you want to "Clear" the IO assignment, then 0 seems to work.
    • Start_Point: Starting point within the Rack/Slot


    The Code below Configures some Digital IO:


    Group inputs/outputs work with the same command but with a slight Adjustment:


    DIOASG Io_Type GI_GO_# Range_Length Rack Slot Io_Type Start_Point

    • Io_Type: Group Inputs are 18, Group Outputs are 19
    • GI_GO_#: Seems to be the GIO[#] that you are configuring
    • Range_Length: Number of IO indices to configure to the GI
    • Rack: Physical location of the IO board/module
    • Slot: Space on the rack where the IO is connected
    • Io_Type: I don't really understand what this is supposed to be, but making it the same as the first number seems to work, Unless you want to "Clear" the IO assignment, then 0 seems to work. UOP assignments seem to need to point at your digital IO.
    • Start_Point: It looks like this is the Starting point within the Rack/Slot


    The Code below Configures some Digital IO:



    Note the SPEP_OFF Command seems necessary at the top.


    I've tested all of this only in Roboguide, not on an actual robot yet, but it seems ok so far.

Advertising from our partners