Jump to content

Creating Controls from References


Recommended Posts

Puzzle of the day:

Open a new vi and drop an array on the front panel. Fill array with a dbl.

On the BD, create a reference to the array. Then right-click on the reference and create a control of the reference. Up to this point there should be no errors reported.

Now induce an error. For example, make a local variable from the array but don't attach it to anything. Check the Error List. Along with the expected "local variable not connected to anything..." is another error:

"Front Panel Terminal 'Array': hidden front panel control has undefined type"

Delete the local variable and once again, there are no errors reported.

Where did this come from? If there was an error, why didn't it show up until there was another completely unrelated error? What don't I understand about references (well, a whole lot, probably, but in this case specifically)?

A few notes:

1) It doesn't seem to matter what the array is filled with, it still breaks

2) A cluster breaks it, too

3) If you right-click on the reference control on the FP and select "Show Control", it shows an empty array

4) If you delete the created FP reference control and re-create a FP reference control by dragging the BD reference to the FP, it does *not* show the extra "hidden front panel control has undefined type" error (behaving correctly, I assume)

5) The FP reference created in #4 shows a dbl array when you select "Show Control" (behaving correctly, I assume)

6) If you do the above exercise with a plain numeric, it does *not* show the extra "hidden front panel control has undefined type" error (also behaving correctly, I assume)

My conclusions:

1) creating a FP control reference of an array/cluster by directly creating a control on the BD isn't working right (but scalars are fine), or

2) It's working exactly how it should be working, but when the error gets reported (after something else goes wrong) isn't working right, or

3) I don't have a clue about references

Can anyone replicate this or let me know what it is I'm missing? I'm using v8.5.1.

Cat

Link to comment

QUOTE (Cat @ Mar 11 2009, 10:58 AM)

I think you're seeing a remnant error message from LV development that's been (mostly) surpressed.

(Warning: the next steps might just cause your computer to melt, explode, or give strange websites your CC number. If this bothers you, go to the next thread now :))

1. Use the http://wiki.lavag.org/Insane_Objects' rel='nofollow' target="_blank">lvdebugkeys trick.

2. Delete everything on your front panel but the new reference.

3. In Heap Peek, highlight the FPHP line for your vi.

4. In Heap Peek's object list, select the item labelled "Array".

You'll see a bit in the description that is something like:

'Array': 1-D array of (@0x0)

' ': void (@0x0)

This is the "hidden" array type behind the refnum control. (Clicking F will give you a hint to its location. Selecting "Numeric Label" and clicking F will actually show you the darned thing.) Since the type is "void", I suspect the compiler normally would complain (break the VI), but that particular error has probably been explicitly ignored. The error showing up in the error dialog is likely an oversight.

Interesting behavior, but probably not a big deal.

Joe Z.

Link to comment

QUOTE (jzoller @ Mar 11 2009, 03:34 PM)

Where was this wiki page 10 or 15 years ago when a day rarely went by that LV wasn't throwing an "Insane Object" error? :-) Thanks for the link!

And no it's not a big deal, except when this control is in a bundle that I use to feed a state machine thru 15 states and the error appears in Error List 30 times. Then it's a bit annoying.

QUOTE (Aristos Queue @ Mar 11 2009, 06:26 PM)

Here's a far simpler explanation: Pop up on the Refnum control and select "Show Control". That's the control that is being talked about.

Thru process of elimination I figured out what control was throwing the error. What I don't understand is the difference in behaviour related to 1) how the reference is created, and 2) whether it's a reference to an array or a scalar.

That's the Reader's Digest version of my previous page-long post. :-)

Cat

Link to comment

QUOTE (Aristos Queue @ Mar 11 2009, 04:26 PM)

Here's a far simpler explanation: Pop up on the Refnum control and select "Show Control". That's the control that is being talked about.

... I honestly didn't know that option was there. Hrmph. Maybe in another decade I'll know all this stuff.

Joe Z.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.