LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Datatype creation with inside binding

Hello,

 

I didn't use LabView for quite some time now so I may simply have forgotten how to properly approach the problem...

 

I want to create some kind of data with Typedef that would kind of bind data inside. Let's say I would create a cluster with Ring control specifying several values. Like "SI, SA, SB" etc.

Then I would like to have a second control inside that would have proper descriptions for each of the SI, SA, SB that I could show to the user at runtime. Also I probably want more data than that. All of them bound so when I select SI I get description about SI, values for SI and such.

 

What would be a proper approach? Can I create it in controls? I would prefer to skip doing it programatically. Less code, less things to worry about.

 

I currently use it as on the png file. I could select it from an array of strings but what for?

 

Regards

 

@Edit: I guess I am looking for something along a dictionary in normal programming languages. Let's say I have a key by which I find data rather than index. I could connect it to an enum or rather... I'd like that enum to configure what happens.

0 Kudos
Message 1 of 8
(2,764 Views)

Vitae,

 

Could you solve this by having the 'blind' object be variant data, and adding variant attributes?

Variant data.png

 

Or do you need to have the ring control visible as a user interface item?

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 2 of 8
(2,751 Views)

Without a doubt a ring item on front panel. I would like it to be a single ring item having bound many data types.

 

Like you would use:

 

MyType.SI.Text = "Whatever"

MyType.SI.Desc = "Longer whatever"

MyType.SI.Value = 1023 or something

MyType.SI = bind to ring control...

So I would create a control MyType and it would have data encapsulated for value SI...

 

Using classes for that? I get so confused with LabVIEW way...

0 Kudos
Message 3 of 8
(2,747 Views)

@Vitae

Like you would use:

 

MyType.SI.Text = "Whatever"

MyType.SI.Desc = "Longer whatever"

MyType.SI.Value = 1023 or something

MyType.SI = bind to ring control...

So I would create a control MyType and it would have data encapsulated for value SI...


Hmmm quick question, would those datatypes be static or expanding at runtime?

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 4 of 8
(2,740 Views)

If static this is def a use case for LV classes:

class view.PNGdoes this all fit in snippet.png

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 5 of 8
(2,731 Views)

drat i am spamming here, but please note:

In the example i just threw together "SI.Value" and "SI Value" are two separate locations. The first of which is a value in vitaeRing.ctl called "SI.Value" that is being written/read from.

 

The second is digging into the reference to the front panel control (pointed to at the first step of this block diagram) and accessing the Value property for that control.

 

Similarly you could create other "VI for data member access" to further mess with the properties of the ring control.

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 6 of 8
(2,724 Views)

It sounds like a decent solution. Will work fine. I was wondering if the same could be applicable by creating a control only. I will experiment. Thank you.

 

Oh. Could I ask you to export it to a LV2013 format? I have license up to 2013 at work. Thanks again.

0 Kudos
Message 7 of 8
(2,708 Views)

here ya go

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 8 of 8
(2,702 Views)