LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change displayed text based on threshold value

Solved!
Go to solution

Hi Labview users,

I need some help with displaying and changing text in labview.

The text should display and change according to the following conditions:

 

0 volts - "No power"

1 volt - "Controller ON"

2 volts - "Rotor Running"

3 volts - " Rotor stopped"

 

Based on the voltage read by the channel, the corresponding text should be displayed and changed on the same area of front panel. For example, at start it is gonna be 0 volts and the "No power" text should be displayed as a text indicator (and not as a warning message). It should change to "Controller ON" when the input voltage chages from 0 to 1 volt. The channel reads Analog Input Voltage (Range 0-5V).

I am fairly new to labview. So please give me pointers or suggestions on how this can be done. Any help is greatly appreciated.

 

Thanks,

Raj

0 Kudos
Message 1 of 11
(4,033 Views)

Hi,

 

Do you have a proto VI you can post.  This is really a wide open question.

 

You could have the text in an array, and when you pass a threshold you read from the next index. 

You could use a text ring, and feed the rounded voltage as the value of the text ring.

 

 

Ultimately you have to decide what type of storage are you going to use for the text values.  Will these be hard coded or read from a file?

 

How will your VI update the GUI?  Will you use a state machine, an event structure, a simple while loop?

 

So, please post your VI or provide some more specific details, you will be able to get more replies.

 

-------
Mark Ramsdale
-------
Message 2 of 11
(4,031 Views)

Hi Mark,

Thanks for the prompt reply. I dont have a VI yet. Can you show me an example how to have the text in an array and read from next index when a threshold is passed? Also can you show me how to make use of text ting? I havent used any of these features before. I would greatly appreciate if you can give me some directions/example code and I can use this as an opportunity to learn something new in labview.

 

Note:

1. The custom text message will be hard coded.

2. GUI update - by means of a simple while loop.

 

Thanks,

Raj

0 Kudos
Message 3 of 11
(4,025 Views)

The thresholding is easy.  If you look in the array palette you will find a Threshold 1D Array.  It returns an index.  This index is fractional, but you can just let it round down.  You can then use this index to index your string array constant.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 11
(4,016 Views)

Hello crossrulz,

That was helpful. Can you show me an example how to have the text in an array and read from next index when a threshold is passed. Thanks for your time and help.

 

Regards,

Raj

0 Kudos
Message 5 of 11
(4,009 Views)

I'm sorry, but I just told you EXACTLY what to use.  And this is so small, you shouldn't need an example.  It takes 2 primitives (Threshold 1D Array and Index Array), and 2 constants (double array for thresholds and string array for text).  Show me that you are trying and I will help.  But constantly asking for examples for something as simple as this without showing what you have tried will yield nothing from us.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 11
(4,001 Views)
Solution
Accepted by topic author Rajesh_Hariharan

HI,

 

Thanks for the notes crossrulz, haven't used the threshold before.  For this simple example it is "symmetric", but I can see how if the values in the array were not matching the index position this would be real useful.  Learn something every day, I couldn't resist, wanted to try it out.

 

Ok,  here is a sample VI that puts out a custom message based on passing a threshold.  Homework is to study the components before asking 🙂

 

 

The dice are the analog signal from 0 to six.   It rounds to lowest integer to provide the index number.  The index number is feed into the index array, the array being the hard coded text messages.

 

The two extra indicators can be deleted, useful for seeing what is happening.

 

And, you have to get rid of the 0 if you want the text to match the number, he he he Smiley LOL

 

Enjoy.

 

Presentation1.png

-------
Mark Ramsdale
-------
Message 7 of 11
(4,000 Views)

Hello Mark,

Can you please send me a 2010 SP1 compatible version of this sample VI?

 

Thanks,

Raj

0 Kudos
Message 8 of 11
(3,969 Views)

@Rajesh_Hariharan wrote:

Hello Mark,

Can you please send me a 2010 SP1 compatible version of this sample VI?

 

Thanks,

Raj


You can see all of the code in the snippet.  Why not try to build it yourself?  It'll take a lot less time.

Again, you are showing no effort to do this yourself.  You are looking for a handout.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 11
(3,948 Views)

Hello crossrulz, Mark

As per your advise, I tried coding in labview and have achieved the functionality I needed. My goal was to add this functionality in the attached VIs to another VI which i coded few days ago. The attached code doesn't work when I used the same logic and circuit in another VI. I am not sure which part of the code is incorrect. I have attached the VIs. can you please take a look and tell me which part of the code I am doing incorrectly?

 

Note: I have taken your advice seriously and have been trying to figure things out in labview as I am new to labview interfae. I would like to thank you for your time and help.

 

Attachments: Untitled 4.vi is the main VI and Untitled 3.vi is the sub VI. I will attach the other 2 VIs in a separate post on this thread.

 

Thanks,

Raj

 

Download All
0 Kudos
Message 10 of 11
(3,932 Views)