06-05-2015 07:12 AM
Hi All,
I need to to pass argument to block which is generated by same block.
For your undestannding i am attached my vi code , there i have 3 blocks.
Block 1, Block 2, Block3.
The block 2 output is going to block 3 as an input , the block 3 generating some output that i need to pass again to blcok 3. (Basicaly like recursive function in C).
How to do this in labview. Kindly suggest me.
Your help will be greatly appreciable.
Regards
Punith
06-05-2015 07:17 AM
Assuming you're using LabVIEW >= 2009, just put the VI inside - you need to make sure that the VI is set to reentrant execution.
There are more details here: http://www.ni.com/white-paper/9387/en/
06-05-2015 07:24 AM
Hi Sam,
Thanks for your reply but even i made recursive , how to connect argument to block 3.
Regards
Punith
06-05-2015 07:52 AM
What do you want to connect it to? I don't see anything in this VI that needs recursion. Do you just want to use the value on the next iteration of your loop?
06-05-2015 07:54 AM
Where did you get the idea of using "blank" In-Place Element structures (for example, your Block 3, which seems to contain more of these curious things)? As far as I know, they do nothing in LabVIEW (except cause confusion in people such as I).
You mention "recursive functions in c". The key word is functions. The analogous LabVIEW equivalent would be a reentrant VI. If Block 3 were a VI, you could make it reentrant, so within Block 3 it could call itself. However, there is no such VI, so there is no reentrancy.
I believe you have received the suggestion to spend the time to view (and follow along doing the examples) the LabVIEW Tutorials. It doesn't seem like you have invested very much time in trying to learn LabVIEW. True, you can, indeed, learn a lot by "doing experiments", but it really helps to have some idea of the basic fundamentals.
Based on your Recursive_Test VI, here are some suggestions:
Bob Schor
06-05-2015 08:07 AM
HI Bob,
Thanks for your suggestion , Can you suggest on fallowings.
1. If i dont use "In Place elament structure" how can i tell the compiler , what is the flow of execution.(means order of execution).
2. Is it possibel to call sub vi from sub vi?.
3. if create subvi there are so many outputs , that i need to pass to my main vi indicators. How to do that.
4. i tested by making subvi and assinging "shared clone reentrant execution property", but it is not working.
Regards
Punith
06-05-2015 10:42 AM
@punee wrote:
1. If i dont use "In Place elament structure" how can i tell the compiler , what is the flow of execution.(means order of execution).
2. Is it possibel to call sub vi from sub vi?.
3. if create subvi there are so many outputs , that i need to pass to my main vi indicators. How to do that.
4. i tested by making subvi and assinging "shared clone reentrant execution property", but it is not working.