February 17, 2019, 08:03:17 AM
Robotforum | Industrial Robots Community

 Name not declared as subprogram

Author Topic:  Name not declared as subprogram  (Read 210 times)

0 Members and 1 Guest are viewing this topic.

February 06, 2019, 03:43:18 PM
Read 210 times
Offline

bagged2drag


Environment:  Work Visual V4.0.30, Kuka KSS 8.2.14 (I believe, or a bit higher)

Issue:  After loading some new subroutines, one of them returns an error on the robot "name not declared as subprogram" for both .src and .dat.

I looked in the manuals for both workvisual and the 8.2 programming manual for SI, and I didn't see any mention of this, or differences in how a main program or subroutine should be defined.   I don't see anything drastic between the routines that did load correctly and the one that didn't either.

Am I missing something here? 

Thank you,

Today at 08:03:17 AM
Reply #1

Advertisement

Guest

February 06, 2019, 04:31:16 PM
Reply #1
Offline

SkyeFire

Global Moderator
Details?  You've left out all the code, the actual modules that report the error, and any description of the DEF lines involved.  Not to mention, whether this error occurs at a Call, or a DEF.  Also, whether it's a subroutine or function.  Or if it is the "name" routine of a module, a subroutine/function lower in a module, and whether there are any GLOBAL DEFs involved.

February 06, 2019, 04:42:36 PM
Reply #2
Offline

panic mode

Global Moderator
click on file that has errors, view errors, expand all folds, then pick and follow errors one by one. cursor will take you to line that has invalid name. if it is indeed a subprogram name, then subprogram is not on the controller. it can also be that line of code is not a subprogram but robot assumes it is a subprogram (for example comment without semicolon).
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

February 06, 2019, 05:37:46 PM
Reply #3
Offline

bagged2drag


I have attached the files. 

I have expanded all folds.  The error  display only on the pendent only lists line 192, column 1, error 2135 "Name not declared as subprogram."   I double checked and the subprogram does exist, is spelled the same.   In Workvisual, I have a green box in the upper right hand corner - no red box or marks in the bar.   I can deliberately manipulate the code in workvisual to make an error, but get the green box when I correct it there.  The error on line 192 is an EXIT.  The subroutine is called at line 196. 

February 06, 2019, 05:42:39 PM
Reply #4
Offline

bagged2drag


I just deleted it on the pendent and redeployed it.  That took care of it.   Any reason why this would be the case?   :wallbash:

February 06, 2019, 05:46:28 PM
Reply #5
Offline

panic mode

Global Moderator
robot told you why... just read the message.




btw line numbers on teach pendant are not the same if you look at code in some text editor.

February 06, 2019, 08:34:26 PM
Reply #6
Offline

bagged2drag


Thats why I was confused.  I already corrected the error and re-deployed a couple times.  Even revised my rev name in the deployment.  Still didn't take care of the issue until I manually deleted the files, and redeployed it again. 

What good is a line and column # if it doesn't match either workvisual or a text editor?  Seems odd.  I get it; it will get you close, but sometimes close isn't real helpful.    :hmmm:

As always, I appreciate the help though.  You guys are super knowledgeable. 


Today at 08:03:17 AM
Reply #7

Advertisement

Guest

February 06, 2019, 09:04:32 PM
Reply #7
Offline

panic mode

Global Moderator
It takes me exactly to the problem line every time. Just look for cursor, no character counting...


Key is to expand folds first since it will not open them for you.






February 06, 2019, 09:45:14 PM
Reply #8
Offline

bagged2drag


I did expand the folds, i think the issue is more that the new changes didn't upload to the robot for whatever reason.  I was also doing some IO symbol renaming at the time, and those changes did go through. 

Is there a way to "go to" the error? 

February 07, 2019, 01:07:59 AM
Reply #9
Offline

panic mode

Global Moderator
yes, highlight defective program module, click on Error list, expand all folds, pick one of faults from the list and click on Display. that is the "goto error"
« Last Edit: February 07, 2019, 01:09:48 AM by panic mode »


Share via facebook Share via linkedin Share via pinterest Share via reddit Share via twitter

xx
How to overcome the Error: "Name not declared as subprogram"???

Started by ShaM on KUKA Robot Forum

5 Replies
2861 Views
Last post April 25, 2015, 09:01:49 AM
by ShaM
xx
Is there any way to know if a variable is declared without getting an error?

Started by JoanM on KUKA Robot Forum

3 Replies
1897 Views
Last post September 18, 2014, 06:13:27 AM
by JoanM
xx
Visibility of variables declared in .dat file

Started by fnesti on KUKA Robot Forum

0 Replies
206 Views
Last post October 24, 2018, 12:08:16 PM
by fnesti
question
SPS in Subprogram

Started by ILoveRobots on SEF & VW Robot Forum

1 Replies
2715 Views
Last post May 30, 2017, 12:54:31 PM
by T-Bjorn