Jump to content

Max code (total lines) in Main Routine

Recommended Posts

Hi Guys

I create a code with 25 lines. I need use the same code for more 138 inputs.

Is possible use all codes in main routine ? - I try view the size off program but, visilogic show only in color´s bar.

That accord of size show in bar´s color is possible. I don´t find a way for view size off program in Bit´s, Bit´s or other information. I use V130, Visilogic 9.3.1.

Good weekend for all.

Link to comment
Share on other sites

In any case the max nets in one sub is 255. There are limitations in the volume of the code too.

Writing in one sub is quite not possible. And - I don't see any advantage to od so. Disadvantages - how much you want?

In such project, the best solution is to make one "general" subroutine and in a Data table to keep the real addresses. This will make programming way easier and elegant.

There is relevant example in VisiLogic.

Link to comment
Share on other sites

Agree with Joe and Emil.

If you have to do it 138 times.................. write it once, debug it once.

You can use indirect addressing to carefully organized operand ranges, or data tables.

With 138 operations, the data tables might be a little slow, but would be easier to deal with.

If you have a lot of timers, you might want to build your own based of the internal clocks rather than the built in timers.

Link to comment
Share on other sites

Mr Joe, Emil and Damian, thanks for response.

My application is pulse counter. I use a V130-33-t38 , 8 modules IO-DI16 and 1 Ex-A1.

Joe, the time is not critical. I calculate, max 2, 3 pulses per minute for each input.

If i say, the code for one input have 20 lines. These lines, 11 are routines that will only be activated under specific conditions.

If this happens, the main routine will 1242 lines with 138 sub with approx 9 lines each. These values are problem ?

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.

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...