1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

103
1 NI Certification Certified LabVIEW Developer Exam Preparation Course

Transcript of 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

Page 1: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

1

NI CertificationCertified LabVIEW DeveloperExam Preparation Course

Page 2: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

2

Purpose Of This Course

•Prepare you to take the certification exam by:•Reviewing the Certification & Examination Process•Discussing the Topics of Often Missed Questions•Showing Examples of Good Wiring Techniques •Demonstrating Good VI Construction Techniques

Essentially a Collection of Topics and Tips for Taking the Certified LabVIEW Developer Examination

Page 3: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

3

Purpose Of This Course

• This course will not give you the questions on the exam, however:

•The topics presented are aimed at the most often missed questions

•The answers to these often missed questions are part of the presentation

Page 4: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

4

Schedule of Topics

•Certification Process•Examination Process•Written Examination Topics of special concern•Practical Examination topics of special concern

•VI Construction•Wiring Techniques

Page 5: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

5

Benefits:• Use of National Instruments Certification Logo

• Listing on ni.com/training

Page 6: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

6

Certification ProcessThe Process ensures:

•Credibility - Fair and Unbiased => Value!•Validity - It Evaluates Important items•Reliability - A Reliable Indicator of Proficiency

Page 7: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

7

Certification Process•The Candidate Submits an Application

•The Candidate Takes the Examination

•The Examination is Graded

•Every Examination is Reviewed by at Least Two People

•Ensures Objective Results

•The Candidate Receives a Certificate and Logos

•The Candidate’s Name is Placed on ni.com

Page 8: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

8

CLD Examination Details•Two parts: •Written

•Written contains 40 Questions •90 Minute Time Limit•All Multiple Choice Questions

•Practical contains One Project: •Time Depends on Which Exam is provided•Usually 3 ½ to 4 ½ hours

Page 9: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

9

CLD Examination DetailsWritten Examination InstructionsCertified LabVIEW Developer Examination

Examinee ____________________________________________ Date: ____________Administrator _________________________________________ Date: ____________

Instructions:There are two sections in this examination. The first section is a set of forty multiple choice questions. The second section is a hands-on project creating a VI that conforms to a set of specifications.Questions 1 through 31 each have one correct response. Questions 33 through 40 have one or more correct choices, and all correct responses must be selected to get credit for that question. You are not allowed to ask the proctor for help. If you believe the intent of a question is not clear, you may note that question, and your reasons for choosing the answer you believe best fits the question. Your comments will be taken into account and credit awarded appropriately when the exam is graded.Each multiple choice question is worth 1.5 points, for a total of 60 points. The project is worth 40 points. The entire examination is therefore worth 100 points. The minimum passing grade is 75%. In addition to the total score, the written and practical components must each receive a passing grade as separate components.This examination may not be taken from the examination area or reproduced in any way. A computer with LabVIEW is the only reference allowed for the examination. The time limit for Section 1 is 90 minutes. The time limit for Section 2 is stated in that section.

Page 10: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

10

CLD Examination DetailsTypical Exam Question ConstructionObjective:Describe the following options available on Front Panel Controls and Indicators

•Visible Items•Make Current Value Default•Reinitialize to default•Synchronous Display•Enabled State•Autoscale

Exam Question:Which of the following options determines whether a user can update a Front Panel Control’s value?a.Autoscaleb.Enabled Statec.Synchronous Displayd.Make Current Value Default

Page 11: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

11

CLD Examination DetailsPractical Examination InstructionsIntroduction:Your company has received a contract to produce a ----------- system for a local manufacturer. The purpose of the ----------- system is to monitor the ------------- manufacturing --------------- to ------------- ----------- -------------- ------------- -----------.You have been assigned to create the software for this system using LabVIEW. You will create the software for six ------------- ------------, with the actual hardware being simulated by Boolean switches on the Front Panel.

