09-22-2009 01:54 PM
I have a Type Def that consists primarily of an array of clusters.
The cluster consists of five LEDs and two numeric displays.
These represent status information from an Axis in a motion system.
I would like to put a caption above the elements of the array to indicate the axis label for that element.
I initially had it as four individual clusters, but that provided problematic for other reasons and it is simpler from a programmability standpoint to use an array of clusters.
This control is used on multiple systems which have different designations for the Axes (hence the desire to have programmatic labels).
The closest posting to this was this one
http://forums.ni.com/ni/board/message?board.id=170&message.id=426506&query.id=991805#M426506
But it does not quite get what I want.
The simplest solution would be if there were a simple text string that could be changed programmatically that is not associated with a control, but I cannot find a reference to such an item.
If I use a real control (e.g. a string), I cannot make the control invisible and keep the caption.
Any ideas are appreciated.
Thanks
09-22-2009 03:05 PM
Try adding a string indicator to your status cluster. Use the Simple Sting indicator from the Classic palette. (no border) Set preferences so that the label and caption are not visible. Change the background color of the string indicator to match the background of the cluster. Now the cluster contains a string that identifies which axis it is associated with ( Easy to change at run time ) and it appears as text label in cluster.
09-22-2009 03:39 PM
I've used that approach in other clusters/arrays in the past.
This time I'm a little size constrained and I don't want to use the space needed for a string.
It wasn't going to work this time for aesthetic and sizing reasons.
However, I did not know about the classic simple string.
That seems to solve most of the issues.
The only other thing that would be really nice is if I could center the text.
I will check the property node.
Thanks
09-22-2009 03:43 PM - edited 09-22-2009 03:47 PM
You don't need a property node to center text. Select the string indicator and use the LV toolbar to set the Justify to center.
09-22-2009 03:56 PM
Aargghh!
I got so excited about the simple string fitting that I forgot that I update the cluster every 250 ms.
I either have to go to the database to get the label every time, pass in the original cluster so the label is available, or change to a reference.
That was why I wanted a string outside the actual status cluster.
Any other ideas?
Thanks.
Can Unsolution something?
09-23-2009 08:48 AM
09-23-2009 11:26 AM
That would probably work, and I probably should use shift registers more often.
I wound up putting a string array separate from the status array cluster above the status array.
That way, I only need to update the status each pass.
I used your idea about the simple string, but may wind up changing it for aesthetic reasons.
I need to work on sizing the array a little better, but it works for now.
Thanks for the idea
Also, thanks a lot for how to center things. I knew there had to be an easy way that I didn't know.