Jump to content

Maximum subroutine size


Recommended Posts

  • MVP 2023

Is there some other limit beyond just number of nets? Visilogic is giving me a compile error on one subroutine with 118 nets (including the RET). The error message says "Subroutine ladder data size exceeds limit. Split subroutine to solve problem". It says it is "Type/Num" 55.

It's no problem to split the subroutine, just want to know what I'm dealing with here.

Link to comment
Share on other sites

I have gotten this same message on programs that are well under the known ladder size limit. I believe the reason is that in the programs this has happened to me in have a large number of nets that have multiple rows of actions within that single net. I have never taken to adding it all up but I believe that if I were to add all of the program rows (not the number of nets) it may exceed the 256 limit.

Just a guess, but empirical evidence says that there is definately another limit other than just the quantity of nets.

Keith

Link to comment
Share on other sites

In fact YES - there is another limit - the volume of the compiled code per subroutine. I don't remember what is the value, but it doesn't matter in fact, as it's very difficult (practically impossible) to measure this value.

Again my advices

- write simple rungs;

- put one rung per net;

- split the code to short, logical, easy to edit and debug subroutines.

In my opinion, it's not difficult to follow these advices and the programmer can only win.

Link to comment
Share on other sites

  • MVP 2023

This makes sense.

In my case, almost none of the nets have more than one row, but most of them have 3 Data Table function blocks each. This subroutine creates a viewable log file using data tables. Because of the complexity of the equipment this program is controlling, this subroutine was larger than I normally need. There may be a more efficient way of doing what I'm trying to do using available Vision functionality, but I haven't figured it out yet.

Link to comment
Share on other sites

  • 11 years later...
  • MVP 2023

Translated - 

A question.... And how are the sub routines created? I have the same problem every time I try to delete a "hide vars". Greetings

 

While in the ladder editor click this button

image.png.3c2521d290c1dfda93e422e429a943de.png

 

In the menu you can also Find "Add New Subroutine" under "Insert".

 

Regarding removing "Hide Vars" - anytime there's a little eraser next to the field that's how you clear it

image.png.384b59a284083f446889fdf673dee3da.png

 

Joe T.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...