English Subtitles for LabVIEW Tutorial #7: Creation and use of Sub VIs



Subtitles / Closed Captions - English

<font color="#CCCCCC">ok so this innate</font><font color="#E5E5E5"> here what we're going</font>

<font color="#E5E5E5">to do is we're going to introduce sub</font> <font color="#E5E5E5">the eyes and with somebody</font><font color="#CCCCCC"> is delighted</font> <font color="#CCCCCC">to do is reuse</font><font color="#E5E5E5"> pretty popular</font><font color="#CCCCCC"> VI in an</font> <font color="#E5E5E5">upper level VI</font><font color="#CCCCCC"> ok</font><font color="#E5E5E5"> so for example</font><font color="#CCCCCC"> what i</font> have here just to save time<font color="#CCCCCC"> might</font><font color="#E5E5E5"> drag</font> these controls over and<font color="#E5E5E5"> label them all</font>

nicely and stuff but we're going to do is we're going to we're<font color="#CCCCCC"> gonna</font><font color="#E5E5E5"> pretended</font> you know we work<font color="#E5E5E5"> in a plant</font> <font color="#CCCCCC">ok and we</font><font color="#E5E5E5"> design a sub</font><font color="#CCCCCC"> di</font><font color="#E5E5E5"> it takes a</font> temperature in<font color="#CCCCCC"> Kelvin converted to</font> <font color="#CCCCCC">celsius</font><font color="#E5E5E5"> and</font><font color="#CCCCCC"> fahrenheit and</font><font color="#E5E5E5"> also</font><font color="#CCCCCC"> let</font><font color="#E5E5E5"> us</font>

know whether or not it exceeds<font color="#E5E5E5"> or is</font> below<font color="#CCCCCC"> two different thresholds</font> so here's the input which is this temperature<font color="#E5E5E5"> input in</font><font color="#CCCCCC"> calvin and the</font> other limits in<font color="#CCCCCC"> Celsius</font><font color="#E5E5E5"> are the upper</font> and lower limits<font color="#CCCCCC"> they will eventually</font>

enable these two flags and these are the <font color="#E5E5E5">two output terminals</font><font color="#CCCCCC"> so first we're</font> going to build up this VI and then we're going to convert it into a sub the eye and then we're going to open<font color="#E5E5E5"> an</font><font color="#CCCCCC"> upper</font> <font color="#CCCCCC">level</font><font color="#E5E5E5"> VI and</font><font color="#CCCCCC"> inserted into it and i</font><font color="#E5E5E5"> want</font>

to show<font color="#E5E5E5"> you how you can make your</font><font color="#CCCCCC"> v</font><font color="#E5E5E5"> eyes</font> <font color="#E5E5E5">a lot more modular and the reason i did</font> <font color="#E5E5E5">C&F just the United States uses</font> <font color="#CCCCCC">fahrenheit and everywhere else you</font><font color="#E5E5E5"> see I</font> think but if you're from the<font color="#CCCCCC"> United</font> <font color="#CCCCCC">States i</font><font color="#E5E5E5"> noticed most people looking at</font>

the<font color="#CCCCCC"> levee tutorials are actually from</font> the<font color="#CCCCCC"> United States we're used to seeing</font> you know<font color="#CCCCCC"> fahrenheit but i have them both</font> for completeness<font color="#E5E5E5"> so we're gonna go over</font> here and let's do the<font color="#CCCCCC"> Calvin</font><font color="#E5E5E5"> to</font><font color="#CCCCCC"> Celsius</font> create constant and that was<font color="#CCCCCC"> to 273.15</font>

<font color="#CCCCCC">ok so this is Celsius</font><font color="#E5E5E5"> soul over here so</font> that should be<font color="#E5E5E5"> this equation here</font><font color="#CCCCCC"> okay</font> and<font color="#CCCCCC"> we'll take care of these look</font><font color="#E5E5E5"> limits</font> in a minute<font color="#E5E5E5"> actually</font><font color="#CCCCCC"> the</font><font color="#E5E5E5"> right there</font> <font color="#E5E5E5">because this will be using them now</font> <font color="#CCCCCC">well I also</font><font color="#E5E5E5"> want to do is I also want to</font>

convert to<font color="#CCCCCC"> write we take this value here</font> which goes into here<font color="#E5E5E5"> x something and</font> nine fifths 1.8 <font color="#CCCCCC">ok so see x 1 point 8 +</font><font color="#E5E5E5"> 32 this</font> <font color="#CCCCCC">ok that's so</font><font color="#E5E5E5"> this part over</font><font color="#CCCCCC"> here roughly</font> this<font color="#CCCCCC"> part over here we have</font><font color="#E5E5E5"> here</font>

