LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why Does This Throw Error 1162?

Solved!
Go to solution

This bug has been driving me nuts.  I've trimmed the code down to a tiny piece that fails.

 

This throws error 1162:

e.png

 

No error here:

ne.png

 

Why do I get an error when I pass the empty string through a cluster?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 9
(3,217 Views)

While I can't answer your question, I can confirm I get the same results on my LV2018/32 bit installation.

 

The weird thing is... if you delete the text "APP_FILE" in the String constant inside the Cluster constant, it works. You can replace it with other text and it fails. Looks like a bug to me. I wonder if it has something to do with the compiler doing some constant folding shenanigans?

 

Message 2 of 9
(3,196 Views)

I was also able to reproduce the behavior in 2019 and found the same pattern described in the previous post: if the string constant in the cluster is empty, then there's no error.

 

I have filed Bug #993017 for the appropriate team to further investigate and follow-up.

 

Thanks!

0 Kudos
Message 3 of 9
(3,188 Views)
Solution
Accepted by topic author paul_cardinale

I've discovered that in my little snippet, I can fix the problem with either this:

e1.png

 

or this:

 

e2.png

 

but neither fixes the problem in my real app.  In order to fix it in my real app, I have to do this:

e3.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 9
(3,182 Views)

And now in my main app, it's broken again.  The "Always copy" and "Type cast" functions are no longer effective.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 9
(3,080 Views)

No error with the following,

 

Snap6.png

You can always try another way to make a copy with this

Snap7.png

(Note your snippet with the typecast and always copy did not produce an error.)

 

mcduff

 

0 Kudos
Message 6 of 9
(3,068 Views)

This works.  You've got to trick the compiler into not inlining stuff.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 9
(3,061 Views)

@paul_cardinale wrote:

This works.  You've got to trick the compiler into not inlining stuff.


And now that doesn't work anymore.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 9
(3,041 Views)

Whether or not this bug is manifest seems to depend on whether the block diagram that owns "Get Menu Item Info" has ever been opened.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 9 of 9
(3,035 Views)