From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a type defined control refnum cluster?

Solved!
Go to solution
Ah HA!  Thanks, Steve, that did it.  I bundled the LED itself AND it's refnum into the cluster and it works great.  Much appreciated!
0 Kudos
Message 11 of 21
(1,670 Views)
0 Kudos
Message 12 of 21
(1,668 Views)
Thank you, too, Ben.
0 Kudos
Message 13 of 21
(1,663 Views)

I bundled the LED itself AND it's refnum into the cluster and it works great.

 

You don't need to bundle the indicator itself. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 14 of 21
(1,662 Views)
Huh. I took the LED out of the cluster/type definition and it still works.  I wonder what I was doing wrong all day yesterday?
0 Kudos
Message 15 of 21
(1,657 Views)

Steve -

 

Could you explain this a little more:

 

"A cluster with two CONTROL REFS in it is likewise just a container.

If you want references to REAL controls in it (rather than default NILs), you have to put them into the cluster."

 

?

0 Kudos
Message 16 of 21
(1,655 Views)

OK, you have a typedef, which is a cluster of (say) two CONTROL REFs.

 

If you place an instance of that on your panel (or a constant onto the diagram), all you have is a container.

The control refs are set to NIL, and they don't refer to any particular control.

If you want to pass this cluster around, presumably, you want to refer to real controls (so that a subVI can do something with the controls) .

For that to work, you have to populate the cluster.  By that I mean you have to get real references to real controls, and bundle them into the cluster.

 

It's EXACTLY the same as any other data type: if your typedef is a cluster of two integers, then when you put an instance onto your panel, you get zeroes.  If you want to USE it, you need to bundle your real numbers into it.

 

Clear? 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 17 of 21
(1,652 Views)

I'm pretty sure I'm understanding it now - The type defined cluster doesn't apply to any specific controls unless I bundle a control reference to it locally in the main VI.  The type definined cluster acts more like a pipe or wire into the subVI for the actual refnums?

 

It does seem a little different from a normal cluster, because with a cluster of buttons, for example, you can just drop the type def onto both VIs, wire them together, and one cluster can be manipulated directly to affect the other.  With the refnum typedef, the refnum in the typedef doesn't seem to be a "real" typedef, but more of a conduit or placeholder that you need to tie to a specific control.

 

Am I understanding correctly now?

 

Thanks for being patient.

0 Kudos
Message 18 of 21
(1,646 Views)

The type defined cluster doesn't apply to any specific controls unless I bundle a control reference to it locally in the main VI.

 

--- Exactly.

 

 

The type definined cluster acts more like a pipe or wire into the subVI for the actual refnums?

 

--- Exactly, though my preferred word is "container".

 

 

 

It does seem a little different from a normal cluster, because with a cluster of buttons, for example, you can just drop the type def onto both VIs, wire them together, and one cluster can be manipulated directly to affect the other. 

 

--- The exact same thing is true here, but it's the REFERENCE that's being passed.  A cluster of BUTTONS is a package of boolean values.  If you create an indicator on the other end, then the values of one end show up on the other, because the DATA is being passed from here to there.

With a cluster of CONTROL REFS,  if you create an indicator on the other end, then the values of one end show up on the other, because the DATA is being passed from here to there. IT'S STILL TRUE!  The difference is that a CONTROL REF indicator doesn't show you the value it contains (because that value is not useful to you).  But that value, contained in the reference, is a connection to a specific control (or indicator) on a specific panel.  You can connect that value to a property node and play with all kinds of properties in the original control.

 

 

 

With the refnum typedef, the refnum in the typedef doesn't seem to be a "real" typedef, but more of a conduit or placeholder that you need to tie to a specific control.

 

--- On the contrary, it is every bit as "real" as any other typedef. Back to the cluster of I32s, if you want to pass your data from here to there, you have to bundle your values of 16, and 5128 into the cluster before you pass it down the pipe. If you want to pass your references from here to there, you have to bundle a reference to THIS PARTICULAR led, and THIS PARTICULAR switch into the cluster before you pass it down the pipe.

There is no difference whatsoever. 

 

Message Edited by CoastalMaineBird on 03-25-2009 11:27 AM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 19 of 21
(1,637 Views)
Frighteningly, I'm understanding this now.  Thank you for the explanations and your patience.
0 Kudos
Message 20 of 21
(1,633 Views)