08-16-2010 02:22 PM
Presently, you cannot change the step size of a loop (I'm working on fixing that). What you can do is use a shift register initialized with a DBL constant. Inside the loop, use the add function to change the shift register contents by the step size. Use this shift register wire instead of the i terminal for an index.
08-16-2010 02:46 PM
@tbob wrote:
Presently, you cannot change the step size of a loop (I'm working on fixing that).
tbob means, of course, this idea: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Real-For-Loop/idi-p/1211713
I don't tbob is planning to rewrite LabVIEW starting with the for loop.
08-16-2010 02:46 PM
@NIquist wrote:
I saw that! You figured out the 'Add.vi' would work didn't you? You're starting to get it!
I would still suggest you look at the LabVIEW 101 tutorials. Once you get comfortable with LV basics it becomes a lot more fun to program with it.
I guess i wrote too soon. I thought you had worked out tbob's solution on your own. Let me re-quote myself:
"I would still suggest you look at the LabVIEW 101 tutorials. Once you get comfortable with LV basics it becomes a lot more fun to program with it."
tbob, what do you mean 'you're working on that'?!? How can you execute a fraction of a loop???
08-16-2010 02:49 PM
Wow smercurio. So you read minds too!
08-16-2010 02:57 PM
The idea isn't new. In text based languages, you can set the start, stop, and step size of a for loop. Others proposed the idea for Labview, so did I. But my wording was not the best, and newer ideas came up in the discussion. 99% of the times, the For Loop is OK as it is. I am working on presenting the idea again, but with a big twist. The change would be an option, sort of like right clicking to get a conditional terminal in a for loop. Most of the times, we don't use this, and we even forget its there. But when you need it, it is available. Watch for the new post in the idea exchange forum in the near future.
08-16-2010 03:05 PM
Gothcha tbob! I've already read the Idea Exchange thread. It's a good idea that needs careful thinking through. I'll be sure to look for your new IE post.
08-16-2010 03:24 PM
So I copy this ??
into this:
I tried to just copy first "circuit" but labview appears error
08-16-2010 03:31 PM
If you had studied the tutorials like you have been asked a number of times, you wouldn't be asking basic questions like this. Our time as volunteers is limited. We don't have time to teach labview to everone who posts here. DO THE TUTORIALS, NOW.
Read the error message. It tells you that the output is an array and your indicator is not. Fixing this would be very very trivial if you would just make an effort to learn Labview on your own.
08-16-2010 03:45 PM
Ok, I make this(check it), but why I need now step and array? I only need step 0-1 (user define), and you said that loop can't do this, so i must use array....
08-16-2010 03:52 PM
No, you're still not getting it. You can use a for loop OR a while loop. You don't need both in this very simple application. If you have the while loop version (bottom picture) working with your hardware then you need to use the shift register idea in the for loop (top picture) version, but put it in the while loop! You can right-click the border of the while loop and add a shift register. Then, wire it up the same way as in the top picture. You will need to modify the way the loop is stopped. You should be able to work that out. Please try at least.
Also, you should change the name of your Array indicator. It is NOT an array, it is just a double. That is confusing.