08-29-2013 10:02 PM
New to labschool, taking an electronics in graduate school. Set up this circuit. The question read:
(b) Write a VI that calculates the voltage drop across R2 for all of the following:
R2=0, 50, 100, 200, 400, 800, 1600, and 3200 (other components values are as in (a)). Use
a for loop to calculate the value and build arrays for the voltage and R2 values. Make a graph
of them in your front panel.
(c) Calculate the voltage drop across R1 as R2 is varied as in (b). This can be done by modifying
the previous VI. Plot the voltage drop across R1 vs. R2 up to and including the case where
R2=3200.
This is for part c. I'm not getting any error messages, yet I'm not getting my output values! I did it on b and it worked. Not sure what the deal is. Any ideas?
08-29-2013 10:19 PM - edited 08-29-2013 10:21 PM
You have an empty array control called Vout. It auto-indexes the For Loop. That loop will run ZERO times.
08-29-2013 10:20 PM
Yes we do have an idea. Can you upload your VI in 2011 format for debugging purpose..
Thanks
08-29-2013 10:52 PM
I just deleted it and readded it, and it seemed to clear it. At first I got the same errors, then I changed it to an indicator and it worked. So the auto-indexing, it doesn't take into consideration the N at the top left of the loop?
08-29-2013 10:53 PM
I seriously said labschool? Oh my God, I need sleep. I'm sorry guys, been at this for a long time.
08-30-2013 12:17 AM
Once you have hands off it..You really gonna appreciate it...
08-30-2013 12:18 AM
@Torii wrote:
I just deleted it and readded it, and it seemed to clear it. At first I got the same errors, then I changed it to an indicator and it worked. So the auto-indexing, it doesn't take into consideration the N at the top left of the loop?
I dont think deteting and readding solved problem
08-30-2013 01:15 AM
If you wire the N terminal and several autoindexing arrays, the loop will stop at the lesser.
A common trap for LabVIEW newbies and also sometimes for experienced programmers.
08-30-2013 01:51 AM - edited 08-30-2013 01:54 AM
Your "Vout" is a control, not an indicator. Nothing ever writes to it. Your FOR loop just pumps hot air and does not produce any output.
Calling an output of the formula node "Vout" is completely independent and does not magically write to an array control with the same name.
(What's the purpose of "R2" and "R2 2", seems redundant. Also learn about autoindexing. All your terminals belong before the loop, they need to be read only once)
08-30-2013 07:45 AM
I did the two R2's to wire it to the graph. Do I not need that? Or can I take the wire like I did from Vout from the node to vout, and wire it off that wire to the cluster thing. (I am so LabVIEW illiterate it's not even funny. Sorry!)
Definitely going to try and figure out auto-indexing. Paolo, you wrote that the loop stops at the lesser--I'm not 100% sure what that means.