<font color="#CCCCCC">ok let's take a look if we continuously</font> run this<font color="#E5E5E5"> we do have what we expect</font> <font color="#E5E5E5">degrees</font><font color="#CCCCCC"> c minus 273.15</font><font color="#E5E5E5"> and $OPERAND</font> degrees<font color="#CCCCCC"> fahrenheit amateur that's</font><font color="#E5E5E5"> right</font> <font color="#CCCCCC">but if</font><font color="#E5E5E5"> we do</font><font color="#CCCCCC"> as zero degrees</font><font color="#E5E5E5"> c</font><font color="#CCCCCC"> 27 35</font> that's correct<font color="#CCCCCC"> freezing freezing</font><font color="#E5E5E5"> they</font>

have that<font color="#CCCCCC"> ok</font><font color="#E5E5E5"> and then we</font><font color="#CCCCCC"> continue to go</font> up<font color="#E5E5E5"> to where we have 100 and here</font><font color="#CCCCCC"> there</font> you have 212<font color="#CCCCCC"> Fahrenheit which</font><font color="#E5E5E5"> is boiling</font> so this<font color="#E5E5E5"> this functionality is working</font><font color="#CCCCCC"> ok</font> <font color="#CCCCCC">i was a check okay so now we need to do</font> the<font color="#E5E5E5"> bounce so that is easily done with</font>

<font color="#E5E5E5">comparison structures so greater or</font> equal and less than or equal<font color="#CCCCCC"> use for</font> <font color="#CCCCCC">upper and lower</font><font color="#E5E5E5"> so our first argument in</font> each of these is going to be<font color="#E5E5E5"> degrees c</font> <font color="#E5E5E5">which</font> <font color="#E5E5E5">move this over here and move this over</font>

here<font color="#CCCCCC"> it's accessible</font><font color="#E5E5E5"> here</font><font color="#CCCCCC"> so here's our</font> so we know we want to<font color="#E5E5E5"> know is this</font> number<font color="#CCCCCC"> age case</font><font color="#E5E5E5"> greater than this one</font> which is the<font color="#E5E5E5"> high limit</font><font color="#CCCCCC"> or is it less</font> than this one<font color="#E5E5E5"> so it's it it's out of</font> bounds of either of those<font color="#E5E5E5"> windows then</font>

we want our LEDs<font color="#CCCCCC"> layup</font><font color="#E5E5E5"> and that's what</font> <font color="#CCCCCC">the loo and clean everything</font><font color="#E5E5E5"> up</font> <font color="#CCCCCC">ok that didn't really clean up to i</font> wanted to<font color="#CCCCCC"> just really like</font><font color="#E5E5E5"> that</font><font color="#CCCCCC"> go</font> <font color="#CCCCCC">ok so we'll do a save and again</font> <font color="#E5E5E5">so upper limit</font><font color="#CCCCCC"> their</font><font color="#E5E5E5"> upper limit is</font>

boiling<font color="#E5E5E5"> for any more than</font><font color="#CCCCCC"> boiling now</font> <font color="#CCCCCC">let's see line 95</font><font color="#E5E5E5"> we don't say we want</font> we have water in a furnace in our plant <font color="#CCCCCC">okay and then we need to keep it just</font> <font color="#E5E5E5">just under boiling</font><font color="#CCCCCC"> well suppose</font><font color="#E5E5E5"> it's the</font> same time we need to keep it<font color="#E5E5E5"> just above</font>

freezing<font color="#CCCCCC"> its</font><font color="#E5E5E5"> 237</font> <font color="#CCCCCC">ok so</font><font color="#E5E5E5"> now so now you can see as we vary</font> the very<font color="#E5E5E5"> the input</font><font color="#CCCCCC"> it does indeed case</font> an hour at<font color="#E5E5E5"> 6.5</font><font color="#CCCCCC"> c here's</font><font color="#E5E5E5"> 37</font><font color="#CCCCCC"> so we need to</font> get above<font color="#CCCCCC"> there's 26 but now</font><font color="#E5E5E5"> we're right</font> in the middle

<font color="#CCCCCC">ok we're 76 degrees</font><font color="#E5E5E5"> 470</font><font color="#CCCCCC"> Fahrenheit</font> <font color="#CCCCCC">ok so that is that is functioning there</font> and we<font color="#CCCCCC"> get to know</font><font color="#E5E5E5"> our water is heating</font> up<font color="#CCCCCC"> PT up</font> excuse<font color="#E5E5E5"> my coffin up we've exceeded</font><font color="#CCCCCC"> now</font> the engineer<font color="#E5E5E5"> knows</font><font color="#CCCCCC"> o water is getting</font>

