07-12-2008 01:54 AM
07-12-2008 09:22 AM - edited 07-12-2008 09:23 AM
07-14-2008 12:12 PM
Thanks for your reply. I am still have trouble with the VI. I stubbed out a VI to demonstrate. I selected an ActiveX object that should be on you PC, but if it is not there you'll need to select a different one. Here is a JPG of the VI:
Attached is the actual VI
I was hoping I could add an integer indicator to display the value of the ActiveX ref but could not figure out how to do it. Can you tell me how I can add an indicator on the VI to show the value in a way similar to the probe?
07-14-2008 12:30 PM
07-14-2008 12:39 PM
07-14-2008 12:58 PM
07-14-2008 03:00 PM
07-14-2008 03:07 PM
LabVIEW is not C.
@mefitzpatrick wrote:I assumed that the value for the ref was held in memory between calls to the VI. Just like a static var is used in C.
I still don't understand why you're insisting on using local variables.
I was hoping to hide theref from the calling VI. To fix the problem I put the ref in the caller vi and wired it into this vi. This VI returns the new ref to the caller, which is wired into a local var for the ref.This fixes the problem of keeping the ref open during the app, however, I can't hide the ref from the caller like i would like.
07-14-2008 04:29 PM
It is. It's just that once the top level VI goes idle the resource the reference is pointing to is garbage collected (although, as mentioned, this is not something you should rely on when working with an external resource like ActiveX).
mefitzpatrick wrote:
I assumed that the value for the ref was held in memory between calls to the VI.
07-15-2008 11:37 AM
Hi,
You do have to hide the ref from the VI if you use shift registers as suggested in the last post. I assume you were trying to hide the ref because you did not want the VI to get a new value of the ref everytime it runs. However, with a shift register it passes the current value of the ref at every iteration--therefore you should not be dealing with a new ref every time as the initial value will remain open. Hope this helps.
Ipshita C.