You are on page 1of 16

,AB'ETTING&AMILIAR


WITH,AB6)%70ART)
4HEOBJECTIVEOFTHISlRSTLABISTOPROVIDEANINITIALHANDS ONEXPERIENCEINBUILDING
A6)&ORDETAILEDEXPLANATIONSOFTHE,AB6)%7FEATURESMENTIONEDHERE THEREADER
ISREFERREDTO;=,AB6)%7CANGETLAUNCHEDBYDOUBLE CLICKINGONTHE,AB6)%7
ICON4HEDIALOGWINDOWSHOWNIN&IGURE SHOULDAPPEAR

&IGURE 3TARTING,AB6)%7

,"UILDINGA3IMPLE6)
4OBECOMEFAMILIARWITHTHE,AB6)%7PROGRAMMINGENVIRONMENT ITISMOREEFFEC
TIVEIFONEGOESTHROUGHASIMPLEEXAMPLE4HEEXAMPLEPRESENTEDHERECONSISTSOF
CALCULATINGTHESUMANDAVERAGEOFTWOINPUTVALUES4HISEXAMPLEISDESCRIBEDINA
STEP BY STEPFASHIONBELOW
,6)#REATION

4OCREATEANEW6) CLICKONTHEARROWNEXTTO.EWxANDCHOOSE"LANK6)FROMTHE
PULLDOWNMENU4HISSTEPCANALSOBEDONEBYCHOOSING&ILEm.EW6)FROMTHE
MENU!SARESULT ABLANK&0ANDABLANK"$WINDOWAPPEAR ASSHOWNIN&IGURE
 )TSHOULDBEREMEMBEREDTHATAN&0ANDA"$COEXISTWHENBUILDINGA6)



,AB

&IGURE "LANK6)

#LEARLY THENUMBEROFINPUTSANDOUTPUTSTOA6)ISDEPENDENTONITSFUNCTION)N
THISEXAMPLE TWOINPUTSANDTWOOUTPUTSARENEEDED ONEOUTPUTGENERATINGTHE
SUMANDTHEOTHERTHEAVERAGEOFTWOINPUTVALUES4HEINPUTSARECREATEDBYLOCAT
INGTWO.UMERIC#ONTROLSONTHE&04HISISDONEBYRIGHT CLICKINGONAN
OPENAREAOFTHE&0TOBRINGUPTHE#ONTROLSPALETTE FOLLOWEDBYCHOOSING#ONTROLS
m.UMERIC#ONTROLSm.UMERIC#ONTROL%ACHNUMERICCONTROLAUTOMATICALLYPLACES
ACORRESPONDINGTERMINALICONONTHE"$$OUBLE CLICKINGONANUMERICCONTROL
HIGHLIGHTSITSCOUNTERPARTONTHE"$ ANDVICEVERSA
.EXT LETUSLABELTHETWOINPUTSASXANDY4HISISACHIEVEDBYUSINGTHE,ABELING
TOOLFROMTHE4OOLSPALETTE WHICHCANBEDISPLAYEDBYCHOOSING7INDOWm3HOW4OOLS
0ALETTEFROMTHEMENUBAR#HOOSETHE,ABELINGTOOLANDCLICKONTHEDEFAULTLABELS
.UMERICAND.UMERIC INORDERTOEDITTHEM!LTERNATIVELY IFTHEAUTOMATIC
TOOLSELECTIONMODEISENABLEDBYCLICKING!UTOMATIC4OOL3ELECTIONINTHE4OOLSPALETTE
THELABELSCANBEEDITEDBYSIMPLYDOUBLE CLICKINGONTHEDEFAULTLABELS%DITINGALABEL
ONTHE&0CHANGESITSCORRESPONDINGTERMINALICONLABELONTHE"$ ANDVICEVERSA
3IMILARLY THEOUTPUTSARECREATEDBYLOCATINGTWO.UMERIC)NDICATORS
#ONTROLSm.UMERIC)NDICATORSm.UMERIC)NDICATOR ONTHE&0%ACHNUMERICINDICATOR
AUTOMATICALLYPLACESACORRESPONDINGTERMINALICONONTHE"$%DITTHELABELSOFTHE
INDICATORSTOREAD3UMAND!VERAGE
&ORABETTERVISUALAPPEARANCE OBJECTSONAN&0WINDOWCANBEALIGNED DISTRIBUTED
ANDRESIZEDUSINGTHEAPPROPRIATEBUTTONSAPPEARINGONTHE&0TOOLBAR4ODOTHIS