Requirements:Using a front panel similar to the graphic provided, create a VI that implements the ---------- system requirements listed in this section. All hardware components are to be simulated using LabVIEW controls and indicators. Your solution must consist of code created expressly for this exam using VIs and functions directly available in LabVIEW.Your solution should be hierarchical in nature. All major functions should be performed in SubVIs.The solution should not use 100% CPU time while running, and should respond to any front panel control change, including “Stop Simulation,” in less than 100mS.The resulting VI must be presented to the proctor in two forms. Recommended forms are 3 ½ inch floppy disk, CD-R, or email to [email protected].

Page 12: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

12

Practical Exam Grading

• Practicals are graded on three criteria:– Functionality– Programming Style– Documentation

• Each of these criteria have approximately equal weights• The Practical must be passed independent of the written

portion of the exam• Total practical grade is 40% of composite grade

Page 13: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

13

Functionality

• Does the VI properly perform the requirements listed in the specifications?– Is the logic correct for Boolean inputs and outputs?– Does the VI respond to user inputs within the stated time limit?

Page 14: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

14

Style

• Is the VI constructed in a professional manner?– Easily maintainable?– Constructed for scalability?– Does it use unnecessary Variables?– Does it improperly use Property Nodes?– Are there unnecessary structures?

• Sequence Structures– Does it use 100% CPU time?– Logical layout with edges lined up

Run Property Node Example

Page 15: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

15

Documentation

• Wire data – If the data flowing through a wire is not clear, a specific label should

indicate the purpose of that data• Function of code segments

– Segments of code should have labels describing the function of that code

• Controls and indicators have descriptive names• Standard labels are yellow (found on String SubPalette)

Page 16: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

16

Written Examination Topics

David BonalCourse Development Engineer

Page 17: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

17

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 18: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

18

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 19: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

19

Booleans• Many programmers do not understand the

functionality of mechanical action of booleans• Switch action:

Control is toggled

until changed by

hand

• Latch action:

Control reverts to

default state when

read by diagram

Page 20: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

20

Booleans

• Where to get help:

Help>>Find Examples>>Building User Interfaces>>General>>Mechanical Action of Booleans

Page 21: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

21

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 22: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

22

Memory

• The most common and most mysterious reason for

poor performance of VIs

• LabVIEW handles memory management

automatically

– No need to code when to allocate or deallocate

– You have less control over when memory operations occur

Page 23: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

23

Memory VI Component Memory Usage

• Data is always loaded• Code is loaded if platforms match

(MacOS, Windows, Sun, Linux)• Panel and Diagram are loaded if needed (recompiling)

Main VI SubVI

Always in memory

Resident sometimes

FrontPanel

BlockDiagram

Code DataSpace

FrontPanel

BlockDiagram

Code DataSpace

Page 24: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

24

MemoryCoercion and Consistent Data Types

•Coercion dots imply a conversion of data types

•In general, the compiler creates a new buffer to store the converted data

•Affects performance

Page 25: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

25

MemoryCoercion and Consistent Data Types

Method 1 (Incorrect) Method 2 (Incorrect)

Method 3 (Correct)

4 kB for copy to SGL8 kB

8 kB4 kB for FP copy

8 kB

8 kB4 kB to convert

to SGL

4 kB to convert to SGL

4 kB for FP copy

4 kB

4 kB

4 kB for FP copy

24 kB total 28 kB total

12 kB total

Page 26: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

26

MemoryBuilding Arrays

Terrible Method

Page 27: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

27

MemoryBuilding Arrays

Slightly Better Method

Page 28: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

28

MemoryBuilding Arrays

Good Method

Page 29: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

29

MemoryBuilding Arrays

Best Method

Page 30: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

30

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 31: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

31

Multithreading

• Specific tasks within an application are subdivided• Provides “pseudo-parallelism”• Threads are automatically handled in LabVIEW• Seven execution systems• Five available priorities

Overview

Page 32: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

32

Multithreading

VI

User Interface

StandardInstrument

I/OData

AcquisitionOther 1 Other 2

Same as Caller

LabVIEW

Operating System2000/NT/9x, Sun Solaris 2, and Linux

Architecture

Page 33: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

33

Multithreading

• Priorities control when a VI is executed within the thread

