LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I Need an Array of Rotated String Indicators

Greetings,

 

I need to make an array containing verticle strings. The size of the array will very during runtime.

 

I know that for a single string indicator I can ignore the actual control, rotate the caption and change its text property and for a cluster there's an array of references to each member which can be used for accessing the caption text of each member but it appears that all members of an array share a caption.

 

Am I correct that there's no way (yet) to do that?

 

Peace

phroggie

 

 

0 Kudos
Message 1 of 14
(3,095 Views)

Hi phrog,

 

as has been siad a lot of times before in the forum:

In an array all elements share the same properties, they only differ in value!

 

Does that answer your question?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(3,089 Views)

You should be able to do this using a picture control. Here are some options:

 

  1. Draw everything yourself in the correct orientation (the text VI should have an orientation input).
  2. Draw everything normally and then take the resulting array of pixels and rotate it.
  3. Use a standard array or table control off screen, get its image (using a direct method or using the Panel's Get Image method and cutting it) and then rotate that image.

___________________
Try to take over the world!
Message 3 of 14
(3,071 Views)

Hello phrog,

 

This functionality can be implemented in LabVIEW by adding a custom string indicator to an array. First create a single array indicator and customize it to exhibit the desired behavior. Then add this string indicator to an array on the front panel. As GerdW has said, every element in an array shares the same properties as the control/indicator you add to it. So by placing a custom indicator in an array you ensure that every string element posses the same customizations.

0 Kudos
Message 4 of 14
(3,033 Views)

Yes, I'm aware that all the elements of the array share properties.

 

But how do I make a rotated string indicator?

 

(Other than converting the text to a bitmap and rotating that. I'm not sure that's practical in this case. Also, I'd rather the OS does the vertical text rendering. Once it's a bitmap there's no anti-aliasing.)

 

Will an Xcontrol handle it?

0 Kudos
Message 5 of 14
(3,023 Views)

An Xcontrol won't help you because you can't put XControls in arrays. Even if you could, they would still share properties.

 

If you don't want to use picture controls because of the rendering (I never looked into that), then another option you have is an array of subpanels, where each panel shows a copy of a VI which only has a control. This is more complicated, both because you can't actually put a subpanel into an array any more than you can an XControl and because you need to somehow communicate with all the VIs. If you want to look into this, you can search for "array of subpanels" and find some examples I posted here. You also still have the last option I mentioned in the previous reply.


___________________
Try to take over the world!
0 Kudos
Message 6 of 14
(2,990 Views)

Make a cluster with floating text objects.  Set their vertical orientations as desired.  (You also have to put a control in it (but you can hide it)

Those text objects are decorations whose references can be accessed through a property node of the cluster; through those references, the text can be updated.

See attachment.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 14
(2,952 Views)

Greetings,

 

Thank you Paul. I have been toying with that very idea but I'm not sure it would work in my case.

 

The number of elements will change during runtime. And I have to accommodate anywhere from 1 to at least 256, but preferably more. 

 

To make it work, I'd have make a cluster with the maximum number of elements I intend/expect to support then set the Visible propery on each member each time the size changes. Meanwhile, the indicator would not  resize and, correct me if I'm wrong, there won't be a horizontal scroll bar.

 

Thank you again

 

0 Kudos
Message 8 of 14
(2,946 Views)

Hello Phrog,

 

It seems like the solution proposed by Paul is sufficient for your application. But I would like to suggest an alternative solution  (with its own trade offs) that may address some of your functionality concerns. The width of a string indicator and text wrapping can both be set in the properties menu. Because of these settings, each character would appear vertically stacked. An array of these string indicators could be sized dynamically and viewed using a scroll bar. Unfortunately the letter “m” is wider than combinations of other two letters such as “is”. If the width is set too low then the letter “m” gets cutoff. If the width is set too high then smaller letters like “is” appear on the same line. There is no magic width that prevents these two cases.

 

The example I have attached works around the letter “m” by appending a space between each non-m character and uses an indicator width of 23 pixels. This is enough space to display the letter “m” while the inserted spaces prevent smaller letters from appearing on the same line. Despite this inconvenience, you gain the use of built in dynamic array sizing and the horizontal  scroll bar.

 

Otherwise, scroll bar functionality is not built into clusters. It is possible to implement a scroll bar for a cluster programmatically as shown in this community example: https://decibel.ni.com/content/docs/DOC-35704

 

This solution isn't necessarily easy to implement, so using stacked characters in an array may be a worthwhile trade off depending on your application.

0 Kudos
Message 9 of 14
(2,908 Views)

Thanks, Earl.

 

This might be the only way to do it. It may not be pretty since I won't be able to "bottom justify" (or it won't be easy) but at least I'm using an array of string indicators. Also, I'll try a fixed width typeface.

 

Thank you

0 Kudos
Message 10 of 14
(2,898 Views)