'ETTING&AMILIARWITH,AB6)%70ART)

SELECTTHEOBJECTSTOBEALIGNEDORDISTRIBUTEDANDAPPLYTHEAPPROPRIATEOPTIONFROM
THETOOLBARMENU&IGURE SHOWSTHECONlGURATIONOFTHE&0JUSTCREATED

&IGURE &0CONlGURATION

.OW LETUSBUILDAGRAPHICALPROGRAMONTHE"$TOPERFORMTHESUMMATIONAND
AVERAGINGOPERATIONS.OTETHAT#TRL %TOGGLESBETWEENAN&0ANDA"$WIN
DOW)FONElNDSTHEOBJECTSONA"$ARETOOCLOSETOINSERTOTHERFUNCTIONSOR6)SIN
BETWEEN AHORIZONTALORVERTICALSPACECANBEINSERTEDBYHOLDINGDOWNTHE#TRL
KEYTOCREATESPACEHORIZONTALLYANDORVERTICALLY!SANEXAMPLE &IGURE B
ILLUSTRATESAHORIZONTALSPACEINSERTEDBETWEENTHEOBJECTSSHOWNIN&IGURE A 

A
B
&IGURE )NSERTINGHORIZONTALVERTICALSPACEA CREATINGSPACEWHILEHOLDING
DOWNTHE#TRLKEY ANDB INSERTEDHORIZONTALSPACE



,AB

.EXT PLACEAN!DDFUNCTION&UNCTIONSm!RITHMETIC#OMPARISONm%XPRESS.UMERIC
m!DD ANDA$IVIDEFUNCTION&UNCTIONSm!RITHMETIC#OMPARISONm%XPRESS
.UMERICm$IVIDE ONTHE"$4HEDIVISOR INOURCASE NEEDSTOBEENTEREDINA
.UMERIC#ONSTANT&UNCTIONSm!RITHMETIC#OMPARISONm%XPRESS.UMERICm
.UMERIC#ONSTANT ANDCONNECTEDTOTHEYTERMINALOFTHE$IVIDEFUNCTIONUSINGTHE
7IRINGTOOL
4OHAVEAPROPERDATAmOW FUNCTIONS STRUCTURESANDTERMINALICONSONA"$NEEDTO
BEWIRED4HE7IRINGTOOLISUSEDFORTHISPURPOSE4OWIRETHESEOBJECTS POINTTHE
7IRINGTOOLATATERMINALOFAFUNCTIONORASUB6)TOBEWIRED LEFTCLICKONTHETERMI
NAL DRAGTHEMOUSETOADESTINATIONTERMINALANDLEFTCLICKONCEAGAIN&IGURE 
ILLUSTRATESTHEWIRESPLACEDBETWEENTHETERMINALSOFTHENUMERICCONTROLSANDTHE
INPUTTERMINALSOFTHEADDFUNCTION.OTICETHATTHELABELOFATERMINALISDISPLAYED
WHENEVERTHECURSORISMOVEDOVERITIFTHEAUTOMATICTOOLSELECTIONMODEISENABLED
!LSO NOTETHATTHE2UNBUTTON ONTHETOOLBARREMAINSBROKENUNTILTHEWIRING
PROCESSISCOMPLETED

&IGURE 7IRING"$OBJECTS

&ORBETTERREADABILITYOFA"$ WIRESWHICHAREHIDDENBEHINDOBJECTSORCROSSEDOVER
OTHERWIRESCANBECLEANEDUPBYRIGHT CLICKINGONTHEMANDCHOOSING#LEAN5P7IRE
FROMTHESHORTCUTMENU!NYBROKENWIRESCANBECLEAREDBYPRESSING#TRL "OR
%DITm2EMOVE"ROKEN7IRES
4HELABELOFA"$OBJECT SUCHASAFUNCTION CANBESHOWNORHIDDEN BYRIGHT
CLICKINGONTHEOBJECTANDCHECKINGORUNCHECKING 6ISIBLE)TEMSm,ABELFROMTHE
SHORTCUTMENU!LSO ATERMINALICONCORRESPONDINGTOANUMERICCONTROLORINDICATOR