• Five priorities– Background– Normal– High– Time Critical– Subroutine

Priorities

Page 34: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

36

Multithreading

Issues

•SubVI calls are relatively expensive•Calling a subVI in a different execution system can be really expensive•Biggest issue = THREAD SWAPS

Multithreading Demonstration

Page 35: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

37

Multithreading

• Deadlock occurs if each thread is requesting a resource held by the other

Issues - Deadlock

Resource A

Thread 1

Thread 2

Resource B

LocksRequested and Waiting

LocksRequested and Waiting

Page 36: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

39

MultithreadingIssues – Priority Inversion•A high priority task is requesting a locked resource from a low priority task, causing a lower priority task to gain more CPU time

Time

Prio

rity

High

Low

Thread 1

Thread 2

Thread 3

Running

Blocked

Waiting

Locks Resource

Locks Resource

Resource Unavailable

Page 37: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

40

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 38: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

41

Property Nodes

• Properties are characteristics or qualities about an object• Property nodes allow you to programmatically set and

read the properties of front panel objects, including an object’s data value

• Examples of properties:

Overview

•Display colors of front panel objects•Visibility of front panel objects•Menu selections for a ring control

•Scales and cursors on graphs•Size of front panel objects•Location of front panel objects

Page 39: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

42

Property NodesCreating Property Nodes• Right-click on a panel object or its diagram

terminal and choose Create»Property Node

• Use the Operating tool to select which property to read or write

Page 40: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

43

Property Nodes

• Very fast to program, very slow to execute• Difficult to debug• Violates data flow programming• Property nodes located in a subVI will load the front panel into memory

• Property nodes cause a thread swap to the User Interface thread

• Property nodes execute serially, never in parallel

Issues

Page 41: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

44

Property Nodes

• When performing multiple control property changes on a graph, use “Defer Panel Updates”– Disables UI refresh until the property changes are complete

Defer Panel Updates

Page 42: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

45

Property Nodes

• Refnum to a specific front panel object• Allows you to control front panel objects with a subVI

Control References

Control References Demonstration

Page 43: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

46

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 44: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

47

Variables

• Use local variables to access front panel objects from more than one location in a single VI

• Pass data between block diagram structures that you cannot connect with a wire

Local Variable Overview

Page 45: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

48

Variables

• Used to pass data among several VIs• “Pseudo-VI” without a block diagram• Multiple objects can be placed into one global

Global Variable Overview

Create the controls needed as global variables

Each control must have owned label

Right-click using the Operating Tool

Page 46: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

49

VariablesRace Conditions

LabVIEW Code Sequential Codex = x * 5x = x + 2

ORx = x + 2x = x * 5

No clear data dependency exists, so the order of execution is not precisely known

Page 47: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

50

Variables

• Each control or front panel object must have an owned label associated with it

• Difficult to debug• Contributes to race conditions

Issues

Page 48: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

51

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 49: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

52

Dynamic Link Libraries (DLL)Overview• An executable file that can never run on its own• Loaded by operating system as requested by

application• Application uses dll code as part of its binary files• Application does not know what language dll was

originally written in• Dll acts like a ‘black box’ with exported functions• Application need not know how these functions are

actually implemented

Page 50: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

53

DLLCall Library Function

Thread-UnsafeRuns in User Interface Thread(Orange)

Thread-SafeRe-entrantCall Library Node(Yellow)

Page 51: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

54

DLL Issues

• LabVIEW loads the DLL at the same time the VI is loaded

• LabVIEW unloads the DLL when the calling VI has been completely removed from memory

• Thread safe DLLs• Global variables or initialization code located in DLL

Page 52: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

55

DLL Issues

Suppose we have the following DLL:/* Global Variable */int test = 0;

/* Function to be exported */__declspec (dllexport) void __stdcall secondLevel(int *value){

test = test + 15;*value = test;

}

Called with the following LabVIEW Code:

Page 53: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

56

DLL Issues

• We expect the DLL to return 15• The DLL actually returns:

Continued

Run Output

1 15

2 30

3 45

Page 54: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

58

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 55: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

