ME 120 Experimental Methods Laboratory3-1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

ME 120 Experimental Methods

Laboratory

Ananda Mysore

Spring 2008 Ananda Mysore


String, Enum, and Error Cases
String Case Enum Case Error
Case

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
State Machine Architecture
 Advantages
 Can go from any state from any
other
 Easy to modify and debug
 Disadvantages
 Can lose events if two occur at the
same time
States:
0: Startup
1: Idle
2: Event 1
3: Event 2
4: Shutdown

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
Simple State Machine

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
Strings
• A string is a sequence of displayable or - characters (ASCII)
• Many uses — displaying messages, instrument control, file I/O
• String control/indicator is in the Controls»String subpalette

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
String Display Modes
Normal display \ code display

Password display Hex display

Spring 2008 Ananda Mysore


String Functions
String Length

Concatenate Strings
(spaces here)

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
String Functions
String Subset

Match Pattern

Spring 2008 Ananda Mysore


Converting Strings to Numerics:
Scan From String

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
Converting Numerics to Strings: Build String

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
Formula Node Note semicolon

• In the Structures subpalette


• Implement complicated equations
• Variables created at border
• Variable names are case sensitive
• Each statement must terminate with a semicolon (;)
• Context Help Window shows available functions

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore
Decision Making with Formula
Nodes

Two different ways of using an if-then statement in a Formula Node


Both structures produce the same result

ME 120 Experimental Methods Laboratory


Spring 2008 Ananda Mysore

You might also like