News:

  • June 29, 2026, 02:23:29 AM

Login with username, password and session length

Author Topic: Is there a For Next limit  (Read 12369 times)

rbenz

  • Newbie
  • *
  • Posts: 4
Is there a For Next limit
« on: December 08, 2014, 10:16:05 PM »
I have set up conversion utility for converting a bunch of analog inputs into engineering units.
I have 4 real files for rawmin rawmax, engmin and engmax.   I used a For Next routine with using V10 as both the indexer and the pointer - the first loop starting at 0 to 12, no problems.  The next for next same V10 starting at 100 to 153 again no problems.  The last analog input i again set a for next loop starting v10 at 200 to 212.  It wouldn't run. I tried all sorts of things and finally had to move 200 into v10, do a scale INC and repeat over and over.  I tried a bunch of things to solve this riddle even putting in a hard input inside the for next but it would latch.  Im wondering if the Do more has some sort of limit on For Next Loops??
Thanks

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Is there a For Next limit
« Reply #1 on: December 09, 2014, 07:52:23 AM »
There is not a limit on the FOR/NEXT.
Is this all inside a task?
Could you post your program or screenshots?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Is there a For Next limit
« Reply #2 on: December 09, 2014, 09:25:31 AM »
No limit. Happy to look at it. You can post here, or send it to support@hosteng.com.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

rbenz

  • Newbie
  • *
  • Posts: 4
Re: Is there a For Next limit
« Reply #3 on: December 09, 2014, 11:49:26 AM »
Attached is a PDF of the program.  The first two loops are fine as they correctly scale the WX - analog inputs - and stuff them into "R" values.  The last loop doesn't run at all.  I disabled the scale routine and put in run that merely moved the wx into the R and still no luck.

To get around the problem I had to put in the scaling in sequenced ladders, duplicating the loop with a bunch of ladders.   
 

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Is there a For Next limit
« Reply #4 on: December 09, 2014, 12:05:32 PM »
You have your FOR Index:V13, From: 200, To: 8.
You cannot count down with an FOR. If you want to count down then add a MATH box inside the loop that will invert the index.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Is there a For Next limit
« Reply #5 on: December 09, 2014, 12:12:20 PM »
You cannot count down with an FOR.

Yeah...sorry. We wanted to, but it was going to make the instruction implementation harder, so we opted to keep it simple.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

rbenz

  • Newbie
  • *
  • Posts: 4
Re: Is there a For Next limit
« Reply #6 on: December 09, 2014, 01:51:15 PM »
Thanks.  I went to a Math box and it worked.  Ill buy you a beer.


plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Is there a For Next limit
« Reply #7 on: December 09, 2014, 02:24:16 PM »
Glad you got it going.
For the benefit of future forum users, could you post your updated program?
Thanks.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com