LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi return same value?

Hi, i used 2 same sub-vi in my main vi why does it give same output while their inputs are of different values.It seems to me that somehow it overide each another. Did i for got to declare anything on my sub vi to prevent this?
 
 
0 Kudos
Message 1 of 4
(2,795 Views)
The output must be dependent on the input, so something is wrong. How do you call the VI? Is the output terminal connected to the code in the subVI? Are all inputs properly connected?
 
Does the VI have any memory (e.g. uniniitialized shift registers)?
 
Could you attach your VI or some example code that demonstrates the problem?

Message Edited by altenbach on 09-01-2005 03:06 PM

0 Kudos
Message 2 of 4
(2,792 Views)
opps the vi does use shift register. Attached is the sub vi i used more than once in the main. 
0 Kudos
Message 3 of 4
(2,787 Views)
No, it only uses initialized shift registers, so there should be no problem. If you call this VI with the single input (1D DBL) and output (2D DBL) connected, it should not give you any stale data at all. You can call it at many locations and it should always work.
 
There must be a mistake in your calling program. Have you found it yet?
 
(BTW: you don't need shift registers and empty dummy arrays, just use autoindexing instead. You should also do the second division outside the loop, no need to repeat the same calculation with every iteration. See attached crude simplification (LabVIEW 7.0)). 🙂
 
0 Kudos
Message 4 of 4
(2,783 Views)