LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A tunneled Excel refnum goes from a valid value to a NULL between iterations of a For Loop?

How would a tunneled Excel refnum go from a valid value to a NULL between iterations of a For Loop?
For some reason this works find in one VI and when executed and not in another.  Here's screen shots of the highlighted execution with probes appropriately. The "Open" refnum is passed into "Performance Test - Write Data To Files.vi".  That's where the trouble is.  You can see that it goes into the For Loop.  The first iteration is okay, but the second and subsequent iterations have the refnum NULL.  See images below.

(I don't know how to delete an accidental double post, sorry)


Message Edited by James DiLiberto on 01-22-2008 01:48 PM
0 Kudos
Message 1 of 4
(3,106 Views)

Is there any chance that the Insert Data Into Excel VI is closing the reference or that it is closed anywhere else (e.g. through a local or by having its owner destroyed)?

I wouldn't expect the numeric value of the reference to change to 0, but since ActiveX is an external resource, I suppose that it's possible that the probe shows the number only if the resource is actually accessible.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(3,093 Views)
Have you tried wiring the refnum to a shift register?  I would recommend using a shift reg. on both loops.






Message Edited by vt92 on 01-22-2008 02:22 PM
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 3 of 4
(3,081 Views)
Thank you everyone.   I was closing the reference to OPEN inside the VI where it was used. That's why it works in one and not the other.  Thank you. Gotta be careful about where we close our refnums.   Thanks.
0 Kudos
Message 4 of 4
(3,076 Views)