'ETTING&AMILIARWITH,AB6)%70ART)

CANBESHOWNASADATATYPETERMINALICON4HISISDONEBYRIGHT CLICKINGONTHETER
MINALICONANDUNCHECKING6IEW!S)CONFROMTHESHORTCUTMENU&IGURE SHOWS
ANEXAMPLEWHERETHENUMERICCONTROLSANDINDICATORSARESHOWNASDATATYPETERMI
NALICONS4HENOTATION$",REPRESENTSDOUBLEPRECISIONDATATYPE

&IGURE #OMPLETED"$

)TISWORTHPOINTINGOUTTHATTHEREEXISTSASHORTCUTTOBUILDTHEABOVE6))NSTEAD
OFCHOOSINGTHENUMERICCONTROLS INDICATORSORCONSTANTSFROMTHE#ONTROLSOR
&UNCTIONSPALETTE THESHORTCUTMENU#REATE ACTIVATEDBYRIGHT CLICKINGONA
TERMINALOFA"$OBJECTSUCHASAFUNCTIONORASUB6) CANBEUSED!SANEXAMPLE
OFTHISAPPROACH CREATEABLANK6)ANDLOCATEAN!DDFUNCTION2IGHT CLICKONITS
XTERMINALANDCHOOSE#REATEm#ONTROLFROMTHESHORTCUTMENUTOCREATEANDWIRE
ANUMERICCONTROLORINPUT4HISLOCATESANUMERICCONTROLONTHE&0ASWELLASA
CORRESPONDINGTERMINALICONONTHE"$4HELABELISAUTOMATICALLYSETTOX#REATE
ASECONDNUMERICCONTROLBYRIGHT CLICKINGONTHEYTERMINALOFTHE!DDFUNCTION
.EXT RIGHT CLICKONTHEOUTPUTTERMINALOFTHE!DDFUNCTIONANDCHOOSE#REATE
m)NDICATORFROMTHESHORTCUTMENU!DATATYPETERMINALICON LABELEDASX Y IS
CREATEDONTHE"$ASWELLASACORRESPONDINGNUMERICINDICATORONTHE&0
.EXT RIGHT CLICKONTHEYTERMINALOFTHE$IVIDEFUNCTIONTOCHOOSE#REATEm
#ONSTANTFROMTHESHORTCUTMENU4HISCREATESA.UMERIC#ONSTANTASTHEDIVI
SORANDWIRESITSYTERMINAL4YPETHEVALUEINTHENUMERICCONSTANT2IGHT CLICKON
THEOUTPUTTERMINALOFTHE$IVIDEFUNCTION LABELEDASXY ANDCHOOSE#REATEm
)NDICATORFROMTHESHORTCUTMENU)FAWRONGOPTIONISCHOSEN THETERMINALDOESNOT



,AB

GETWIRED!WRONGTERMINALOPTIONCANEASILYBECHANGEDBYRIGHT CLICKINGONTHE
TERMINALANDCHOOSING#HANGETO#ONTROLOR#HANGETO#ONSTANTFROMTHESHORTCUTMENU
4OSAVETHECREATED6)FORLATERUSE CHOOSE&ILEm3AVEFROMTHEMENUORPRESS
#TRL 3TOBRINGUPADIALOGWINDOWTOENTERANAME4YPE3UMAND!VERAGE
ASTHE6)NAMEANDCLICK3AVE
4OTESTTHEFUNCTIONALITYOFTHE6) ENTERSOMESAMPLEVALUESINTHENUMERICCONTROLS
ONTHE&0ANDRUNTHE6)BYCHOOSING/PERATEm2UN BYPRESSING#TRL 2 OR
BYCLICKINGTHE2UNBUTTONONTHETOOLBAR&ROMTHEDISPLAYEDOUTPUTVALUESINTHE
NUMERICINDICATORS THEFUNCTIONALITYOFTHE6)CANBEVERIlED&IGURE ILLUSTRATES
THEOUTCOMEAFTERRUNNINGTHE6)WITHTWOINPUTSAND

