11-16-2009 11:13 PM
I'm trying to count the iterations above and below 0 applied volts (Vapp). This is used as a SubVI inside a For Loop. One of these (the positive, I think) seems to work, reinitializing at zero for each run. The other seems to add to the previous run each time.
For instance, 6 intervals each below and above zero returns 6 and 6 the first run, and 6 and 12 the second time. I know it's a hack, but I didn't know how to do this better.
Solved! Go to Solution.
11-16-2009 11:22 PM
I am still trying to figure out what your question is?
Can you elaborate more what exactly you want and what problem you are facing?
11-16-2009 11:45 PM
Maybe you should attach your toplevel VI too. It is not clear how the inputs are supposed to be wired.
What is purpose of the "interval counter" input?
What is your definition of an "interval"?
Shouldn't your counters be blue?
11-16-2009 11:50 PM
11-17-2009 12:59 PM
I found *a* fix, I think, somewhere else, eventually. If I add this to my SubVI, it should work, right?
I don't know why the polymorphic numeric data controls and indicators are not all blue, except that some of the inputs, like voltage, are orange to begin with.
I didn't add my top-level VI because it's big, and has many other SubVIs. (I've added it here.) Interval Counter is used in the bottom, left-hand corner of the For Loop.
11-17-2009 01:05 PM
(Voltage) "Interval" == "Iteration", as in "number of 2V intervals between -minV and 0V" and "number of (same size) intervals between 0V and maxV", where min and max voltage, as well as the total number of intervals are set by the user.
Interval Counter is a check against the calculated, intended number of intervals.
I couldn't figure out the "Reset if [i]=0", and *just* saw the attachment, but I need it to reset automatically every time it's called by the main VI, not be manually done by the user.
Thanks.
11-17-2009 01:14 PM
Emm wrote:but I need it to reset automatically every time it's called by the main VI, not be manually done by the user.
If you reset it every time you call the subVI it, it will never be able to count anything. Right?
If you only want to reset it at the first iteration of the main loop of the toplevel VI, you would wire a "=0" to the iteration terminal and the output of it to the reset therminal of my subVI. Try it.
11-17-2009 03:47 PM
Okay, I think I've got it. I kept the formerly mis-named "Interval Counter" (Iteration) control link instead of the Numeric Constant, but it looks like it should work. Can't test it at home. 😞
Thanks!