LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Point me in the right direction please

Solved!
Go to solution

Hello,

 

I am querying a device for its settings. The device will return a code. What I would like to do is from the returned code assign to this code a piece of text (ie. "the instrument is on" for 1 or "the instrument is sleeping" for 2).

 

How do I do this?

 

Thanks,,

 

Nevica

0 Kudos
Message 1 of 7
(2,296 Views)

It seems to me you are describing an Enumerated type. Use the enumerated type as an indicator and pass the code to the input. But that really doesn't give you a "text" string. Do you really want the result to be a string? That can be done using a case structure, or creating yourself an array of strings that matches the code and then using the returned code to select the index of you array.

0 Kudos
Message 2 of 7
(2,289 Views)

How do I index an array. I think this is what I want!!!

 

Nevica

0 Kudos
Message 3 of 7
(2,285 Views)

The simplest way...

 

Chart.PNG

0 Kudos
Message 4 of 7
(2,277 Views)

Thanks, thats how I imagined it would work. But how do I create the 1 by 3 indexed string matrix (the purple box). I cannot find this anywhere. I am searching for indexed string and I cannot find in example finder!!!

 

 

Thanks,

 

Nevica 

0 Kudos
Message 5 of 7
(2,274 Views)

Place an array constant and a string constant on the block diagram.

 

Now drag the string constant into the array constant with your mouse. It should turn from black to pink.

 

Now you have created an "Array of string" constant.

 

 

0 Kudos
Message 6 of 7
(2,271 Views)
Solution
Accepted by topic author nevica

Aha, that's how its done. thanks.

0 Kudos
Message 7 of 7
(2,268 Views)