&IGURE 6)VERIlCATION

,3UB6)#REATION

)FA6)ISTOBEUSEDASPARTOFAHIGHERLEVEL6) ITSCONNECTORPANENEEDSTOBE
CONlGURED!CONNECTORPANEASSIGNSINPUTSANDOUTPUTSOFASUB6)TOITSTERMINALS
THROUGHWHICHDATAAREEXCHANGED!CONNECTORPANECANBEDISPLAYEDBYRIGHT
CLICKINGONTHETOPRIGHTCORNERICONOFAN&0ANDSELECTING3HOW#ONNECTORFROMTHE
SHORTCUTMENU
4HEDEFAULTPATTERNOFACONNECTORPANEISDETERMINEDBASEDONTHENUMBEROF
CONTROLSANDINDICATORS)NGENERAL THETERMINALSONTHELEFTSIDEOFACONNECTORPANE
PATTERNAREUSEDFORINPUTS ANDTHEONESONTHERIGHTSIDEFOROUTPUTS4ERMINALSCAN
BEADDEDTOORREMOVEDFROMACONNECTORPANEBYRIGHT CLICKINGANDCHOOSING!DD


'ETTING&AMILIARWITH,AB6)%70ART)

4ERMINALOR2EMOVE4ERMINALFROMTHESHORTCUTMENU)FACHANGEISTOBEMADETOTHE

NUMBEROFINPUTSOUTPUTSORTOTHEDISTRIBUTIONOFTERMINALS ACONNECTORPANEPAT
TERNCANBEREPLACEDWITHANEWONEBYRIGHT CLICKINGANDCHOOSING0ATTERNSFROMTHE
SHORTCUTMENU/NCEAPATTERNISSELECTED EACHTERMINALNEEDSTOBEREASSIGNEDTOA
CONTROLORANINDICATORBYUSINGTHE7IRINGTOOL ORBYENABLINGTHEAUTOMATICTOOL
SELECTIONMODE
&IGURE A ILLUSTRATESASSIGNINGATERMINALOFTHE3UMAND!VERAGE6)TOA
NUMERICCONTROL4HECOMPLETEDCONNECTORPANEISSHOWNIN&IGURE B .OTICE
THATTHEOUTPUTTERMINALSHAVETHICKERBORDERS4HECOLOROFATERMINALREmECTSITS
DATATYPE

A

B

&IGURE #ONNECTORPANEA ASSIGNINGATERMINAL


TOACONTROL ANDB TERMINALASSIGNMENTCOMPLETED

#ONSIDERINGTHATASUB6)ICONISDISPLAYEDONTHE"$OFAHIGHERLEVEL6) ITIS
IMPORTANTTOEDITTHESUB6)ICONFORITTOBEEXPLICITLYIDENTIlED$OUBLE CLICKINGON
THETOPRIGHTCORNERICONOFA"$BRINGSUPTHE)CON%DITOR4HETOOLSPROVIDEDIN
THE)CON%DITORAREVERYSIMILARTOTHOSEENCOUNTEREDINOTHERGRAPHICALEDITORS SUCH
AS-ICROSOFT0AINT!NEDITEDICONFORTHE3UMAND!VERAGE6)ISILLUSTRATEDIN
&IGURE 
!SUB6)CANALSOBECREATEDFROMASECTIONOFA6)4ODOSO SELECTTHENODESONTHE
"$TOBEINCLUDEDINTHESUB6) ASSHOWNIN&IGURE A 4HEN CHOOSE%DITm
#REATE3UB6)4HISINSERTSANEWSUB6)ICON&IGURE B ILLUSTRATESTHE"$WITHAN


,AB

&IGURE %DITINGSUB6)ICON

INSERTEDSUB6)4HISSUB6)CANBEOPENEDANDEDITEDBYDOUBLE CLICKINGONITSICON
ONTHE"$3AVETHISSUB6)AS3UMAND!VERAGEVI4HISSUB6)PERFORMSTHESAME
FUNCTIONASTHEORIGINAL3UMAND!VERAGE6)

A

B

&IGURE #REATINGASUB6)A SELECTINGNODESTOMAKE


