Global CONST not seen in another module

  • I declared a global constant in the dat file of one module. It is recognized in a second module in the directory, but not a third.


    All files in this post are in the /R1/System folder.


    In spsDigIO.dat:
    GLOBAL CONST INT DIGOUT_ACTIVE_INT = 48


    In sps.sub:
    $OUT[DIGOUT_ACTIVE_INT] = TRUE
    No error.


    In spsMode.src:
    $OUT[DIGOUT_ACTIVE_INT] = TRUE
    "The declaration of the variable 'DIGOUT_ACTIVE_INT' was not found."


    I must be missing something simple. What?

  • We are using KSS 8.2; KR C4 controller.
    The response from Kuka (USA) was that the PUBLIC keyword should be used for this purpose.


    In the Operating and Programming Instructions for System Integrators manual, PUBLIC is in the list of keywords, but the word 'public' appears nowhere in the manual outside that list.


    Seems as though PUBLIC has been deprecated in favor of GLOBAL.


    I wonder if the software in the robot matches the documentation that came with it.

  • GLOBAL is not new -- it's been part of KSS since late 4.x, if I recall correctly. I've used it quite a bit without any issues.


    However, for GLOBAL DECLs to work, the DEFDAT line of the .DAT file must also include the PUBLIC keyword to make the file's contents available to other modules.

  • Yes, Kuka sent me a manual from KSS 4.1 with GLOBAL in it.
    In the KSS 8.2 Programming for System Integrators manual, the DEFDAT statement as such is not documented. You can see DEFDAT in certain examples, but there is no section devoted to DEFDAT, its function and its options.
    And, as mentioned previously, the word 'public' does not appear anywhere in the 8.2 Programming for System Integrators manual, except in the list of keywords.


    When I create a new module in WorkVisual, the PUBLIC keyword is missing from the DEFDAT statement. That explains the problem.


    Interestingly, when I create a new module on the pendant, the PUBLIC keyword is appended to the DEFDAT statement.


    Strange.


    Thanks for your help.

  • Hm, that is interesting. I've gotten so used to creating my modules from scratch in a text editor that some of these oddities slip past me.


    My 8.2 manual actually mentions PUBLIC in the list of keywords, but never actually talks about how it's used anywhere. Strange.

Advertising from our partners