取消
显示结果 
搜索替代 
您的意思是: 

Creating a type defined control refnum cluster?

已解决!
转到解答
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 项奖励
11 条消息(共 21 条)
2,610 次查看
0 项奖励
12 条消息(共 21 条)
2,608 次查看
Thank you, too, Ben.
0 项奖励
13 条消息(共 21 条)
2,603 次查看

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


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 项奖励
14 条消息(共 21 条)
2,602 次查看
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 项奖励
15 条消息(共 21 条)
2,597 次查看

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 项奖励
16 条消息(共 21 条)
2,595 次查看

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


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 项奖励
17 条消息(共 21 条)
2,592 次查看

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 项奖励
18 条消息(共 21 条)
2,586 次查看

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


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 项奖励
19 条消息(共 21 条)
2,577 次查看
Frighteningly, I'm understanding this now.  Thank you for the explanations and your patience.
0 项奖励
20 条消息(共 21 条)
2,573 次查看