ASUB6) ANDB INSERTEDSUB6)ICON

)N&IGURE  THECOMPLETED&0AND"$OFTHE3UMAND!VERAGE6)ARESHOWN



'ETTING&AMILIARWITH,AB6)%70ART)

&IGURE 3UMAND!VERAGE6)

,5SING3TRUCTURESAND3UB6)S
,ETUSNOWCONSIDERANOTHEREXAMPLETODEMONSTRATETHEUSEOFSTRUCTURESANDSUB6)S
)NTHISEXAMPLE A6)ISUSEDTOSHOWTHESUMANDAVERAGEOFTWOINPUTVALUESINA
CONTINUOUSFASHION4HETWOINPUTSCANBEALTEREDBYTHEUSER)FTHEAVERAGEOFTHE
TWOINPUTSBECOMESGREATERTHANAPRESETTHRESHOLDVALUE A,%$WARNINGLIGHTISLIT
!STHElRSTSTEPTOWARDSBUILDINGSUCHA6) BUILDAN&0ASSHOWNIN&IGURE A 
&ORTHEINPUTS USETWO+NOBS#ONTROLSm.UMERIC#ONTROLSm+NOB !DJUSTTHESIZE
OFTHEKNOBSBYUSINGTHE0OSITIONINGTOOL0ROPERTIESOFKNOBSSUCHASPRECISIONAND
DATATYPECANBEMODIlEDBYRIGHT CLICKINGANDCHOOSING0ROPERTIESFROMTHESHORTCUT
MENU!+NOB0ROPERTIESDIALOGBOXISBROUGHTUPANDAN!PPEARANCETABISSHOWNBY
DEFAULT%DITTHELABELOFONEOFTHEKNOBSTOREAD)NPUT3ELECTTHE$ATA2ANGE
TAB ANDCLICK2EPRESENTATIONTOCHANGETHEDATATYPEFROMDOUBLEPRECISIONTOBYTEBY
SELECTING"YTEAMONGTHEDISPLAYEDDATATYPES4HISCANALSOBEACHIEVEDBYRIGHT
CLICKINGONTHEKNOBANDCHOOSING2EPRESENTATIONm"YTEFROMTHESHORTCUTMENU)N
THE$ATA2ANGETAB ADEFAULTVALUENEEDSTOBESPECIlED)NTHISEXAMPLE THEDEFAULT
VALUEISCONSIDEREDTOBE4HEDEFAULTVALUECANBESETBYRIGHT CLICKINGONTHE
CONTROLANDCHOOSING$ATA/PERATIONSm-AKE#URRENT6ALUE$EFAULTFROMTHESHORTCUT
MENU!LSO THISCONTROLCANBESETTOADEFAULTVALUEBYRIGHT CLICKINGANDCHOOSING
$ATA/PERATIONSm2EINITIALIZETO$EFAULT6ALUEFROMTHESHORTCUTMENU


,AB

,ABELTHESECONDKNOBAS)NPUTANDREPEATALLTHEADJUSTMENTSASDONEFORTHE
lRSTKNOBEXCEPTFORTHEDATAREPRESENTATIONPART4HEDATATYPEOFTHESECONDKNOBIS
SPECIlEDTOBEDOUBLEPRECISIONINORDERTODEMONSTRATETHEDIFFERENCEINTHEOUT
COME!STHElNALSTEPOFCONlGURINGTHE&0 ALIGNANDDISTRIBUTETHEOBJECTSUSING
THEAPPROPRIATEBUTTONSONTHE&0TOOLBAR
4OSETTHEOUTPUTS LOCATEANDPLACEA.UMERIC)NDICATOR A2OUNDED,%$
#ONTROLSm,%$Sm2OUNDED,%$ ANDA'AUGE#ONTROLSm.UMERIC)NDICATORSm
'AUGE %DITTHELABELSOFTHEINDICATORSASSHOWNIN&IGURE A 

A

B

&IGURE %XAMPLEOFSTRUCTUREANDSUB6)A &0 ANDB "$

