Activity 9-1: String Construction


It's time for you to practice and give a new meaning to the phrase "strings attached." You will build a VI that converts a number to a string and concatenates that string with other strings to form a single output string. The VI also determines the length of the output string.

1.

Build the front panel shown in Figure 9.16.

Figure 9.16. Front panel of the VI you will create during this activity


The VI will concatenate the input from the two string controls and the digital control into a single output string, which is displayed in the string indicator. The digital indicator will display the string's length.

2.

Build the block diagram pictured in Figure 9.17.

Figure 9.17. Block diagram of the VI you will create during this activity


Format Into String Function

Format Into String (Programming>>String palette) converts the number you specify in the Number digital control to a string with fractional format and four digits of precision.

Concatenate Strings Function

Concatenate Strings function (Programming>>String palette) combines all input strings into a single output string. To increase the number of inputs, stretch the icon using the Positioning tool.

String Length Function

String Length function (Programming>>String palette) returns the number of characters in the concatenated string.

3.

Return to the front panel and type text inside the two string controls and a number inside the digital control. Make sure to add spaces at the end of the header and the beginning of the trailer strings, or your output string will run together. Run the VI.

4.

Save and close the VI. Name it Build String.vi and place it in your MYWORK directory. Do you feel like a LabVIEW expert yet? You're getting there!




LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net