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

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lesson 3: case and sequence structures, formula nodes, clusters Plan Case structure Sequence structure Formula node and expression node Clusters Cluster functions Case and sequence structures, formula and expression nodes 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 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 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. 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 Input tunnels Data is available to all cases Cases do not have to use all the data 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 Activity 1: case structure (15 min) 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...
View Full Document

This note was uploaded on 09/26/2010 for the course BME 405L at USC.

Page1 / 37

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

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online