LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Assign string to set of constants

Solved!
Go to solution

I am trying to create a Labview that will allow me to enter the name of a string which will correspond to two constants of my choosing, a and b, which are numbers.

 

I can not find a solution to my problem, I do not want to find the equivalent of my string in numbers.

 

The string would be something like Helium. Inputing helium would correspond to a value of a=4 and b =2

I need to do this for 5 more string inputs with different a and b values.

 

Does anyone have any guidance as to where to find instructions on how to do this or maybe you even know the solution?

0 Kudos
Message 1 of 6
(2,505 Views)

@dalbyoj wrote:

I am trying to create a Labview that will allow me to enter the name of a string which will correspond to two constants of my choosing, a and b, which are numbers.

 

I can not find a solution to my problem, I do not want to find the equivalent of my string in numbers.

 

The string would be something like Helium. Inputing helium would correspond to a value of a=4 and b =2

I need to do this for 5 more string inputs with different a and b values.

 

Does anyone have any guidance as to where to find instructions on how to do this or maybe you even know the solution?


Welcome to the NI forums!  your problem can be easily solved in many different ways with LabVIEW .... Smiley Wink  show us what you have done so far?

0 Kudos
Message 2 of 6
(2,472 Views)

It looks something like this, but I have not done it correctly. Currently I have no sub vi that works at all yet. I need where it says helium to be an input which corresponds to a string name. From that string name I need to find a way to import different a and b values. This is just a rough skeleton of where I am trying to get if I insert the a and b values as inputs. Does that make sense? 

 

I am in an introductory engineering course and we use labview to solve problems, but they do not want me to manually input the a and b every time. Rather I need to only input the Element name, Specfic Gas Volume, and Absolute Temperature.

2014-03-05 03.20.59 pm.png

0 Kudos
Message 3 of 6
(2,462 Views)

Create either an enum or a ring control that has the names of your elements.

 

Create a 2-D array constant.  Column 0 is your A, column 1 is your B.  Each row represents an element from your enum or ring constant.

 

Wire the enum or ring constant to an Index Array for that array constant, you'll get a 1-D array for that corresponding row.  Then index array on that to break out the A value and B value.

0 Kudos
Message 4 of 6
(2,445 Views)
Solution
Accepted by topic author dalbyoj

I illustrated RavensFan's explanation below.  However, I created an array of clusters instead of a 2D array to make things a bit more readable.

 

2014-03-05_1610.png

Drew T.
Camber Ridge, LLC.
0 Kudos
Message 5 of 6
(2,430 Views)

Wow awesome you guys were a great help!!!

 

Now to get this thing to work output and calculate like it is supposed to, which I should be able to figure out from here with a little trial and error. Much appreciated!

0 Kudos
Message 6 of 6
(2,420 Views)