.OW LETUSBUILDTHE"$4HEREARElVECONTROLANDINDICATORICONSALREADY
APPEARINGONTHE"$2IGHT CLICKONANOPENAREAOFTHE"$TOBRINGUPTHE&UNC
TIONSPALETTEANDTHENCHOOSE!LLFUNCTIONSm3ELECTA6)x4HISBRINGSUPAlLEDIALOG
BOX.AVIGATETOTHE3UMAND!VERAGE6)INORDERTOPLACEITONTHE"$4HIS
SUB6)ISDISPLAYEDASANICONONTHE"$7IRETHENUMERICCONTROLS )NPUTAND
)NPUT TOTHEXANDYTERMINALS RESPECTIVELY!LSO WIRETHE3UMTERMINALOF
THESUB6)TOTHENUMERICINDICATORLABELED3UM ANDTHE!VERAGETERMINALTOTHE
GAUGEINDICATORLABELED!VERAGE
!'REATEROR%QUALFUNCTIONISLOCATEDFROM&UNCTIONSm!RITHMETIC
#OMPARISONSm#OMPARISONm'REATEROR%QUALINORDERTOCOMPARETHEAVERAGE


'ETTING&AMILIARWITH,AB6)%70ART)

OUTPUTOFTHESUB6)WITHATHRESHOLDVALUE#REATEAWIREBRANCHONTHEWIRE
BETWEENTHE!VERAGETERMINALOFTHESUB6)ANDITSINDICATORVIATHE7IRINGTOOL
4HEN EXTENDTHISWIRETOTHEXTERMINALOFTHE'REATEROR%QUALFUNCTION
2IGHT CLICKONTHEYTERMINALOFTHE'REATEROR%QUALFUNCTIONANDCHOOSE
#REATEm#ONSTANTINORDERTOPLACEA.UMERIC#ONSTANT%NTERINTHENUMERIC
CONSTANT4HEN WIRETHE2OUNDED,%$ LABELEDAS7ARNING TOTHEXY
TERMINALOFTHISFUNCTIONTOPROVIDEA"OOLEANVALUE
)NORDERTORUNTHE6)CONTINUOUSLY A7HILE,OOPSTRUCTUREISUSED#HOOSE&UNCTIONS
m%XECUTION#ONTROLm7HILE,OOPTOCREATEA7HILE,OOP#HANGETHESIZEBY
DRAGGINGTHEMOUSETOENCLOSETHEOBJECTSINTHE7HILE,OOPASILLUSTRATEDIN
&IGURE 

&IGURE 7HILE,OOPENCLOSURE

/NCETHISSTRUCTUREISCREATED ITSBOUNDARYTOGETHERWITHTHELOOPITERATIONTERMINAL
ANDCONDITIONALTERMINAL ARESHOWNONTHE"$)FTHE7HILE,OOPISCRE
ATEDBYUSING&UNCTIONSm!LL&UNCTIONSm3TRUCTURESm7HILE,OOP THENTHE3TOP
"UTTONISNOTINCLUDEDASPARTOFTHESTRUCTURE4HISBUTTONCANBECREATEDBYRIGHT
CLICKINGONTHECONDITIONALTERMINALANDCHOOSING#REATEm#ONTROLFROMTHESHORTCUT
MENU!"OOLEANCONDITIONCANBEWIREDTOACONDITIONALTERMINAL INSTEADOFASTOP
BUTTON INORDERTOSTOPTHELOOPPROGRAMMATICALLY



,AB

!STHElNALSTEP TIDYUPTHEWIRES NODESANDTERMINALSONTHE"$USINGTHE!LIGN


OBJECTAND$ISTRIBUTEOBJECTOPTIONSONTHE"$TOOLBAR4HEN SAVETHE6)INAlLE
NAMED3TRUCUREAND3UB6)VI
.OWRUNTHE6)TOVERIFYITSFUNCTIONALITY!FTERCLICKINGTHE2UNBUTTONONTHE
TOOLBAR ADJUSTTHEKNOBSTOALTERTHEINPUTS6ERIFYWHETHERTHEAVERAGEANDSUM
AREDISPLAYEDCORRECTLYINTHEGAUGEANDNUMERICINDICATORS.OTETHATONLYINTEGER
VALUESCANBEENTEREDVIATHE)NPUTKNOBWHILEREALVALUESCANBEENTEREDVIA
THE)NPUTKNOB4HISISDUETOTHEDATATYPESASSOCIATEDWITHTHESEKNOBS4HE
)NPUTKNOBISSETTOBYTETYPE THATIS )ORBITSIGNEDINTEGER!SARESULT ONLY
INTEGERVALUESWITHINTHERANGEnANDCANBEENTERED#ONSIDERINGTHATTHE
MINIMUMANDMAXIMUMVALUEOFTHISKNOBARESETTOANDRESPECTIVELY ONLY
INTEGERVALUESFROMTOCANTHUSBEENTEREDFORTHISINPUT

