10-15-2012 10:46 AM
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
Solved! Go to Solution.
10-15-2012 10:57 AM - edited 10-15-2012 10:57 AM
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.
10-15-2012 11:07 AM
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
10-15-2012 11:21 AM
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.
10-15-2012 11:27 AM
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
10-15-2012 11:36 AM
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.
10-15-2012 11:36 AM - edited 10-15-2012 11:41 AM
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
Enjoy.
10-15-2012 03:13 PM
Hello Mark,
Can you please send me a 2010 SP1 compatible version of this sample VI?
Thanks,
Raj
10-16-2012 07:30 AM
@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.
10-16-2012 05:30 PM
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