LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refnum becoming zero

Solved!
Go to solution

Hello ,

 

I am working on Report generation toolkit for MS office, Excel to be specific.

 

I have a loop where in the program takes data from one sheet and pastes it to another sheet for performing some operations,

 

during this time, refnum value suddenly becomes zero. Strange behavior observed,

 

It says Error 1 occured at " Generate Report Get data to modify.vi:20

Possible reasons

Object 0X000000 is not valid 

 

What happens to the refnum value suddenly ?

 

Thanks

0 Kudos
Message 1 of 7
(3,318 Views)
Solution
Accepted by cancancanopen

Do you pass your refnum around the loop with a shift register?

 

If you do, does the refnum somehow change after one of the report generation VIs and need to be changed back?

 

Posting some code would help me debug your problem very quickly...

0 Kudos
Message 2 of 7
(3,316 Views)

Hi there

 

It would be helpful to see an example of the code. Are you able to post the code or at least the section that is not working ?

 

Just out of interest are you using shift registers to pass the refnum around the loop ? 

 

Also, are you performing and activities in parallel to the loop ? Perhaps on a different class or a class that inherits from the the class returning the error ?

 

Regards

 

Don't forget to give Kudo's for a good answer !

LabVIEW Champion
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 3 of 7
(3,313 Views)
You are probably closing a reference moving between cases or frames.
Tim
GHSP
0 Kudos
Message 4 of 7
(3,305 Views)

Well after posting this question I too got the idea of replacing tunnel with the shift register,

 

if you could tell me what happens when I use tunnel and what happens when i use shift register while using refnum or any other data type.

 

Thanks.

 

Till now shift register is working fine for me, hope i dont get any error.

0 Kudos
Message 5 of 7
(3,303 Views)

Wild guess!

 

If your tunnel is set for "Use defualt if not wired" and your code hits the un-wired case...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 7
(3,298 Views)

cancancanopen wrote:

Till now shift register is working fine for me, hope i dont get any error.


 

When wiring across FOR loops, shift registers will keep the reference valid even if the number of iterations is zero.

 

(e.g. if one of the autoindexing array inputs is size=zero).

 

A plain output tunnel will get the default value for the datatype, so the original reference is lost.

 

(Of course (as Ben already mentioned) you also need to wire the reference across in all cases, so make sure all case output tunnels are solid colored.) 

 

Message 7 of 7
(3,287 Views)