|
|||||||||||||
Today, if we want a FOR loop with a fixed number of iterations, we need to wire a diagram constant to N. We could probably save a few clicks if we could click on N and type in an integer directly. It would also unclutter the diagram. This should of course only work if N is unwired.
Of course the N-Box would grow to the right to accomodate all digits
To later change the loop back to "normal", we would type N into the box or simply wire something numeric to N from the left.
As an example how it could look like, here's a simple cross product implementation (Yes, I know, LabVIEW already has a cross-product, so this is just to show the idea!)
Top: current implementation
Bottom: Same code after this proposed idea has been implemented

Quite obvious conservation of BD real estate and improvement of coding style, while no loss of functionality. Kudos!
/Steen
What happens when your fixed number of iterations is something like 56156? Does the box grow to contain the full number? Does it change to a symbol representing a larger-than-one-digit number?
What is the outcome of these two sequences? Would they even be possible?
1a. Wire from the left
1b. Enter number into N box.
Q: Does your code break? Does your manual-entry just not get implimented? Does it become some crazy "if wire is NaN or Inf then use what the user typed" kind of thing?
2a. Enter number into box.
2b. Wire from the left (number changes to N as per your Idea).
2c. Remove wire from the left.
Q: Does your defined iterations come back (it was "saved")? Does it stay as N and possibly break code?
Overall, I like the Idea. Kudos.
- I'd like the box to grow to show the entire number.
- Q1: I'd expect the wire to break, meaning the last action takes precedence.
- Q2: I'd expect that "N" stays put in this case, thus breaking the code. It would be weird if the loop structure remembered an old entry. Again, last action takes precedence.
/Steen
I'll go on the record that I'm not sold on this idea. Seems like syntactic sugar, which as has been noted elsewhere, isn't something we generally like to work on. But keep trying to convince me!
Some questions...
Q3: Will you still be able to wire the "N" value inside the For Loop? I assume so; I don't see any reason to disallow that.
Q4: Can I wire the "N" value outside the loop and use it as a source of data? E.g., if I want to wire my constant N value somewhere else? Something like this...
Purely my opinion here:
Q3: Absolutely
Q4: I would say no. This idea is to be all intrinsic to the loop. Wiring it to another loop seems counter-intuitive. Or dataflow would say that loop 1 must run before loop 2. But there would be an output tunnel for the loop.
You must be a registered user to add a comment here. If you've already registered, please log in. If you haven't registered yet, please register and log in.
Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
My Profile | Privacy |
Legal |
Contact NI
© 2011 National Instruments Corporation. All rights reserved. | E-Mail this Page
|
||

E-Mail this Page