Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: plcnut on June 12, 2013, 10:03:33 AM
-
From the help file: By Step - will increment or decrement the counter by the value that is specified. Specify a positive By Step value if the For/Next loop is counting up, or a negative By Step value if the For/Next loop is counting down. This value can be any positive or negative integer constant except 0, or any readable numeric location.
The FOR will not accept a negative constant in the By Step, so I loaded a negative number into a N and put the N in the By Step, but it won't work. ???
-
I'd say the help is wrong.
-
It's hard to get good help these days.
-
I'd say I said something like "it works like BASIC's FOR/NEXT loop" which does support counting down...so...the help problem is likely the engineer that lied...
-
Okay. I can work around it.
-
Just stop being so negative and you'll be fine! ;D
-
Okay. I can work around it.
You should be used to that by now.
-
Okay. I can work around it.
You should be used to that by now.
Hey, I'm totally impressed to be using a FOR/NEXT in a PLC... negatives or not! ;D
-
I think we talked about doing up and down at the time we designed it, and convinced ourselves that since we support variables for every parameter in the FOR, there were 100 ways it could go horribly wrong. In an effort to reduce that to 80 or 90, we decided to count up only. ::)