{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lesson 3 bme 405 fall 2010 cases sequences no activities

lesson 3 bme 405 fall 2010 cases sequences no activities -...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Lesson 3: case and sequence structures,  formula nodes, clusters
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Plan Case structure Sequence structure Formula node and expression node Clusters Cluster functions
Background image of page 2
Case and sequence structures, formula  and expression nodes
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Case structure To choose a course of action  depending on an input value;  analogous to an “if-then-else”  statement in other languages Found in structures   subpalette of functions  palette Case structure looks like a  deck of cards. You can see  only one case frame at a time.  Case structure can have two  or more case frames  Add cases using shortcut  (right-click) and “add case  after” or “add case before” Only one case at a time  executes: determined by input  wired to selector terminal 
Background image of page 4
Four case structure Case 0 = Default case;  LabVIEW will choose the default case when  input of selector terminal does not match any listed choice Selector terminal takes the type of the selector variable
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Enumerated type control (Enum) To give user a list of actions from  which to select; in “ring and enum”  subpalette of controls palette Right click + edit items (or properties  – edit items) to populate enum Enum equivalent to unsigned integer  (blue color) Case structure has initially two  frames. Once enum is created,  corresponding cases added with  shortcut + “add case after” or “add  case before”, or “add case for every  value”. You can delete cases with  “remove case” Hint: create items for enumerated  control first, then populate case  structure with “add case for every  value” works best.
Background image of page 6
Tunnels and case structures Tunnel: means for data  to enter and exit the  case structure Tunnels appear as  colored squares on the  case structure border
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Input tunnels Data is available to  all cases  Cases do not have to  use all the data
Background image of page 8
Output tunnels Ouput tunnels must be  wired for all cases Case left unwired shows  a “white” tunnel and a  broken arrow  May use shortcut (right  click) and select “use  default if unwired” but  what is “default”? This  approach should be  avoided to keep the code  clear. Instead select  “recognizable” output
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Activity 1: case structure (15 min)
Background image of page 10
While loop + case structure combination Main while loop to keep  program running until stop  button is pressed or error Case structure to trigger  action when a certain  condition is satisfied “True” case holds the action;  “false case is empty: no  action
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}