59

ActiveX

With ActiveX automation, you can:

• Create applications that expose objects - called automation servers.

• Create and control objects exposed in one application from another application - called an automation client.

Overview

An automation object can have:

• Methods - Functions that perform an action on an object, such as resizing it.

• Properties - Functions that set or return information about the state of an object.

Page 56: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

60

Opens an automation refnum that refers to a specific ActiveX Automation object

Invokes a method or action on an ActiveX automation object

Sets or gets ActiveX object property information

Closes an automation refnum. To prevent a memory leak close open automation refnums

ActiveX VIs

Page 57: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

61

ActiveXExample

Page 58: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

62

ActiveX

• Information about the server• Closing the refnums to prevent memory leaks

Issues

Page 59: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

63

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 60: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

64

VI ServerOverview

• Provides programmatic access to LabVIEW and its Applications (your programs)– Call a VI remotely.– Allows you to control a LabVIEW application from another

program.– Update the properties of multiple VI’s.– Edit the properties of a VI and LabVIEW– Load VIs into memory dynamically– Create a plug-in architecture– Retrieve LabVIEW and platform information.

Page 61: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

65

VI Server

VI Server

ActiveX Interface

Diagram Functions

TCP/IP

ActiveX AutomationClient

TCP/IPClient

Architecture

Page 62: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

66

VI Server

• Two classes of objects- Application—just one per LabVIEW application

- Virtual Instruments

• Each class offers:- Properties—single valued attributes of the object:

read/write, read only, write only- Methods - functions that operate on the object

Objects

Page 63: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

67

VI ServerExample

Open Application is only needed if accessing a VI on a remote machine

VI path can be a pathname, or a string

Property Node opens the front panel of the VI

Invoke Node calls the Method ‘Run VI’

Close the session

Check for errors

Open a session to a VI object

Page 64: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

68

VI ServerStrictly Typed VI Refnum

A data type that encodes the connector pane type information, but not the VI to call.

Open VI Reference function

Call By Reference

Connector type and VI information

Connector pane type and VI to call

Page 65: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

69

VI ServerAdvantages of a Strictly Typed VI Refnum

Using Methods to Write/Read Controls/Indicators

•Same thing using Call by Reference

•Much neater diagram

•Datatypes checked by Open VI Reference

•No type checking when VI called (Strong Typing)

Flatten to String Unflatten from String

Page 66: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

70

LabVIEW Topics

• Booleans• Memory• Multithreading• Property Nodes• Variables

t

• DLL• ActiveX• VI Server• Synchronization

Nine Areas of Concern

Page 67: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

71

Synchronization

• Powerful, easy to use, underused features• Five Types:

– Occurrences– Notifiers– Queues– Semaphore– Rendezvous

Overview

Page 68: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

72

SynchronizationOccurrences

• Software interrupt• Efficient

Page 69: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

73

SynchronizationOccurrences - Example

Page 70: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

74

SynchronizationNotifiers

•Function like occurrences, but with the added feature of passing data•Area of concern – Notifiers can lose data

Page 71: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

75

SynchronizationNotifiers - Example

Page 72: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

76

SynchronizationQueues

•Function like notifiers, but retain the data in a FIFO buffer•A non lossy synchronization technique

Page 73: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

77

SynchronizationQueues - Example

Page 74: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

78

SynchronizationSemaphore

• Protects access to shared resources• Can be used to avoid race conditions

Page 75: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

79

SynchronizationSemaphore - Example

Page 76: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

80

SynchronizationRendezvous

•Used to synchronize multiple tasks•Allows for parallel tasks to wait for each other before proceeding

Page 77: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

81

SynchronizationRendezvous - Example

Page 78: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

82

Questions?

Page 79: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

83

Practical Examinations

Page 80: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

84

About the Practical

• A PC with LabVIEW is required• LabVIEW Help may be used

– You are not allowed to plagiarize shipping examples!

• No other resources are allowed

• Time varies a small amount based on the requirements– Generally 3 ½ to 4 ½ hours

Page 81: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

85

The Intent of the Practical