&IGURE &0AS6)RUNS

7HENTHEAVERAGEVALUEOFTHETWOINPUTSBECOMESGREATERTHANTHEPRESETTHRESHOLD
VALUEOF THEWARNING,%$WILLLIGHTUP SEE&IGURE #LICKTHESTOPBUTTON
ONTHE&0TOSTOPTHE6)/THERWISE THE6)KEEPSRUNNINGUNTILTHECONDITIONAL
TERMINALOFTHE7HILE,OOPBECOMESTRUE



'ETTING&AMILIARWITH,AB6)%70ART)

,#REATEAN!RRAYWITH)NDEXING
!UTO INDEXINGENABLESONETOREADWRITEEACHELEMENTFROMTOADATAARRAYINALOOP
STRUCTURE4HATFEATUREISCOVEREDINTHISSECTION
,ETUSlRSTLOCATEA&OR,OOP&UNCTIONSm!LL&UNCTIONSm3TRUCTURESm&OR,OOP 
2IGHT CLICKONITSCOUNTTERMINALANDCHOOSE#REATEm#ONSTANTFROMTHESHORTCUT
MENUTOSETTHENUMBEROFITERATIONS%NTERSOTHATTHECODEINSIDEITGETSREPEATED
TENTIMES.OTETHATTHECURRENTLOOPITERATIONCOUNT WHICHISREADFROMTHE
ITERATIONTERMINAL STARTSATINDEXANDENDSATINDEX
0LACEA2ANDOM.UMBER  FUNCTION&UNCTIONSm!RITHMETIC#OMPARISONm
%XPRESS.UMERICm2ANDOM.UMBER  INSIDETHE&OR,OOPANDWIRETHEOUTPUT
TERMINALOFTHISFUNCTION NUMBERTO TOTHEBORDEROFTHE&OR,OOPTO
CREATEANOUTPUTTUNNEL4HETUNNELAPPEARSASABOXWITHTHEARRAYSYMBOL;=INSIDE
IT&ORA&OR,OOP AUTO INDEXINGISENABLEDBYDEFAULTWHEREASFORA7HILE,OOP
ITISDISABLEDBYDEFAULT#REATEANINDICATORONTHETUNNELBYRIGHT CLICKINGAND
CHOOSING#REATEm)NDICATORFROMTHESHORTCUTMENU4HISCREATESANARRAYINDICATOR
ICONOUTSIDETHELOOPSTRUCTUREONTHE"$)TSWIREAPPEARSTHICKERDUETOITSARRAY
DATATYPE!LSO ANOTHERINDICATORREPRESENTINGTHEARRAYINDEXGETSDISPLAYEDONTHE
&04HISINDICATORISOFARRAYDATATYPEANDCANBERESIZEDASDESIRED)NTHISEXAMPLE
THESIZEOFTHEARRAYISSPECIlEDASTODISPLAYALLTHEVALUES CONSIDERINGTHATTHE
NUMBEROFITERATIONSOFTHE&OR,OOPISSETTOBETEN
#REATEASECONDOUTPUTTUNNELBYWIRINGTHEOUTPUTOFTHE2ANDOM.UMBER 
FUNCTIONTOTHEBORDEROFTHELOOPSTRUCTURE THENRIGHT CLICKONTHETUNNELANDCHOOSE
$ISABLEINDEXINGFROMTHESHORTCUTMENUTODISABLEAUTO INDEXING"YDOINGTHIS THE
TUNNELBECOMESAlLLEDBOXREPRESENTINGASCALARVALUE#REATEANINDICATORONTHE
TUNNELBYRIGHT CLICKINGANDCHOOSING#REATEm)NDICATORFROMTHESHORTCUTMENU4HIS
SETSUPANINDICATOROFSCALARDATATYPEOUTSIDETHELOOPSTRUCTUREONTHE"$
.EXT CREATEATHIRDINDICATORONTHE.UMBERTO TERMINALOFTHE2ANDOM
.UMBER  FUNCTIONLOCATEDINTHE&OR,OOPTOOBSERVETHEVALUESCOMING
OUT4ODOTHIS RIGHT CLICKONTHEOUTPUTTERMINALORONTHEWIRECONNECTEDTOTHIS
TERMINALANDCHOOSE#REATEm)NDICATORFROMTHESHORTCUTMENU
0LACEA4IME$ELAY%XPRESS6)&UNCTIONSm%XECUTION#ONTOLm4IME$ELAY TO
DELAYTHEEXECUTIONINORDERTOHAVEENOUGHTIMETOOBSERVEACURRENTVALUE!CON
lGURATIONWINDOWISBROUGHTUPTOSPECIFYTHEDELAYTIMEINSECONDS%NTERTHEVALUE
TOWAITSECONDSATEACHITERATION.OTETHATTHE4IME$ELAY%XPRESS6)IS
SHOWNASANICONIN&IGURE INORDERTOHAVEAMORECOMPACTDISPLAY