too hot<font color="#CCCCCC"> or it's going to</font><font color="#E5E5E5"> be getting too</font> hot<font color="#CCCCCC"> so there you go</font> now<font color="#E5E5E5"> this multi-use</font><font color="#CCCCCC"> VI let's suppose we</font> want to be able to step and repeat<font color="#E5E5E5"> we</font> have<font color="#E5E5E5"> many furnaces that the we have</font> inputs from<font color="#E5E5E5"> and we want to have multiple</font>

displays<font color="#CCCCCC"> so let</font><font color="#E5E5E5"> me show you how to make</font> this modular<font color="#CCCCCC"> ok if you notice up here we</font> have this connector icon<font color="#E5E5E5"> and we have</font> this<font color="#E5E5E5"> was</font><font color="#CCCCCC"> a the input-output I</font><font color="#E5E5E5"> hear the</font> icon and then<font color="#E5E5E5"> they the connector icon</font> <font color="#CCCCCC">okay in earlier labview versions they</font>

did not do it like this in earlier versions you<font color="#CCCCCC"> had</font><font color="#E5E5E5"> to</font><font color="#CCCCCC"> right-click</font><font color="#E5E5E5"> and in</font> view<font color="#E5E5E5"> one or the other</font><font color="#CCCCCC"> so if you're using</font> an earlier version you're watching this video that's what's going on so if you only see this<font color="#CCCCCC"> you should be able to</font>

right click and save you<font color="#CCCCCC"> a connector i</font> believe so<font color="#E5E5E5"> first of all if we want to</font> make the icon<font color="#CCCCCC"> looks like something</font><font color="#E5E5E5"> else</font> <font color="#CCCCCC">let's say we want</font><font color="#E5E5E5"> to be green like this</font> <font color="#E5E5E5">this is just like Microsoft</font><font color="#CCCCCC"> Paint uh you</font> know<font color="#CCCCCC"> there's a fairly generic</font><font color="#E5E5E5"> control</font>

here we have the pencil<font color="#CCCCCC"> in the line</font><font color="#E5E5E5"> and</font> the dropper and<font color="#CCCCCC"> i'm not</font><font color="#E5E5E5"> going to go</font> <font color="#E5E5E5">through all</font><font color="#CCCCCC"> these because you can pretty</font> much figure out what that is text if you need<font color="#CCCCCC"> text 1234 just paints</font>

right on so<font color="#CCCCCC"> let's</font><font color="#E5E5E5"> to do the lesson</font><font color="#CCCCCC"> 8</font> icon <font color="#CCCCCC">okay i</font><font color="#E5E5E5"> don't</font><font color="#CCCCCC"> have enough room</font> <font color="#CCCCCC">ok</font><font color="#E5E5E5"> i just stuck spaces in here because</font> what it did is it put spaces<font color="#E5E5E5"> here so that push this line</font>

<font color="#E5E5E5">for down otherwise it would have</font><font color="#CCCCCC"> center</font> in the<font color="#E5E5E5"> middle</font><font color="#CCCCCC"> C but if</font><font color="#E5E5E5"> i type stuff here</font> <font color="#CCCCCC">look like this</font> ok that's a good icon and glyphs<font color="#CCCCCC"> if you</font> <font color="#CCCCCC">had</font><font color="#E5E5E5"> a</font><font color="#CCCCCC"> few of a particular application</font> <font color="#CCCCCC">they have a bunch of different pictures</font>

as you can just<font color="#E5E5E5"> drag-and-drop</font><font color="#CCCCCC"> if you</font> don't want to put it on there you can just hit escape<font color="#CCCCCC"> it makes it go away</font><font color="#E5E5E5"> and</font> <font color="#E5E5E5">also you have layers so you could edit</font> or delete<font color="#E5E5E5"> different layers</font><font color="#CCCCCC"> anywhere i</font> <font color="#E5E5E5">think that's a good I con</font><font color="#CCCCCC"> their life</font>

<font color="#CCCCCC">Green now here's the important part of</font> the other important<font color="#CCCCCC"> . we</font><font color="#E5E5E5"> got our tools</font> palette back<font color="#CCCCCC"> we</font><font color="#E5E5E5"> need to use the wire</font> wire tool and<font color="#E5E5E5"> i want to say</font><font color="#CCCCCC"> click</font><font color="#E5E5E5"> this</font> and<font color="#CCCCCC"> I want to assign that to this</font> terminal<font color="#E5E5E5"> now you see how it lit up in</font>

