LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent Variant to Data Errors

Solved!
Go to solution

Hello all,

 

I'm getting a very inconsistent error with one of my SubVI's. If I'm trying to debug and I turn execution highlighting on in my main VI, I get an error (see picture attached below). If I don't have execution highlighting on, it works most of the time. However, when I run the SubVI by itself with execution on or off, it works fine. In the Main VI I'm using the "Fract/Exp String to Number" function. It errors out at the "WorksheetFunction" Variant to Data functions. Any ideas?

 

Thanks all!Error.png

Download All
0 Kudos
Message 1 of 15
(3,287 Views)

I finally got it to error out consistently, and I just don't get it. If you run the attached VI with the two SubVI's, enter into the string input "0407.05007.020179" and run it with execution highlighting on. It will error out at the Variant to Data functions. As you can see, I tried using two different data types and it errors out regardless.

.Test.png

0 Kudos
Message 2 of 15
(3,266 Views)

I can't check it now, so this is a pure guess:

value.png

Try putting additional time delay between Worksheet.Activate and executing VLookup.

0 Kudos
Message 3 of 15
(3,246 Views)

Have you tried putting probes on the variants that are causing problems?

 

Also, I can't get this to run - I get an error with the VLookup function.  Might be a difference in versions of Excel.  Are you sure your range should end at fu300?  There's no need to do the explicit conversions TO variants, LabVIEW will handle that automatically.

0 Kudos
Message 4 of 15
(3,238 Views)

Thanks for the responses, I fixed the "Excel get data specified field" VI that I believe was causing it to not run for you guys. I attached the main VI and two sub VIs along with the spreadsheets for you to test out. As for the "To Variant" functions, I put those in there just to see if it would make a difference. Before that I had them wired directly into the VLookup function arguments with the same issue. Test.VI is the main program.

 

I've put probes in the wires that send arguments to the VLookup function and they all have the correct information, but for the wire that comes out of the VLookup function, it is empty. This is with execution highlighting on.

0 Kudos
Message 5 of 15
(3,211 Views)

Hello PiDi,

 

I tried putting as high as a 3 second delay between Worksheet Activate and the Worksheet Range function with no success. Same issue. Thanks though

0 Kudos
Message 6 of 15
(3,209 Views)

Update:

 

I decided to probe the wire coming out of the Range function, and the value is "0". This must be the issue. Any ideas on how to fix that?

0 Kudos
Message 7 of 15
(3,206 Views)

It appears the Error.zip file is corrupt, when I try to unzip the file I get an error saying its an invalid zip file.

Systems Engineer
SISU
0 Kudos
Message 8 of 15
(3,190 Views)

Strange... I zipped it again, try it now.

0 Kudos
Message 9 of 15
(3,184 Views)

Can you unzip it on your machine?  I still cannot open it with the windows zip extractor.  The error says "The Compressed (zipped) Folder '...Error.zip' is invalid."  

It may be easier to attach just the files.

Systems Engineer
SISU
0 Kudos
Message 10 of 15
(3,177 Views)