,AB

&IGURE #REATINGARRAYWITHINDEXING

3AVETHE6)AS)NDEXING%XAMPLEVIANDRUNITTOOBSERVEITSFUNCTIONALITY&ROM
THEOUTPUTDISPLAYEDONTHE&0 ANEWRANDOMNUMBERSHOULDBEDISPLAYEDEVERY
SECONDSONTHEINDICATORRESIDINGINSIDETHELOOPSTRUCTURE(OWEVER NODATA
SHOULDBEAVAILABLEFROMTHEINDICATORSOUTSIDETHELOOPSTRUCTUREUNTILTHELOOP
ITERATIONSEND!NARRAYOFELEMENTSSHOULDBEGENERATEDFROMTHEINDEXING
ENABLEDTUNNELWHILEONLYONEOUTPUT THELASTELEMENTOFTHEARRAY SHOULDBEPASSED
FROMTHEINDEXING DISABLEDTUNNEL
,$EBUGGING6)S0ROBE4OOL
4HE0ROBETOOLISUSEDTOOBSERVEDATATHATAREBEINGPASSEDWHILEA6)ISRUNNING
!PROBECANBEPLACEDONAWIREBYUSINGTHE0ROBETOOLORBYRIGHT CLICKINGONA
WIREANDCHOOSING0ROBEFROMTHESHORTCUTMENU0ROBESCANALSOBEPLACEDWHILEA
6)ISRUNNING
0LACINGPROBESONWIRESCREATESPROBEWINDOWSTHROUGHWHICHINTERMEDIATEVALUES
CANBEOBSERVED!PROBEWINDOWCANBECUSTOMIZED&OREXAMPLE SHOWINGDATAOF
ARRAYDATATYPEVIAAGRAPHMAKESDEBUGGINGEASIER4ODOTHIS RIGHT CLICKONTHEWIRE
WHEREANARRAYISBEINGPASSEDANDCHOOSE#USTOM0ROBEm#ONTROLSm'RAPH)NDICATORS
m7AVEFORM'RAPHSFROMTHESHORTCUTMENU


'ETTING&AMILIARWITH,AB6)%70ART)

!SANEXAMPLEOFUSINGCUSTOMPROBES A7AVEFORM#HARTISUSEDHERETOTRACK
THESCALARVALUESATPROBELOCATION A7AVEFORM'RAPHTOMONITORTHEARRAYAT
PROBELOCATION ANDAREGULARPROBEWINDOWATPROBELOCATIONTOSEETHEVALUES
OFTHE)NDEXING%XAMPLE6)4HESEPROBESANDTHEIRLOCATIONSAREILLUSTRATEDIN
&IGURE 

&IGURE 0ROBETOOL



,AB

,"IBLIOGRAPHY
;= .ATIONAL)NSTRUMENTS ,AB6)%75SER-ANUAL 0ART.UMBER%