• The practical evaluates overall LabVIEW Programming skills

• What is required:– Good LabVIEW programming techniques– Problem solving skills in LabVIEW– Good Programming Style

• Must have mastery of these skills to complete the exam in the time allotted

Page 82: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

86

Example: 4-Way Intersection Traffic Lights

• Green-Yellow-Red for:– Northbound– Southbound– Eastbound– Westbound

• North and South bound are green at the same time• East and West bound are green at the same time• May need to add left-hand turn lanes later as traffic

increases at this intersection

Page 83: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

87

Traffic Lights: Version 1

• Successfully directs traffic flow• What are the drawbacks?

– Cannot stop in the middle of a cycle– Not easy to modify for future traffic needs– Difficult to determine what function each Boolean performs

Page 84: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

88

Traffic Lights: Version 2

• Improvements:• Uses a Case Structure vs. a Sequence Structure

– Allows the Traffic Engineer to break into the cycle– Can also add cases for future modifications

Page 85: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

89

Traffic Lights: Version 3

• Improvements:• Additional Documentation added to Describe Code

Functions and Wire Data• Group front Panel Objects into Clusters

– Makes all indicators easily available in all cases– Adds inherent documentation– Note with updating the indicators outside the case, the timing must

also reside outside the case

Page 86: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

90

Traffic Lights: Version 4

• Improvements:• Use of a Type Defined Enumerated Control for determining

the next state– Type Definition allows for scalability of the design. New states can be

added to the control and all constants made from that control are updated

Page 87: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

91

Traffic Lights: Version 5

• Improvements:• Incorporate a timing method that allows for immediate

control of the execution– For most applications, immediate control is needed to allow the system

to respond to critical inputs– Note the addition of the time delay in the loop. This prevents

LabVIEW from taking 100% CPU time for it’s execution

Page 88: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

92

Traffic Lights: Version 6

• Adding Indicators for Left Turn Signals:• With the indicators in clusters, adding indicators is

straightforward– Add the indicators on the front panel by copying the existing indicators– On the Block Diagram, create constants for each indicator– Add the constants to the cluster constant on the left-side of the Block

Diagram– All indicators are now available in every state

Page 89: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

93

Traffic Lights: Version 7

• Adding Turn Lane sensors:• Add the Booleans and copy the Enum constants to direct

the program flow– The sensors are checked when the yellow light is illuminated for the

opposite direction• This is a complete, working version of the application

– It is completely dataflow driven, no variables were needed

– It is easily scalable

– It is documented

Page 90: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

94

Traffic Lights: Version 8

• This version is similar to version 7, however it incorporates a case structure rather than discrete Selectors

• It is also a completely acceptable solution

Page 91: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

95

Traffic Lights: Version 9

• Again, this is similar to version 7, only this implementation uses Queues to select the next state

Page 92: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

96

Additional Notes on Programming Style

• What Style issues would cost points in this Block Diagram?

Page 93: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

97

Additional Notes on Programming Style

• What is the source for this Error Cluster?

• Left to right flow is important for readability

Page 94: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

98

Additional Notes on Programming Style

• Watch for unnecessary bends in wires

Page 95: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

99

Additional Notes on Programming Style

• Wire into and out of tunnels

Page 96: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

100

Additional Notes on Programming Style

• Wire to obvious terminals on objects

Page 97: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

101

Additional Notes on Programming Style

• Do not wire underneath objects

Page 98: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

102

Additional Notes on Programming Style

• Do not cover objects with other objects

Page 99: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

103

Additional Notes on Programming Style

• Wire into and out of the correct terminal locations

Page 100: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

104

Additional Notes on Programming Style

• Always place a time delay in loops

?

Page 101: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

105

Additional Notes on Programming Style

• Adjust the size of structures to show objects in all cases

Page 102: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

106

Question / Answer Session on Certification

• Technical Questions• Exam Administration Questions

• Best wishes on your Certification Exam

David Bonal

Mike Fillian

Page 103: 1 NI Certification Certified LabVIEW Developer Exam Preparation Course.

107

Thank you!