Total number of blocks in the current program ?

  • Hello,


    KRC2, KR5002MT, KSS5.6


    I would like to get the total number of blocks in a given src program. Is that possible ? I could not find a system variable to get this information. I can use $PRO_IP to know where the pointer currently is in the program, but my goal is to get an estimation of when the program should finish ... Is there another option to evaluate the progression of a running program ?

  • Hm... not sure, but the first thing that occurs to me is to use VARSTATE ("$PRO_IP1.SI0x.something"), and cycle x through numbers until you find the highest number that doesn't return #DECLARED.


    EDIT: This is a KRC2, so it would be "$PRO_IP", not "$PRO_IP1", and the $INTERPRETER variable would need to be set to 1.

    Edited once, last by SkyeFire ().


  • ... but my goal is to get an estimation of when the program should finish ... Is there another option to evaluate the progression of a running program ?


    Don't think that the information about the actual line number will help. The estimated time will highly depend on the program structure and the programmed speed. If You have a loop at the end of the program, the pointer is two lines in front of the end the runtime can last forever. :icon_mrgreen:

Advertising from our partners