LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

struct

Hi,

I would like to know if there is any structure in LABVIEW to create as a library where I can save one name and its numerical value.

For example, I save:

RESET  8

START   12

OFF       64

In that way, if I want to compare if Reset is bigger than 12, I don´t have to put all  the time that the reset has the value 8. I write one string constant with the name "Reset" and I know that this name is going to have the value 8 saved.

Best regards

 

0 Kudos
Message 1 of 10
(2,820 Views)

Hi 99,

 


@labview99 wrote:

Hi,

I would like to know if there is any structure in LABVIEW to create as a library where I can save one name and its numerical value.

For example, I save:

RESET  8

START   12

OFF       64

In that way, if I want to compare if Reset is bigger than 12, I don´t have to put all  the time that the reset has the value 8. I write one string constant with the name "Reset" and I know that this name is going to have the value 8 saved.


The way you describe this problem seems to indicate you are looking for a LookUpTable (LUT). These LUTs can be implemented using VariantAttributes (in older LabVIEW versions) or using Sets/Maps (in recent LabVIEW versions)…

You also should link to your other threads to give a broader view on your problem, like this or that

 

Btw. why should "Reset be bigger than 12" when you define it as value=8?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(2,802 Views)

The comparison was only one example. It is just compare with one number. So, this "set attrobute" would work like one struct? I would have all the names that I want with its corresponding value? 

0 Kudos
Message 3 of 10
(2,785 Views)

I have read that I cando it also creating a cluster in LabVIEW that duplicates the layout of the C struct. Then I have to configure the call library function node,  as "Adapt to type" and  I have to wire the cluster to the input for that parameter. But I don´t know how to configure the call library function node, could you help me please?

0 Kudos
Message 4 of 10
(2,776 Views)

What I want is to create as a library in LABVIEW to save, for example the name of ine person and his age.

JHON=30

MARY=23

So, when I use the names in my program, it is going to be like if I was using the age.

I don´t know if I have explained better myself

0 Kudos
Message 5 of 10
(2,762 Views)

Hola

Estoy tratando de hacer algo parecido. Solo que mas sencillo. Me gustaría guardar el nombre de una persona y su edad. Así en mi programa puedo comparar quien es mas mayor utilizando los nombres en vez de sus edades, porque cada nombre tendrá grabada una edad.

0 Kudos
Message 6 of 10
(2,754 Views)

Hi 99,

 

see this old thread about using Variant attributes to create fast LUTs!

Are you able to use LV2019? Then you should use maps to create your LUTs

 


@labview99 wrote:

I have read that I cando it also creating a cluster in LabVIEW that duplicates the layout of the C struct. Then I have to configure the call library function node,  as "Adapt to type" and  I have to wire the cluster to the input for that parameter. But I don´t know how to configure the call library function node, could you help me please?


Why do you mention the CLFN at all? How is it related to your current problem???

 


@labview99 wrote:

What I want is to create as a library in LABVIEW to save, for example the name of ine person and his age.

JHON=30

MARY=23

So, when I use the names in my program, it is going to be like if I was using the age.


So you still need a LUT? Why does it has be (some kind of) library? Please explain all details of your problem!

 

All your questions indicate you really should take the Training resources offered in the header of this LabVIEW board! Did you take any lessons so far?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(2,750 Views)

Hi 99,

 


@labview99 wrote:

Hola

Estoy tratando de …


You have been told to post in the Spanish regional board when you want to write in Spanish.

It also doesn't make sense to ask for something similar, but still different, in a very old thread.

 

Please stick with one thread per problem!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(2,746 Views)

My problem is that I want to create as a library to save the name of a person and her age.

For example:

JHON=30

MARY=23

....

And the I want to compare people and see who is taller. I mean, instead of being comparing the ages I compare with the names of the pepople because its one has the age saved.

0 Kudos
Message 9 of 10
(2,743 Views)

Hi 99,

 


@labview99 wrote:

My problem is that I want to create as a library to save the name of a person and her age.


So you want to create a LUT. See explanations and links above.

 

Why does it has to be "created as a library"? ("Library" refers to either LabVIEW LLB files or Windows DLLs in my understanding…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(2,733 Views)