LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making a Pict Ring with a String output

I notice the Pict Ring control only seems capable of outputting numeric data at its terminal. Is it possible to create a Pict Ring that outputs string data instead, without having to resort to throwing in case selectors on the block diagram? (Perhaps there is some way to do this by customizing a Combo Box?)
0 Kudos
Message 1 of 10
(4,035 Views)

How exactly would you define the strings that your pict ring would output?  If you simply want the ring numeric value as a string, then you could use the Decimal String to Number function to convert the ring value to a string.  Otherwise, I don't see how you would define the string values other than a case structure, or perhaps with an array of strings and the Index Array function (that's probably how I would do it).

-D

0 Kudos
Message 2 of 10
(4,032 Views)
A combo box lets you define strings for different selections; that's why I was thinking that modding a combo box might be involved.

Perhaps I should go into greater detail. Presently I am using an ordinary text control for the item in question. The data that this control outputs is used all over the place in my VI, and I decided some time ago that it was probably better to use local variables with this control rather than have wires running everywhere.

If I use an ordinary pict ring for this and use it to index an array, I'll still have to wire the resulting string to an invisble control or indicator to keep things the way they are. Otherwise, I'll have to make some pretty major changes - either adding index arrays everywhere or getting rid of all my local variables.
0 Kudos
Message 3 of 10
(4,026 Views)

If you're using LabVIEW 8.0, you can create an XControl that has the appearance of a Picture Ring but is actually a string datatype that will output the appropriate value based on the index value of the picture ring.

-D

0 Kudos
Message 4 of 10
(4,022 Views)
Interesting... However, I'm sticking with LabView 7.1.1 for now. (I should have mentioned that earlier.) I gather it does not have similar functionality?

It occurs to me that if I get really desperate, I can always try to put together a custom font, with the pictures I want taking the place of ordinary characters, and then use a combo box. Of course, the pictures would have to be black and white then.
0 Kudos
Message 5 of 10
(4,017 Views)

That's right, XControls are only in LabVIEW 8.0.  Another thing I thought of is that you can create a little "bullet" subVI that does the conversion for you, and just insert this subVI on any wire where you need to read the string value instead of the control value.  I have attached a sample VI (saved in LabVIEW 7.1) to this post to show you what I'm talking about.  Drop it on another VI's diagram and notice it takes up very little space.

Good luck,
-D

0 Kudos
Message 6 of 10
(4,012 Views)
You could use a Text and Pict Ring. Use a Strings[] property node to get the text array. Then use the terminal value to index the string array.
0 Kudos
Message 7 of 10
(4,009 Views)
If you don't want to see the text displayed,  you can customize the control and shrink the text and hide it behind the picture by moving it to the back.
0 Kudos
Message 8 of 10
(4,003 Views)
Yet simpler, read the RingText.Text property.


LabVIEW, C'est LabVIEW

Message 9 of 10
(3,994 Views)
Indeed, I suppose that would do it! Thanks!
0 Kudos
Message 10 of 10
(3,987 Views)