Variable Display

  • Hi,


    Having some trouble displaying the a integer variable. variable is declared is .src and .dat file. program is a simple for loop and need to display the cycle count to prove a no of cycles to customer. program is shown below. Have not worked with displaying variables in KRC4 so would like to get a grasp of this


  • Where do you want it displayed? In the Variable Monitor, or printed to a message on the pendant? For the former, Hermann's method is what you need. For the latter, you want to look into the MsgLib program that comes with every KUKAbot (located in the /System directory).

  • depending where and how variable is declared affects scope as well as how and when it can be monitored. run-time variables cannot be monitored when or iprogram is running, whenf program is not selected, or when selected but advance run reached routine end or is inside another routine.


    variable declared in DAT file can be monitored if program is selected, does not matter if running or not, if ended or not.


    and monitoring in Overview works for GLOBAL variables only....

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • So i declared the variable in the config.dat file under user defined variables and still unable to view cycle count is variable display- single. appears a 1 when BCO is reached but when FOR loop is ran 50 times, not showing anything.


    Also when update is selected, error appears "no runtime data selected"


    Should the variable in config dat be declared as a global variable and the called in the .src or .dat file as well

  • as already stated, you cannot monitor any variable any time you like. show your code. where and how your variable is declared? your last message suggests it is still a runtime variable instead of being declared in the DAT file. are you sure you don't have two same or similiarly named variables?

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • The variable was declared in the .src file but then tried to declare it as a global in the .dat file but believe i done it incorrectly using the kuka programming manual partly because the .dat file was in german and wouldnt allow me to modify blocks.


    The code is in the first post.

  • Hi,


    So got it displaying. Problem was i had the .dat opened selected rather than opened. Once i sorted that added, DECL GLOBAL INT ROW to the list and saved that. Then removed the declaration from the .src file and worked a treat.


    Thanks for all the help

Advertising from our partners