<font color="#CCCCCC">Orange the reason a little bit</font><font color="#E5E5E5"> oranges</font> because that's the type<font color="#E5E5E5"> this</font><font color="#CCCCCC"> control is</font> <font color="#E5E5E5">you see</font><font color="#CCCCCC"> what we've done is we've linked</font> <font color="#E5E5E5">to these two and again we want to do the</font> upper limit<font color="#E5E5E5"> lower limit</font><font color="#CCCCCC"> then we see that</font> they're all orange on the output side

we want degrees<font color="#CCCCCC"> fahrenheit</font><font color="#E5E5E5"> to</font><font color="#CCCCCC"> celsius</font> <font color="#CCCCCC">and</font><font color="#E5E5E5"> we also want the boolean the high</font> and<font color="#E5E5E5"> the low and notice that the color</font> changed<font color="#CCCCCC"> see that ok great so we'll save</font> this again<font color="#E5E5E5"> and I want to make a new VI</font> <font color="#CCCCCC">okay</font><font color="#E5E5E5"> now this is</font><font color="#CCCCCC"> going to be our control</font>

panel for factory so we're going to make a container and<font color="#CCCCCC"> not</font><font color="#E5E5E5"> we want to use</font><font color="#CCCCCC"> our</font> <font color="#CCCCCC">VI how do we do that select the I this</font> is the<font color="#CCCCCC"> vi that we made the inputs and</font> outputs<font color="#E5E5E5"> well we configure the inputs and</font> outputs<font color="#E5E5E5"> and we made the icon so here we</font>

go<font color="#E5E5E5"> there is less than eight</font><font color="#CCCCCC"> here's our</font> inputs and outputs<font color="#E5E5E5"> looks like</font><font color="#CCCCCC"> tea in</font> <font color="#CCCCCC">hi-low limit</font><font color="#E5E5E5"> we need</font><font color="#CCCCCC"> 14</font><font color="#E5E5E5"> first one copy</font> <font color="#CCCCCC">paste 14 first two</font><font color="#E5E5E5"> and</font><font color="#CCCCCC"> another 43</font><font color="#E5E5E5"> it</font> <font color="#CCCCCC">okay</font> so here's the outputs and the<font color="#E5E5E5"> displays</font>

<font color="#CCCCCC">i'm</font><font color="#E5E5E5"> running out of space here</font><font color="#CCCCCC"> remove</font> <font color="#CCCCCC">this</font> <font color="#CCCCCC">ok</font><font color="#E5E5E5"> let me get a while loop here</font> there you go<font color="#E5E5E5"> all different temperatures</font> <font color="#E5E5E5">this to all sorts</font><font color="#CCCCCC"> of different</font> <font color="#CCCCCC">everything's so anyway that's</font><font color="#E5E5E5"> uh that's</font>

<font color="#CCCCCC">subvi is very useful and</font><font color="#E5E5E5"> also view if</font> you look at view<font color="#CCCCCC"> and then VI hierarchy</font> <font color="#CCCCCC">if you have an</font><font color="#E5E5E5"> upper level VI like I do</font> like<font color="#CCCCCC"> I'm i considered this an upper</font> <font color="#CCCCCC">level VI okay and i'll show</font><font color="#E5E5E5"> you what i</font> mean if i do the view<font color="#E5E5E5"> VI hierarchy from</font>

this<font color="#E5E5E5"> upper-level</font><font color="#CCCCCC"> di you'll see that the</font> <font color="#CCCCCC">vi hierarchy this lab you instance which</font> is there here's where<font color="#E5E5E5"> I'm at and</font><font color="#CCCCCC"> here's</font><font color="#E5E5E5"> it tells</font> me that i use this sub<font color="#CCCCCC"> bi so if i had</font> multiple<font color="#E5E5E5"> this is a very neat VI</font>

hierarchy it's a very neat way<font color="#E5E5E5"> the way</font> of looking at how<font color="#CCCCCC"> everything is</font> interconnected and what uses<font color="#E5E5E5"> what</font><font color="#CCCCCC"> sub B</font> <font color="#CCCCCC">is so so thank you for watching I hope</font> this was useful and somewhat entertaining

<font color="#CCCCCC">it's</font><font color="#E5E5E5"> pretty</font><font color="#CCCCCC"> irritating</font><font color="#E5E5E5"> blinky lights</font> <font color="#E5E5E5">temperatures and i will see you on</font> lesson<font color="#CCCCCC"> 9 thanks</font>



Video Description

Location of code and other future goodies:
http://paulfmcgowan.com/

Lesson #7 illustrates how to make and use a sub vi.

THIS IS #7. Used #8 by accident.

The example includes a make-believe factory scenario in which temperature needs to be converted and monitored. A custom sub vi is created and then used in a "real-life" setting.

Enjoy.