04-22-2006 01:49 PM
04-24-2006 07:50 AM
Hello Tomi,
First, I'll give you the quick answers to your questions. The entire VI doesn't get copied for reentrant VIs, only its dataspace. That is of course until you start opening other components. That said, the cloned data spaces for your reentrant copies do get created by the Open VI Reference when you provide the 0x08 flag. The way LabVIEW handles multiple front panels / block diagrams of cloned reentrant VIs changed drastically between versions 7.1 and 8.0, so I won't get into that unless you have follow-up questions and supply which LabVIEW version you're using.
Now I have a question for you. The help for the options input of Open VI Reference (which you undoubtedly had to look at to find the admitedly esoteric "0x08" flag) also explains it saying, "Prepare for reentrant run. Reserves the target VI so it cannot be edited and if the target VI is reentrant, allocates a dedicated parallel data space for this VI reference..." I was just wondering if you'd read this or not. I myself am at least as guilty as anyone for asking questions before referring to the help sometimes, but if you did read it, I'd be interested to know if there's anything we can do to make it more clear.
Thanks!
04-24-2006 08:14 AM
That said,
the cloned data spaces for your reentrant copies do get created by the
Open VI Reference when you provide the 0x08 flag.
So when I create a reference a singel data space is created if I understood it correctly. But I can make simultaneous calls to the same reference by wiring the same reference to multiple call by reference node instances. Do the additional data spaces get allocated when the call is made?
The way LabVIEW handles multiple front panels / block diagrams of cloned reentrant VIs changed drastically between versions 7.1 and 8.0, so I won't get into that unless you have follow-up questions and supply which LabVIEW version you're using.
I am using 8.0.1 but the software should also work on 7.1. Can you provide at least some guidelines on how the dataspace is allocated in both cases, it doesn't have to be detailed.
The reason I am asking the question is to find out how to optimise time critical process of dynamical calls to implement object oriented dynamic member functions. I need these to simplify implementation of an interpreter I am working on. I have a C++ implementation up and running but I'd like to use Labview because of better support for data visualisation. If you are implementing OO in LV 9, I'd be pleased to know. In that case you can contact me also directly, my email address is in my profile.
Now I have a question for you. The help for the options input of Open VI Reference (which you undoubtedly had to look at to find the admitedly esoteric "0x08" flag) also explains it saying, "Prepare for reentrant run. Reserves the target VI so it cannot be edited and if the target VI is reentrant, allocates a dedicated parallel data space for this VI reference..." I was just wondering if you'd read this or not. I myself am at least as guilty as anyone for asking questions before referring to the help sometimes, but if you did read it, I'd be interested to know if there's anything we can do to make it more clear.
I'd be happy to help. The thing is that I have no idea what happens when 0x08 flag is not used. The way memory is allocated in normal case is not described anywhere. Then it doesn't make sence to tell how things are done with 0x08 flag, if one doesn't have anything to compare it with. It would be more clear to me if the normal function would be clearly described. Then when using the 0x08 you would tell the difference to the standard mode.
The second issue which is not clear is the thing that since reentrant VI can be called simultaneously from multiple instances using the same reference, how the dataspace allocation is done. This is what I asked above already. Does it make a difference is I use 0x08 option or not to call multiple instances of the same re-entrant VI.
Thanks!
04-25-2006 07:48 AM
That said, the cloned data spaces for your reentrant copies do get created by the Open VI Reference when you provide the 0x08 flag.
So when I create a reference a singel data space is created if I understood it correctly. But I can make simultaneous calls to the same reference by wiring the same reference to multiple call by reference node instances. Do the additional data spaces get allocated when the call is made?
No, but I think I finally I see where the confusion is. The cloned data spaces are created by the Open VI Reference function. The Call By Reference Node does not do this. If you ran a VI that opened a reference to a reentrant VI, and sent that reference to three Call By Reference Nodes, the same single instance would run three times, serially, just like a regular subVI. To get the behavior you want, you would need to use three Open VI References (or put one in a for loop or something), then use those references for your Call By Reference Nodes.
I am using 8.0.1 but the software should also work on 7.1. Can you provide at least some guidelines on how the dataspace is allocated in both cases, it doesn't have to be detailed.
The behavior is the same between 7.1 and 8.0.1 in this regard. The differences show up when you start trying to open the front panels or block diagrams of reentrant VIs. Most notably, when you open a front panel of a running reentrant VI in LabVIEW 7.1, you get the "actual" VI and the front panel never updates with the values being sent to that particular call. Further, reentrant VIs are not debuggable. Both these limitations are no longer present in 8.0.
Thank you for the help feedback, I have passed that along as well (ID#3WO6JR1W).
04-25-2006 10:48 AM
04-26-2006 08:19 AM
04-26-2006 09:21 AM
04-26-2006 10:00 AM