Programmat​ically autosize a string indicator

Here is a real challenge I would say: Programmatically size a string indicator and/or the window size, such that it mimics the behaviour of the 'message' indicator of the One Button Dialog box.

This isn't difficult. You just have to find the right VIs to do it 
Use the "Get Text Rect.vi" in picture.llb (in LV7.1). Depending on the
font and other parameters it'll return the size of the text in pixels.
Use this output to set the string indicator size (maybe adding a
constant) and the windows size (adding a constant).

Similar Messages

  • How can I export formatted text from a string indicator?

    Does someone know how I can export formatted text (i.e., parts of the text have different formatting, such as color, fontsize, etc.) from a string indicator? Using copy/paste does not work, as it only exports unformatted plain text.

    Hello Sparti,
        Thank you for your suggestions, they are all very useful, and I plan to use the HTML feature under Report Generation to export the formatted text from Labview. However, I am still not sure how I can extract the formatted text from a *string indicator* and transfer it to one of those VIs, so that it can be exported to other applications. Let me give some more specific info on what I am trying to achieve:  I am monitoring the communication between two pieces of equipment. A string indicator shows all the data flow, with different colors for data coming from different instruments. I managed to do that by using a property node and playing with the selection and font color properties. Now, if you just wire the output of the string indicator, the formatting is gone and all you get is just plain black text (for instance, try to programmatically transfer the formatted text from one string indicator to a different string indicator and you will see that the formatting is not preserved). Even if you try the "brute force" method of manually selecting and copying the text in the indicator and pasting it to Word, LV does not export the formatting. But, if you paste *within*  LV (for example, paste it to a string constant in your diagram), then it works. To extract the formatted string from the indicator, I also tried to use a property node, but without success. I am trying to avoid duplicating part of my code to generate the same color-coding scheme on a report. It would be way easier to be able to transfer the formatted text from the string indicator. This is particularly annoying, because the information is there, stored in the data structure associated with the string indicator. But how can I put my hands on it? Any ideas?

  • Set text font string indicator

    Hi!
    Is there a way to change the font in a string indicator?
    and is there a font in LabVIEW that has equal spacing for every caracter?
    Solved!
    Go to Solution.

    That means you want to change the font programmatically.
    Well... here is a twist..  Typically, this is done using the Caption for the indicator, because it also allow you to be able to change the text (string).
    The shortcut way to do this is to:
    1. within the block diagram, right-click the indicator and select create property node
    2. use the selector to choose the Caption > text > font  (It could be Caption.text.font)
    Now I do not remember if it is a numeric value that is put in for the font... 
    Change to Write (right-click on property node and select "Change All to Write"  (simply because my memory is not that good  + no LabVIEW with me)
    Then right click on the bottom box, where it displays the Caption.text.font and select create constant.  It should then allow you to select the font.  Otherwise, you can click on the question mark ar the upper right corner (Context Help) which will guide you.  Context Help can also be found under the Help Menu.
    Hope this helps.

  • Force a string indicator to scroll to the bottom

    In LV Web UI Builder is there a way to force or programmatically scroll a string indicator to the bottom? 
    I am building a virtual hyperterminal and I am writting a very large amount of data into a string control.  I have the vertical scroll bars turned on, but by default it just shows the information at the top.  I want to include all of the data so that the user can scroll back to see the history, but it would be nice if by default the scroll bar would stay at the bottom.

    I just wanted to confirm there is no way currently to force a string indicator to scroll to the bottom. I will note this down as a product suggestion for the Web UI Builder team.
    Vivek Nath
    National Instruments
    Applications Engineer
    Machine Vision

  • Change the colour of lines in the same string indicator.

    Hi everybody,
    I'm getting crazy, because I'm looking for the way to change the colour of
    the lines I want in the same string indicator.
    I'm doing an application to control an instrument by serial port, and I'm
    concatenating the lines that this instrument gives me, but there is some
    line that I would want to change its colour, because there has been an alarm,
    for instance. And I only can change all the string.
    Is there any way to do this? I don't know.
    Could you please help me?

    Thank You Very Much.
    The fourth step is a little bit difficult to understand, but what I've done
    is all the three first steps, and in the fourth one I've made an array (I32)
    of the lines that I don't want to highlight and connect it to Disabled �tems.
    Do you think this is a good solution?
    Thank you again for your help. I really needed someone to help me, because
    if not I would still be with the STRING INDICATOR.
    Timothy John Streeter wrote:
    >Hi Carlos>>I'm sorry for being too brief with the last email.>>1) Place
    an 'Multiple Selection Listbox' on your front panel.>>2) Create an attribute
    node. Make the attribute 'Item Names'.>>3) Put every completed line into
    the last element of an array, and then pass the array
    >to the attibute node. (This build the list>of strings in the Listbox).>>4)
    To highlight a line, make an array containing the line numbers (I32) that
    you want
    >highlighted and pass it the terminal of the>Listbox.>>Hope this is more
    helpful>>Tim>>Carlos Jorge wrote>> Thank you for your help, but I don't
    understand what you have told me. What>> I have to pass to the indicator
    node, and what is this indicator node? My>> problem now is the last thing
    I have to do.>>>> Could you please explain my doubt with more detail?>>>>
    Thank you a lot.>> Timothy John Streeter wrote>
    >Hi Carlos>>Try using a 'Multiple Selection List Box' indicator instead of>>
    a string indicator. You>> >can highlight a line by adding the line>number
    to an array and pass it to>> the indicator node.>>Tim>>Carlos Jorge Granadino
    wrote>> Hi everybody,>>>>>> I'm getting crazy, because I'm looking for
    the way to change the colour of>>>> the lines I want in the same string indicator.>>
    I'm doing an application>> to control an instrument by serial port, and I'm>>
    concatenating the lines>> that this instrument gives me, but there is some>>
    line that I would want>> to change its colour, because there has been an
    alarm,>> for instance. And>> I only can change all the string.>> Is there
    any way to do this? I don't>> know.>>>> Could you please help me?>>

  • I would like to do a program that have one string control and one string indicator, any character that I type in the string control in the same time it will be appear in another string (indicator). How can help me?

    I would like to do a program that have one string control and one string indicator, any character that I type in the string control in the same time it will be appear in another string (indicator). How can help me?

    Why not use an event
    Add a While Loop, inside the loop add the Event Sructure.
    Now in the event structure selecd the String Controls.value change event to
    react
    and the new value inside the event that you get,( connect to the String
    indicator box.
    On Sun, 10 Aug 2003 15:58:47 -0500 (CDT), WiltonFilho wrote:
    > I would like to do a program that have one string control and one
    > string indicator, any character that I type in the string control in
    > the same time it will be appear in another string (indicator). How can
    > help me?
    >
    > I would like to do a program that have one string control and one
    > string indicator, any character that I type in the string control in
    > the same time it will be appear in another string (indicator). How can
    > help me?
    >
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

  • I need to rotate a string indicator 90 degrees. Is this possible

    To make my front panel less cluttered, I would like to have my string indicator rotated 90 degrees counter clockwise. Is this possible and if so will I be able to place it in an array of strings? Any and all help is greatly appreciated.

    pcardinale wrote:
    So just color the indicator transparent, and feed the text to the caption (i.e. use the caption as an indicator).
    Paul Cardinale
    While fundamentally, this would provide a potential work-around.  I find it morally objectionable Whats next? tategaki?
    Jeff

  • How to create a string indicator with a history?

    I'm interested in creating a string indicator that has a history to it, possibly with time stamps attached to it.
    For those who have used AutoCAD it would be exactly like the command bar. A plus would be if I could only
    save the last 100 entries to keep the size memory usage down.
    Any thoughts? Does anyone have a code segment of this? 

    Keep a line count and once you go over your limit search the string for the first new line and split it at that point.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • I want to take a series of hex characters in a string control and produce an HDLC string indicator for example if the data string control is 3F27 then the HDLC string indicator is 7E003F2700B57E

    I want to take a series of hex characters in a string control and produce an HDLC string indicator for example if the data string control is 3F27 then the HDLC string indicator is 7E003F2700B57E

    "thanks for your help "
    Does that mean you figured it out already?
    If not, see this thread for some HDLC related code.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=146859&query.id=3388#M146859
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Tab characters in a string indicator box

    I have a string indicator box and would like to make text on different lines match up. When I try using the tab character or a \t I only get a single space. Is there a trick to making the text line up?

    Whenever the string indicator is too lame for my purposes I usually go with the ActiveX text box.

  • Using same string indicator in different stacked sequences

    Hi guys, I want to use the same string indicator in different stacked sequences. I tried to wire the output of every string constant through the sequence to my string indicator outside the sequence block but then I get an 'Wire connected to an undirected tunnel' error. What is the best way to use the same indicator for all the sequences?
    Solved!
    Go to Solution.

    GerdW wrote:
    GerdW wrote:
    @TiTou:
    Problems with copy&paste?
    not even :-o
    GerdW wrote:
    @TiTou:
    Problems with copy&paste?
    not even :-o
    see : http://forums.ni.com/t5/Feedback-on-NI-Discussion-Forums/Text-lines-and-images-get-duplicated-when-I...
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Text output using string indicator from subVI to mainVI

    Hi,
    I think I asked similar question before, but since then my program got more complicated.
    Here is my issue.
    I have a program with nested loops to print out the stream of strings in subVI
    and it needs to be updated in a string indicator in mainVI.
    When I say "update", it needs to be updated as it comes out line by line, not by
    the block when the loop is finished.
    I was not successful doing this by both shift register or RefNum.
    Maybe I do not know the advance usage these two.
    So can someone show me how?
    I have attached simplified version of my labview program.
    Thank you in advance!!!
    Solved!
    Go to Solution.
    Attachments:
    MainSubStrIndicator.zip ‏12 KB

    Hi horanyee,
    use some standard shift registers to achieve your goal... They will keep the previous valu so you can ad the new line!
    Message Edited by GerdW on 09-11-2009 08:43 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    subVI.vi ‏8 KB

  • How to remove the last line input into a string indicator??

    I am currently working on a program where the user has the ability to create a profile for one of our lab machines to run.  When the user selects what parameters they would like, a string indicator shows the user the last input they set followed by a comma.  For example, if the user selects which profile they want, and the times they would like to set, the following string would be displayed:
    As you can see in the picture above, the profile is updated in the string indicator after every set button is hit.  In the event the user makes a mistake, I want them to have the ability to delete the last line that was added.
    This is the code I developed so far.  The string coming in and leaving is attached to a shift register so it continues to append to the indicator.  I tried in this case to count how many lines have been written in the string so far, and I built an array with the current string.  Using the delete from array.VI I indexed it to the number of lines that was created so that the last line is deleted.  I unfortunately had no luck.  Any suggestions?

    tbob wrote:
    Fonzie1104 wrote:
    Hey Tbob,
    That almost worked.  The only issue though is it leaves a null string in its place without moving everything after up one line.  Also, if i have a parameter repeating multiple times, it doenst seem to work.
    I'm confused.  If you are deleting the last line, how can there be anything after?  What do you mean by a parameter repeating multiple times?
    If you look at my example front panel, you will see that the last line is deleted.  Isn't this what you asked for?
    It's due to the fact that your constant doesn't have a comma in the last line. If you add that in, you should be able to reproduce his problem. This is just a guess though, I didn't actually test it to see.
    Message Edited by for(imstuck) on 06-08-2010 01:24 PM
    CLA, LabVIEW Versions 2010-2013

  • How can I modify the Stile of a String-Indicator (without the Frame)?

    I only want to see the Text-String on the Frontpanel,
    without the Indicator-Frame.

    Go to the Classic Controls palette, select a Simple String indicator. Then use the paintbrush tool with transparent selected (The T in the upper right hand corner of the color palette) to make the indicator transparent. The text in the indicator will still be visible, but not the indicator frame or background.

  • Saving text written in a string indicator on the front panel

    Hi,
    As a new LabVIEW user I'm trying to type a manual to explain how to use the software program I'm writing. I would like to display it on the front panel in one of the tab windows. There is quite a lot of writing and I would like the user to be able to scroll through the text. I tried inserting a string indicator, right clicking on it and selecting 'visible items'>>'scrollbar'. However, when I saved my changes the writing in the indicator was not saved with the rest of the changes. I'd be grateful for any advice.
    Thanks,
    Adrian
    [email protected]

    Adrian,
    The 'data' in your string indicator was probably not saved as 'default', so that when you closed the VI and re-ran it, it was lost.
    For any data (strings, numbers, etc.) that you want to have as default, you will need to rt-click the indicator/control and under data operations, select 'make current value default' (when you have the data entered).
    Also - add an Invoke node function to force this indicator to display the default data upon initial running of the VI.
    Another way, though, when you have a 'lot' of text, is simply save your info in a text file, and have a VI open the file and display it either as the text file itself, or as input into a string indicator.
    Good Luck, Doug

Maybe you are looking for