Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW...

166
ni.com/training Preparing for the Certified LabVIEW Associate Developer (CLAD) Exam Last Updated: November 10, 2013

Transcript of Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW...

Page 1: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Preparing for the Certified LabVIEW Associate Developer

(CLAD) Exam

Last Updated: November 10, 2013

Page 2: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

What Level Should You Pursue?

Foundation Experience Mastery

Technician/ Basic Developer:

• Infrequent LabVIEW Developer or “Casual coder”

• Spending fewer than 10 hours a week developing applications in LabVIEW

• Only planning one LabVIEW project

• Developing or supporting small to medium measurement and control applications in LabVIEW (<50 VIs)

Software Engineer: • Using LabVIEW on

regular basis to develop applications

• Designing and developing medium to large applications in the LabVIEW (50 to 500 VIs)

• Significantly modifying or upgrading previously developed code

• Developing an application to be used, supported, or maintained by others

Software Architect: • Designing the architecture

for a large LabVIEW application (500 + Vis) from high-level design requirements

• Project managing a team of more than one LabVIEW developer

• Working in a regulated industry (Mil/Aero, Automotive, Medical)

• Designing a ‘mission critical’ application

How to Navigate the LabVIEW Learning Curve Tutorial

Page 3: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

LabVIEW Training & Certification Path LabVIEW Core 1 & 2

LabVIEW Core 3 & Connectivity

Advanced Architectures for LabVIEW

• LabVIEW fundamentals • Basic application

creation using LabVIEW • Basics of data

acquisition & instrument control

• Modular application development

• Structured design and development practices

• Inter-application communication and connectivity techniques

• Large application design • Advanced development

techniques • Implementing multi-

developer projects

• Demonstrates knowledge of core features and functions

• Develops, debugs and maintains small LabVIEW modules

• Demonstrates experience in developing scalable, readable and maintainable applications

• Develops, debugs, and deploys medium to large scale applications

• Demonstrates mastery in architecting applications for multi-developer teams

• Develops requirements architectures, tools, components and best practices for team

Page 4: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

LabVIEW Certification Exams and Process

Certified LabVIEW Associate Developer

Certified LabVIEW Developer

Certified LabVIEW Architect

• Objective style exam (multiple choice)

• 1 hour long • Scheduled (online) via

Pearson Vue’s web page • Administered and

proctored by Pearson Vue

• Evaluated automatically • Results available to

candidate upon exam completion

• Certificate is mailed or emailed by Training & Certification

• Practical development exam

• 4 hours long • Scheduled by Training &

Certification or NI branch • Administered by Training

& Certification, proctored by NI representative

• Evaluated and concurred by two engineers

• 4 week process • Certificate is mailed by

Training & Certification

• Short answer and practical development exam

• Same as CLD

Presenter
Presentation Notes
Certificate is mailed by Training & Certification
Page 5: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

CLAD Prep Topics Most Commonly Missed • Coercion Dots • Loop Components • Shift Registers and Feedback Nodes • VI Timing • Property Nodes • Charts and Graphs • Arrays • Array Functions • Mechanical Action of Booleans • Data Representation • Sequence Structures • Case Structures • Data Flow • Breaking Data Flow • String Functions • Clusters • Type Definitions • References

Additional Concepts

• Enumeration

• Conditional Disable Structure

• Notify and Filter Events

• Multiple Loop Design Pattern

• Notifiers

• Semaphores

• File Formats

• Modularity and SubVIs

• Icon and Connector Pane

• Errors and Warnings

• Variables

• Race Conditions from Shared Resources

• VI Server Organization

• Create references programmatically

Page 6: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Most Commonly Missed Topics on the CLAD

Presenter
Presentation Notes
This section contains the review and prep material referenced by the LabVIEW Academy Instructors’ Guide.
Page 7: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Coercion Dots

•Coercion Dots indicate that LabVIEW has converted a value to a different numeric representation •LabVIEW coerces values to the data type with the largest number of bits, except for For Loops (always 32-bit signed integer) •Avoid coercion dots for best programming efficiency

Red Coercion dots on input terminals

Blue Coercion dots on output terminals

Convert to Double Data Type

Page 8: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Coercion Dots

When does the coercion dot appear?

A. The data types are consistent B. A polymorphic operation is performed on the data C. The data conversion is forced due to the mismatched numeric representation between terminals D. Data values are being coerced because they are out of range

Presenter
Presentation Notes
C
Page 9: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Coercion Dots

When does the coercion dot appear?

A. The data types are consistent B. A polymorphic operation is performed on the data C. The data conversion is forced due to the mismatched numeric representation between terminals D. Data values are being coerced because they are out of range

Page 10: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Coercion Dots

Which of the following statements is true regarding the use of Coercion Dots? a. Coercion Dots improve program performance. b. Coercion Dots represent a conversion from one data type to another. c. Coercion Dots increases memory usage d. Both A. and B. e. Both B. and C.

Presenter
Presentation Notes
C
Page 11: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Coercion Dots

Which of the following statements is true regarding the use of Coercion Dots? a. Coercion Dots improve program performance. b. Coercion Dots represent a conversion from one data type to another. c. Coercion Dots increases memory usage d. Both A. and B. e. Both B. and C.

Coercion dots indicate that a certain data type is being wired to terminal that accepts a different but compatible data type. When this happens, LabVIEW converts the data to the larger of the two data types. This requires the creation of a memory buffer to store the coerced data.

Presenter
Presentation Notes
C
Page 12: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Coercion Dots

What will “Result” be after running the VI?

A. 2 B. 2.7 C. 3 D. NaN

Presenter
Presentation Notes
C
Page 13: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Coercion Dots

What will ‘Result’ be after running the VI?

A. 2 B. 2.7 C. 3 D. NaN

The block diagram places the coercion dot on the border of the terminal where the conversion takes place. The data is not coerced until after the addition, at which point it rounds to the nearest integer.

1.2 + 1.5 = 3 (2.7 rounded to 3)

Presenter
Presentation Notes
Note: x.5 will be rounded down to x.0
Page 14: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Loops

For Loops and While Loops have an Iteration Terminal to display how many times the loop has executed •While Loops must execute at least once

•For Loops can execute zero times

•The Iteration Terminal is zero indexed; this means the output of the terminal is zero for the first iteration of the loop.

Page 15: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Loops

What will be shown on the “For Loop Sum”, “While Loop Sum”, and “Iteration” indicators when the program below is run? A. For Loop Sum= 1, Iteration=0, While Loop Sum= 1

B. For Loop Sum=2, Iteration=1, While Loop Sum=2 C. For Loop Sum=1, Iteration=0, While Loop Sum=2

Page 16: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Loops

N Stop Condition

Met (N>input)?

Addition operation

“For Loop Sum” value

“Iteration” value

1 no 0+1=1 1 0

2 yes Does not execute

1 (no change)

0 (no change)

Page 17: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Loops

Iteration Addition operation

“While Loop Sum” value

value

Stop condition

met (i=1)?

1 0+1=1 1 0 no

2 1+1=2 2 1 yes

Page 18: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Loops

What will be shown on the “For Loop Sum”, “While Loop Sum”, and “Iteration” indicators when the program below is run? A. For Loop Sum= 1, Iteration=0, While Loop Sum= 1

B. For Loop Sum=2, Iteration=1, While Loop Sum=2 C. For Loop Sum=1, Iteration=0, While Loop Sum=2

Page 19: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Shift Registers – Multiple Previous Values

• Shift registers can be resized to save multiple previous values.

• Retains a certain number of previous values, oldest ones get removed as needed

2

?

?

?

Iteration:

Numeric:

0 1

2 5 5

2

?

?

2

3 3

5

2

?

3

9 9

3

5

2

4

1 1

9

3

5

A:

B:

C:

D:

Presenter
Presentation Notes
Because a refnum is a temporary pointer to an open object, it is valid only for the period during which the object is open. If you close the object, LabVIEW disassociates the refnum with the object, and the refnum becomes obsolete. If you open the object again, LabVIEW creates a new refnum that is different from the first refnum. LabVIEW allocates memory for an object that is associated with a refnum. Close the refnum to release the object from memory.
Page 20: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Shift Registers

After 3 iterations, what will be the value at indicator D? a. 0 b. 10 c. 3 d. Unknown

Iteration: 0 1

2 5

2

3 Numeric:

Page 21: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Shift Registers

After 3 iterations, what will be the value at indicator D? a. 0 b. 10 c. 3 d. Unknown

Iteration: 0 1

2 5

2

3 Numeric:

Justification: Since this shift register is uninitialized, after three iterations the shift register attached to indicator D will not have a value. If this VI was run previously, it would contain the last value stored in the shift register.

Page 22: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Shift Registers

After 4 iterations, what will be the value at indicator D? a. 0 b. 7 c. 3 d. Unknown

Iteration: 0 1

2 5

2

3 Numeric:

3

7

Page 23: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Shift Registers

After 4 iterations, what will be the value at indicator D? a. 0 b. 2 c. 7 d. Unknown

Iteration: 0 1

2 5

2

3 Numeric:

3

7

Justification: After 4 iterations, the oldest value of the Numeric control will be in the shift register attached to indicator D.

Page 24: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Feedback Node

• A feedback node functions like a shift register. • Can set an initial value by wiring data into the terminal on the left

side of the loop.

Presenter
Presentation Notes
Because a refnum is a temporary pointer to an open object, it is valid only for the period during which the object is open. If you close the object, LabVIEW disassociates the refnum with the object, and the refnum becomes obsolete. If you open the object again, LabVIEW creates a new refnum that is different from the first refnum. LabVIEW allocates memory for an object that is associated with a refnum. Close the refnum to release the object from memory.
Page 25: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Feedback Node

What number will be added to the random number on the first iteration of this loop? a. 0 b. Unknown c. 5 d. 2

Page 26: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Feedback Node

What number will be added to the random number on the first iteration of this loop? a. 0 b. Unknown c. 5 d. 2

Justification: A feedback node acts exactly like a shift register. The terminal on the left side sets an initial value for the feedback node, which is used during the first iteration of the loop.

Page 27: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Timing Functions

• Control or measure the frequency at which a loop executes • Provide the processor with time to complete other tasks, such as

processing the user interface • Uses the operating system millisecond clock

Presenter
Presentation Notes
There are many reasons to use the timing functions. The Wait and Wait Until Next Millisecond Multiple functions are used for two main reasons: to control loop frequency (how quickly you go to the next loop iteration) and to provide “down time” for the processor allowing it to go complete other (possibly non-LabVIEW) tasks, such as updating the front panel or run a virus scan. The Elapsed Time Express VI is used to check how much time is passed. The Tick Count and Get Date/Time In Seconds functions can be used to determine how much time has passed, as well, by taking the difference of two measurements. (Note that the Tick Count has a maximum value 4,294, 967, 295 (49 days) because it is limited by the data type, U32. Once the maximum is reached, it begins again at zero: also known as rolling over. Therefore, if you want to measure a longer time, use the Get Date/Time in Seconds.) The timing functions use the Operating System’s ms clock The wait and wait until next ms multiple functions are discussed in the following slides in more detail.
Page 28: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Wait (ms)

Waits for specified input number of milliseconds oPerforms function asynchronously oReturns only after the specified wait time oDoes not interrupt parallel code oLoops will not iterate until function returns

Presenter
Presentation Notes
The Wait (ms) function makes asynchronous system calls, but the nodes themselves function synchronously. Therefore, it does not complete execution until the specified time has elapsed.
Page 29: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

CODE 5 ms

Wait (ms)

CODE

Wait

Loop Iterates

5 10 0

The Wait (ms) function will begin its count when the loop begins executing. The CODE will execute in 5 ms, and the loop will not continue until an additional 5 ms elapses.

Presenter
Presentation Notes
The Wait (ms) function will begin its count when the loop begins executing. The CODE will execute in 5 ms, and the loop will not continue until an additional 5 ms elapses. This is illustrated in the timeline graphic.
Page 30: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Wait Until Next ms Multiple

Waits for a multiple tick of the millisecond timer

• Performs function asynchronously • First loop iteration may be shorter than the specified ms multiple input

Presenter
Presentation Notes
The Wait (ms) function makes asynchronous system calls, but the nodes themselves function synchronously. Therefore, it does not complete execution until the specified time has elapsed.
Page 31: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Wait Until Next ms Multiple

CODE

Wait Loop Iterates

52 60 47

The Wait Until Next ms Multiple function will allow loop iteration on a millisecond multiple of the millisecond timer. The first loop iteration may be shorter than the specified ms input. In this case, when the loop starts, the millisecond timer has a value of 47. When the millisecond timer reaches a value of 60, the loop is allowed to iterate because • 60 is a multiple of 20 • The CODE has completed

Presenter
Presentation Notes
The Wait Until Next ms Multiple function will allow loop iteration on a millisecond multiple of the millisecond timer. The first loop iteration may be shorter than the specified ms input. The picture shows the following case: When the loop begins iterating, the millisecond timer has a value of 47. When the millisecond timer reaches a value of 60, the loop is allowed to iterate because: 60 is a multiple of 20 The CODE has completed
Page 32: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Wait Until Next ms Multiple

CODE

Wait Loop Iterates

20 40 0

In this case, when the loop starts, the millisecond timer has a value of 0. When the millisecond timer reaches a value of 20, the loop is not allowed to iterate because the CODE has not completed. Instead, the loop iterates at the next ms multiple, which is 40.

Presenter
Presentation Notes
The Wait Until Next ms Multiple function will allow loop iteration on a millisecond multiple of the millisecond timer, but only after the code has completed. The picture shows the following case: When the loop begins iterating, the millisecond timer has a value of 0. When the millisecond timer reaches a value of 20, the loop does not iterate because the CODE has not completed. When the ms timer reaches 40, the loop is allowed to iterate because: 40 is a multiple of 20 The CODE has completed
Page 33: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Tick Count (ms)

Tick Count (ms) returns the value of the Windows millisecond timer.

• Timer rolls over at 232-1 • Cannot be used to extract real-world date or time

• Useful for finding the duration of executing code

Page 34: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Get Date/Time In Seconds

Get Date/Time In Seconds returns a timestamp of the current time.

• Timestamp value is calculated using number of seconds elapsed since 12:00 AM, Jan 1, 1904, Universal Time.

• Do not use to calculate code execution duration

Page 35: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

VI Timing Types

• Execution Timing • Provides the design pattern with a function that specifically allows the

processor time to complete other tasks • In some cases, a Wait function is not necessary

• Use of Timeout inputs can provide execution timing

• Software Control Timing • Timing (pauses, waits, time checks) you put in place to make the code

execute after a certain amount of time.

• Example: If you must acquire data for 5 minutes, you could remain in the acquisition state until the 5 minutes elapses. However, during that time you cannot process any user interface actions such as stopping the VI. To process user interface actions, you must implement timing (checking if 5 min has passed since the start of acquisition) so that the VI continually executes for the specified time.

Presenter
Presentation Notes
Execution timing, in general, is something that releases the processor. This could be a timeout (we will see this later with event structure) or a wait function placed in a while loop. Allowing the processor to complete other tasks, may actually speed up your code, which is counterintuitive because it seems like adding a wait would slow down code. Software Control Timing is when you want the code to execute at/after certain amounts of time. For example, if you are controlling a car wash, you would want the soap cycle to be 1 min long and the rinse cycle to be 3 min long, then you will need to put in some timing code to ensure the time goals are met. Another example is you want to acquire data for 7.3 seconds, you will need to add code to make sure the acquisition doesn’t stop prematurely or last longer. In summary, you don’t want the code to simply execute as fast as it can, so you implement software control timing.
Page 36: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

VI Timing

Software Control Timing

Execution Timing

Presenter
Presentation Notes
The software control timing is checking to see if X amount of time has elapsed and then using a case structure so when enough time has elapsed (True) something other than checking the time again (false) will happen The wait in the upper corner of the while loop is allowing the processor to rest and complete other tasks before executing the next loop iteration.
Page 37: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Which timing function is the best choice for timing control logic in applications that run for extended periods of time? A. B. C. D.

Timing Functions

Presenter
Presentation Notes
C.
Page 38: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Which timing function is the best choice for timing control logic in applications that run for extended periods of time? A. B. C. D.

Timing Functions

Tick Count rolls over, so it is best for very short periods of time

Wait should be used for execution timing, not control timing.

Getting and storing the system time is the best way to measure elapsed time in applications that run for extended periods of time.

This function formats a time stamp; it is not used for VI timing.

Page 39: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

The Wait function can be added to While Loops: a. To free up available memory.

b. To allocate memory used by the CPU. c. To allow the processor time to complete other tasks. d. To reserve which processor the code is running on.

Timing Functions

Presenter
Presentation Notes
C.
Page 40: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

The Wait function can be added to While Loops: a. To free up available memory.

b. To allocate memory used by the CPU. c. To allow the processor time to complete other tasks. d. To reserve which processor the code is running on.

Timing Functions

By default, LabVIEW executes loops and block diagrams as quickly as possible, and it immediately begins running the next. You can use a Wait function in the loop to specify the amount of time in milliseconds before the loop re-executes. Timing a loop also allows the processor time to complete other tasks such as updating and responding to the user interface.

Presenter
Presentation Notes
C. Normally when a loop, such as a while loop, finishes executing one iteration, it immediately begins running the next. It is often beneficial to control how often a loop executes, or its frequency. For example, if you wanted to acquire data in a loop, you would need a method to control the frequency of the data acquisition. Timing a loop also allows the processor time to complete other tasks such as updating and responding to the user interface. In the following figures, the processor usage for a simple VI with a while loop running untimed and timed are shown. Timing a loop can drastically increase performance.
Page 41: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

• Access the properties of an object • Enable you to modify the appearance of front panel

objects programmatically in response to certain inputs. For example:

• If a user enters an invalid password, you might want a red LED to start blinking

• If a data point is above a certain value, you might want to show a red trace instead of a green one

• Execute from top to bottom • By default, if an error occurs on 3rd of 5 terminals, last two do

not execute and error is output

Presenter
Presentation Notes
Property nodes are how you access and manipulate properties of LabVIEW objects. To override default, right-click and select Ignore Errors Inside Node
Page 42: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

Implicit Property Node

1. Plot 0 is set active 2. Active plot (0)

changed to red 3. Plot 1 is set active 4. Active plot (1) is

changed to blue 5. Plot 2 is set active 6. Active plot (2)

changes name to “Data”

Explicit Property Node

(use when subVIs are involved)

•A property node can be implicit or explicit. •A property node executes top-down

Page 43: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Invoke Nodes

• Use the Invoke Node to perform actions, or methods, on referenced items (VI, Control)

• Most methods have parameters • Examples of VI Methods:

• Front Panel: Center • Default Values: Reinitialize all to Default • Print: VI to HTML

Method Name Parameters

Presenter
Presentation Notes
Invoke nodes are very similar to property nodes, except the access and manipulate methods instead of properties. Also, methods will have parameters
Page 44: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property and Invoke Nodes: Use Cases

• Property Nodes can be used to programmatically read from an indicator or write to a control

• Invoke Nodes can be used to programmatically control the state of a VI

Page 45: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Implicitly and Explicitly Linking Invoke/Property Nodes

Explicitly Linked (requires control reference)

Implicitly Linked (color/ label for data type/label)

Property Node

Invoke Node

Page 46: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

Which combination of words correctly completes the following statement? Unlike _____ Property Nodes, _____ Property Nodes require _____ as inputs in order to function correctly.

a. Explicit; Implicit; Data Value References b. Implicit; Explicit; Data Value References c. Explicit; Implicit; Control References d. Implicit; Explicit; Control References

Page 47: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

Which combination of words correctly completes the following statement? Unlike _____ Property Nodes, _____ Property Nodes require _____ as inputs in order to function correctly.

a. Explicit; Implicit; Data Value References b. Implicit; Explicit; Data Value References c. Explicit; Implicit; Control References d. Implicit; Explicit; Control References Implicit Property Nodes are explicitly linked to their owning

control or indicator. No reference wires are needed. Explicit Property Nodes require a reference wire to determine which control the Property Node is manipulating. Data Value References have nothing to do with Property

Page 48: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

Which plot will change color first?

a. Plot 1 because properties are executed top-down

b. Plot 0 because properties are implemented in numeric order starting at zero

c. Both plots will be updated simultaneously due to the multithreading of properties

d. It cannot be determined because LabVIEW performs operations in dataflow format

Presenter
Presentation Notes
A.
Page 49: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

Which plot will change color first?

a. Plot 1 because properties are executed top-down

b. Plot 0 because properties are implemented in numeric order starting at zero

c. Both plots will be updated simultaneously due to the multithreading of properties

d. It cannot be determined because LabVIEW performs operations in dataflow format

Page 50: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

Which of the following apply to Property Nodes? (More than one answer may apply.)

a. Property Nodes allow attributes of front panel objects to

be programmatically manipulated. b. Property Nodes can be used to update the values

contained in a front panel object. c. More than one Property Node can be used for a single

front panel object. d. Property Nodes can be used to programmatically

generate a Value Change event.

Page 51: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

Which of the following apply to Property Nodes? (More than one answer may apply.)

a. Property Nodes allow attributes of front panel objects to

be programmatically manipulated. b. Property Nodes can be used to update the values

contained in a front panel object. c. More than one Property Node can be used for a single

front panel object. d. Property Nodes can be used to programmatically

generate a Value Change event.

Page 52: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

What type of property node can you use to update a property from inside a subVI?

a. Implicit Property Node b. Local Property Node c. Explicit Property Node d. Value Property Node

Page 53: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Property Nodes

What type of property node can you use to update a property from inside a subVI?

a. Implicit Property Node b. Local Property Node c. Explicit Property Node d. Value Property Node

Page 54: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

Both •Accept various data types:

•Waveform •Dynamic •Arrays

•Waveform Data types contain: •An array of points •t0 •dt

Graphs •Do not accept single point values •All points are plotted at once

Charts

•Accept single point values •Values are stored in a buffer, then overwritten with new values •Points are plotted as data becomes available

Presenter
Presentation Notes
Discuss different types of charts: scope/sweep/strip?
Page 55: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

• A graph displays an entire waveform at once. • A chart displays single points as they are received. • An XY Graph displays individual (X,Y) pairs. • The graphs and chart below all display the same sine

wave data.

Presenter
Presentation Notes
This technique is typically used to create multi-plot charts which is discussed in more detail later.
Page 56: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

• Chart: • Remembers history – new point added to end of plot • Good for inside a loop

• Graph:

• New plot of all new data

• Good for outside the loop

• Use the Context Help window to determine how to wire multi-plot data to Waveform Graphs and XY Graphs

Presenter
Presentation Notes
Chart can be used outside a loop and Graphs can be used inside a loop. However, because of the update methods for charts and graphs, the are often used inside and outside loops, respectively. If you place a graph inside a loop and send a new data point to it, only that data point will be plotted- not the entire history of data. You would have to build an array with each loop iteration and send the entire array to the graph in order to see the historical data with each loop iteration. This is commonly overlooked by new LabVIEW users.
Page 57: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts vs. Graphs – Single-Plot

Chart is inside the loop and updates for each iteration.

Graph is outside the loop and only updates once: after the loop finishes

Page 58: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts vs. Graphs – Multi-plot and XY Graph

Presenter
Presentation Notes
The Bundle function is often used to create multi-chart plot charts and XY plots. The Build Array function is used to create multi-plot waveform graphs.
Page 59: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Chart Update Modes

• Right-click the chart and select Advanced»Update Mode from the shortcut menu

• Strip chart is the default update mode • Scope chart and Sweep chart modes display plots

significantly faster than the strip chart mode

Presenter
Presentation Notes
Strip chart – once the right side of the plot area is reached, the next point added causes the entire plot to shift to the left, as if it were scrolling Scope chart- once the right side of the plot area is reached, the next point added causes the plot to disappear and the new point is added to the far left side Sweep chart- once the right side of the plot area is reached, the next point added causes the plot to remain and the new point is added to the far left side- a red bar shows where new data is overwriting the old data a
Page 60: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

You need to add a graphical indicator to the location shown below. Which of the following is the best graphical indicator to use in this program?

A. Waveform Graph B. Waveform Chart C. Intensity Chart D. XY Graph

Page 61: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

You need to add a graphical indicator to the location shown below. Which of the following is the best graphical indicator to use in this program?

A. Waveform Graph B. Waveform Chart C. Intensity Chart D. XY Graph

Multiple Samples = Graph, not chart

Page 62: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

You need to add a graphical indicator to the location shown below. Which of the following is the best graphical indicator to use in this program?

A. Waveform Graph B. Waveform Chart C. Intensity Chart D. XY Graph

Data collected at constant rate (dt) = Waveform

Dynamic data

Page 63: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

You need to add a graphical indicator to the location shown below. Which of the following is the best graphical indicator to use in this program?

A. Waveform Graph B. Waveform Chart C. Intensity Chart D. XY Graph

Waveform Graph is the only choice that displays multiple points at once, and can display waveforms.

Page 64: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

Which of the following allows you to plot any set of points, evenly distributed or not?

a. Waveform Graph b. Waveform Chart c. XY Graph d. Both A. and C.

Page 65: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

Which of the following allows you to plot any set of points, evenly distributed or not?

a. Waveform Graph b. Waveform Chart c. XY Graph d. Both A. and C.

Waveform Graph plots only single-valued functions with points evenly distributed along the x-axis

Waveform Chart displays one or more plots of data typically acquired at a constant rate.

Page 66: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

Which of the following allows you to plot any set of points, evenly distributed or not?

a. Waveform Graph b. Waveform Chart c. XY Graph d. Both A. and C.

The XY graph is a general-purpose, Cartesian graphing object that plots multivalued functions, such as circular shapes or waveforms with a varying time base. The XY graph displays any set of points, evenly sampled or not.

Waveform Graph plots only single-valued functions with points evenly distributed along the x-axis

Waveform Chart displays one or more plots of data typically acquired at a constant rate.

Page 67: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

Which of the following will allow you to have multiple plots on a Waveform Graph?

a. Bundle two 1D arrays of X and Y data together for each plot. Then build an array of these clusters and wire it to the Waveform Graph indicator.

b. Build an n-dimensional array of data with each plot in a separate row (or column) in the array, then wire the array to the Waveform Graph indicator.

c. Bundle the elements of each waveform into a cluster and build an array of these clusters, then wire the array to the Waveform Graph indicator.

d. Both B. and C.

Page 68: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Charts and Graphs

Which of the following will allow you to have multiple plots on a Waveform Graph?

a. Bundle two 1D arrays of X and Y data together for each plot. Then build an array of these clusters and wire it to the Waveform Graph indicator.

b. Build an n-dimensional array of data with each plot in a separate row (or column) in the array, then wire the array to the Waveform Graph indicator.

c. Bundle the elements of each waveform into a cluster and build an array of these clusters, then wire the array to the Waveform Graph indicator.

d. Both B. and C.

Page 69: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Arrays: the index The index (zero-based) tells you :

• the dimension of the array (1D, 2D, 3D, etc.) • the index of the element displayed in the upper left corner

o - the 1D array below is displaying index 1 to contain a value of 3.00; we do not know the value of index 0 from this image because the value at index 0 is hidden from view

1D Array (initialized) 2D Array (uninitialized)

index

TIP: drag the edge of the index to add another dimension to an array

(row)

(column)

Presenter
Presentation Notes
To add dimensions to an array one at a time, right-click the index display and select Add Dimension from the shortcut menu. You also can use the Positioning tool to resize the index display until you have as many dimensions as you want. The index display tells you the index (location) of the element that is currently displayed in the box in the upper right-hand corner of the array. Imagine the border of the array like a window into a giant speadsheet of numbers, where the spreadsheet can slide around behind the window. The index will tell you how much the spread sheet has slid around from its home position, where the window shows the top left corner of the spreadsheet values. Therefore, the 1D array is hiding index 0 and possibly other values at index 3 or more. The index is zero-based, meaning it begins it counting with zero. Uninitialized arrays will have a gray background and grayed-out numbers. If you have a value at index 1,1 in an array (which would be a 2x2 array), then column 3 will be uninitialized and all columns less than 3 (0,1,2) must be initialized . Keep in mind an array is defined to be a 2x2 by the number of rows/columns that are initialized, not just the number of columns and rows being displayed through the “array window”.
Page 70: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Arrays : Auto-indexing • If you wire an array to or from a For Loop or While Loop, you

can link each iteration of the loop to an element in that array by enabling auto-indexing on tunnel

• The tunnel changes from a solid square to the image shown below to indicate auto-indexing

• You can disable auto-indexing by right clicking on the tunnel and choosing the Disable Indexing option.

Auto-indexing tunnel

Page 71: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions

•1 type of data per array- cannot have an array of arrays. •Up to (2³¹-1) elements per dimension •Auto-indexing For Loops link each iteration with an element of the array •For Data Acquisition:

•Rows: Channels •Columns: Data

Page 72: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions Describe the array that results from running this code. A. A 1D Array with 10 rows

B. A 2D Array with 4 rows and 6 columns

C. A 2D Array with 6 rows and 4 columns

D. A 1D Array with 10 columns

Page 73: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions Describe the array that results from running this code. A. A 1D Array with 10 rows

B. A 2D Array with 4 rows and 6 columns

C. A 2D Array with 6 rows and 4 columns

D. A 1D Array with 10 columns

Eliminate these choices because:

Two loops means a 2D

array.

Scalar 2D 1D

Page 74: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions Describe the array that results from running this code. A. A 1D Array with 10 rows

B. A 2D Array with 4 rows and 6 columns

C. A 2D Array with 6 rows and 4 columns

D. A 1D Array with 10 columns

When building arrays in nested For loops, the outside loop will always correspond to the rows of the array.

Page 75: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions

What is the result of the following Array addition?

A. A 1- D array of {6, 8, 10} B. A 1-D array of {6, 8, 10, 4, 5} C. A 2-D array of {{5, 6, 7}, {1, 2, 3, 4, 5}} D. A 2-D array of {{6, 8, 10}, {4, 5}}

Page 76: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions

What is the result of the following Array addition?

A. A 1- D array of {6, 8, 10} B. A 1-D array of {6, 8, 10, 4, 5} C. A 2-D array of {{5, 6, 7}, {1, 2, 3, 4, 5}} D. A 2-D array of {{6, 8, 10}, {4, 5}}

These are not valid arrays- the row sizes are not the same

Page 77: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions

What is the result of the following Array addition?

A. A 1- D array of {6, 8, 10} B. A 1-D array of {6, 8, 10, 4, 5} C. A 2-D array of {{5, 6, 7}, {1, 2, 3, 4, 5}} D. A 2-D array of {{6, 8, 10}, {4, 5}}

When performing array arithmetic, the output array is the same size as the smaller input array.

Page 78: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions What is the output of the Build Array function in the following block diagram when the Concatenate Inputs is selected?

A. 1- D array of {1, -4, 3, 7, -2, 6} B. 1-D array of {1, 7, -4, -2, 3, 6} C. 2-D array of {{1, -4, 3, 0}, {7, -2, 6}} D. 2-D array of {{1, -4, 3}, {7, -2, 6}}

Page 79: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions What is the output of the Build Array function in the following block diagram when the Concatenate Inputs is selected?

A. 1- D array of {1, -4, 3, 7, -2, 6} B. 1-D array of {1, 7, -4, -2, 3, 6} C. 2-D array of {{1, -4, 3, 0}, {7, -2, 6}} D. 2-D array of {{1, -4, 3}, {7, -2, 6}}

Build Array function concatenates multiple arrays or appends elements to an n-dimensional array. With Concatenate Inputs selected, it appends all inputs in order, forming an output array of the same dimensionality as the highest-dimension array input wired.

Page 80: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions What is the output of the Initialize Array function after the following code has executed?

A. 1- D array of {3, 3, 3, 3} B. 1-D array of {4, 4, 4} C. 2-D array of {3, 4} D. 2-D array of {4, 3}

Page 81: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Array Functions What is the output of the Initialize Array function after the following code has executed?

A. 1- D array of {3, 3, 3, 3} B. 1-D array of {4, 4, 4} C. 2-D array of {3, 4} D. 2-D array of {4, 3}

Inivitalze Array function creates an n-dimensional array (4) in which every element is initialized to the value of element (3).

Page 82: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Mechanical Action of Booleans • Behavior of Boolean

controls is specified by the mechanical action.

• Use the Properties dialog to investigate the different mechanical actions. Explanation and

diagram

Push the button to see the behavior

•Button Position

•“Voltage” at LED

•Circuit Diagram Symbol

How to Read the Diagram

Place Boolean on Front Panel, Open the Boolean Properties

1

2

3

Page 83: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Mechanical Actions of Boolean Objects

• Switch when pressed (light switch)

• Switch when released (mouse)

• Switch until released (door buzzer)

• Latch when pressed (circuit breaker)

• Latch when released (dialog box)

• Latch until released

Presenter
Presentation Notes
Play with the example VI : Mechanical Action of Booleans (search mechanical in the LV Example Finder, go to Help >>Find Examples) Switch when pressed—Changes the control value each time you click it with the Operating tool, similar to a light switch. This behavior is not affected by how often the VI reads the control. Switch when released—Changes the control value only after you release the mouse button during a mouse click within the graphical boundary of the control. This behavior is not affected by how often the VI reads the control. Switch until released—Changes the control value when you click it and retains the new value until you release the mouse button. At this time, the control reverts to its default value, similar to the operation of a door buzzer. This behavior is not affected by how often the VI reads the control. You cannot select this behavior for a radio buttons control. Latch when pressed—Changes the control value when you click it and retains the new value until the VI reads it once. At this point, the control reverts to its default value even if you keep pressing the mouse button. This behavior is similar to a circuit breaker and is useful for stopping a While Loop or for getting the VI to perform an action only once each time you set the control. You cannot select this behavior for a radio buttons control. Latch when released—Changes the control value only after you release the mouse button within the graphical boundary of the control. When the VI reads it once, the control reverts to its default value. This behavior works in the same manner as dialog box buttons and system buttons. You cannot select this behavior for a radio buttons control. Latch until released—Changes the control value when you click it and retains the value until the VI reads it once or you release the mouse button, depending on which one occurs last. You cannot select this behavior for a radio buttons control.
Page 84: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

DEMONSTRATION

Mechanical Action of Booleans

Open NI Example Finder, select the Mechanical Action of Booleans.vi. Browse by Task, Buiding User Interfaces» General» Mechanical Action of Booleans.vi.

Presenter
Presentation Notes
Have all students drop a Boolean control. Right-click the control to bring up the Properties dialog box. Switch to Operations tab. Have students experiment with different mechanical actions as you demonstrate.
Page 85: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Mechanical Action

Which category of mechanical action is guaranteed to be read at least once by LabVIEW?

A. Switch B. Latch C. Boolean D. All mechanical actions are read at least once

Presenter
Presentation Notes
B
Page 86: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Mechanical Action

Which category of mechanical action is guaranteed to be read at least once by LabVIEW?

A. Switch B. Latch C. Boolean D. All mechanical actions are read at least once

A switch can change value without being read, and “Boolean” is not a mechanical action.

Presenter
Presentation Notes
If switch mechanical actions are changed rapidly, they could be missed by LabVIEW.
Page 87: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Mechanical Action

A button is pressed once and immediately turns on the light of a dark room. The light stays on after the button is released. What is the mechanical action of the button?

A. Switch when pressed B. Switch when released C. Switched until released D. Latch when pressed E. Latch when released F. Latch until released

Presenter
Presentation Notes
A
Page 88: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Mechanical Action

A button is pressed once and immediately turns on the light of a dark room. The light stays on after the button is released. What is the mechanical action of the button?

A. Switch when pressed B. Switch when released C. Switched until released D. Latch when pressed E. Latch when released F. Latch until released

The light stays on after the button is released, so this is not a latching action, or switched until released, which would only turn the light on while the button is being pressed.

Presenter
Presentation Notes
A
Page 89: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Mechanical Action

A button is pressed once and immediately turns on the light of a dark room. The light stays on after the button is released. What is the mechanical action of the button?

A. Switch when pressed B. Switch when released C. Switched until released D. Latch when pressed E. Latch when released F. Latch until released

The key word is “immediately.” The light comes on before the button is released.

Presenter
Presentation Notes
The light switches immediately and stays on until it is pressed again.
Page 90: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Representation: Numeric Range

Terminal Type Disk Storage Size

Number of Decimal Digits

Approximate Range

Double 64 bits 15 -1.8 x 10308 to 1.8 x 10308

Signed 8-bit Integer

8 bits 2 -128 to 127

Unsigned 8-bit Integer

8 bits 2 0 to 255

Unsigned 32-bit Integer

32 bits 9 0 to 4,294,967,295

• Data representation affects how large or small of a number can be stored.

• A few common data types are listed here—for more types, see the LabVIEW Help

Page 91: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Representation: Storage Space

• Data representation is important when disk space or memory usage is a concern:

• Larger types require more space (U32 requires 4x the memory of U8)

• Signed types require more space than unsigned (I32 uses more space than U32)

• Boolean types require one U8 of space each. Consider using a single U8 to represent eight Boolean values if several Booleans must be stored.

Page 92: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

You need to store an integer which will only ever be between 1 and 10. Which of these would be the best choice?

A. U32 B. I8 C. DBL D. U8

Data Representation: Storage Space

Page 93: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

You need to store an integer which will only ever be between 1 and 10. Which of these would be the best choice?

A. U32 B. I8 C. DBL D. U8

The U8 representation can store numbers ranging from 0 to 2^8 -1, or 0-255

Data Representation: Storage Space

Page 94: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Which of these allows storing decimal numbers such as 1.3 or 2.55?

A. U32 B. I8 C. DBL D. U8

Data Representation: Storage Space

Page 95: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Which of these allows storing decimal numbers such as 1.3 or 2.55?

A. U32 B. I8 C. DBL D. U8

Data Representation: Storage Space

DBL is the only data type listed that can store non-integer numbers.

Page 96: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Waveform Data Type

• The Waveform data type is a cluster. • Carries the data, start time, and dt of a waveform. • Get Waveform Components function is very similar to Unbundle

By Name

Presenter
Presentation Notes
This technique is typically used to create multi-plot charts which is discussed in more detail later.
Page 97: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Waveform Data Type

• Build Waveform function creates a waveform from its components

• Similar to Bundle By Name

Presenter
Presentation Notes
This technique is typically used to create multi-plot charts which is discussed in more detail later.
Page 98: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Waveform Data Type

• Some indicators can display waveform data directly. • Waveform Graph

Presenter
Presentation Notes
This technique is typically used to create multi-plot charts which is discussed in more detail later.
Page 99: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

1. Which of these is the Waveform data type most similar to?

A. String B. Numeric Array C. Cluster D. Timestamp

Waveform Data Type

Presenter
Presentation Notes
C
Page 100: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

1. Which of these is the Waveform data type most similar to?

A. String B. Numeric Array C. Cluster D. Timestamp

Although a waveform contains some of these other types, the

Waveform type as a whole is very similar to a cluster.

Waveform Data Type

Page 101: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Flat Sequence Structure

Executes each frame beginning with the left-most frame and ending with the right-most frame

The previous frame must complete before the next frame executes

Data can be passed out of or between frames using tunnels

Once the sequence begins, it cannot be stopped

1st 2nd 3rd

Presenter
Presentation Notes
A sequence structure contains one or more subdiagrams, or frames, that execute in sequential order. Within each frame of a sequence structure, as in the rest of the block diagram, data dependency determines the execution order of nodes. Sequence structures are not used commonly in LabVIEW. Use the sequence structures to control the execution order when natural data dependency does not exist and flow-through parameters are not available. Flat Sequence Structure Use the Flat Sequence structure to avoid using sequence locals and to better document the block diagram. When you add or delete frames in a Flat Sequence structure, the structure resizes automatically. Each frame will send its outputs on the completion of that frame (this is different than the stacked sequence structure). The outputs may go to the next frame or external to the sequence structure. The sequence structure cannot be stopped in the middle, which is why it is not often used.
Page 102: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Stacked Sequence Structure

• Executes frame 0, then frame 1, etc. until the last frame executes

• Returns data only after the last frame executes

• To transfer data from frame to frame, a Sequence Local must be created (right-click » Add Sequence Local)

• Once the sequence begins, it cannot be stopped

Sequence Local

Presenter
Presentation Notes
To convert a Flat Sequence structure to a Stacked Sequence structure, right-click the Flat Sequence structure and select Replace with Stacked Sequence from the shortcut menu. If you change a Flat Sequence to a Stacked Sequence and then back to a Flat Sequence, LabVIEW moves all input terminals to the first frame of the sequence. The final Flat Sequence should operate the same as the Stacked Sequence. After you change the Stacked Sequence to a Flat Sequence with all input terminals on the first frame, you can move wires to where they were located in the original Flat Sequence. Stacked Sequence Structure The Stacked Sequence structure returns data only after the last frame executes. Use the Stacked Sequence structure if you want to conserve space on the block diagram. To convert a Stacked Sequence structure to a Flat Sequence structure, right-click the Stacked Sequence structure and select Replace»Replace with Flat Sequence from the shortcut menu. The sequence selector identifier, shown as follows, at the top of the Stacked Sequence structure contains the current frame number and range of frames.
Page 103: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

What purpose do sequence locals have in a stacked sequence structure?

A. Provide reentrancy for the sequence structure B. Transfer data between frames C. Set values of local variables in the calling VI D. Transfer data out of the sequence between frames

Stacked Sequence Structure

Presenter
Presentation Notes
Transfer data between frames. A. is irrelevant. D. is impossible because the stacked sequence does not return data until the last frame executes. C. is also not possible because of the previous reason.
Page 104: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

What purpose do sequence locals have in a stacked sequence structure?

A. Provide reentrancy for the sequence structure B. Transfer data between frames C. Set values of local variables in the calling VI D. Transfer data out of the sequence between frames

Stacked Sequence Structure

Stacked sequence structures do not return their outputs until the final frame has executed. Use sequence locals to transfer data between subsequent frames.

Presenter
Presentation Notes
Transfer data between frames. A. is irrelevant. D. is impossible because the stacked sequence does not return data until the last frame executes. C. is also not possible because of the previous reason.
Page 105: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Case Structures

Identify the components of a case structure

A. Case Selector Terminal B. Case Selector Label C. Subdiagram (Case)

Page 106: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Case Structures

Identify the components of a case structure

• Case Selector Label (1)

• Subdiagram (Case) (2)

• Case Selector Terminal (3)

Page 107: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Case Structures Assuming the pictured Case Structure, which of the following could result in a broken run arrow?

A. Numeric input has a value of 6 and there is no case for 6. B. The empty string inside the case is deleted and the resulting broken wire inside the case is removed. C. The wire between numeric input and the case selector is removed D. A new input is wired into the case selector, but is left unused in one of the cases

Page 108: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Case Structures Assuming the pictured Case Structure, which of the following could result in a broken run arrow?

A. Numeric input has a value of 6 and there is no case for 6. B. The empty string inside the case is deleted and the resulting broken wire inside the case is removed. C. The wire between numeric input and the case selector is removed D. A new input is wired into the case selector, but is left unused in one of the cases

Presenter
Presentation Notes
A. The case for 5 will execute because it is default B. We need to have all outputs wired (unless Use Default If Unwired is selected) C. We need to tell the case structure which case to execute D. Inputs are available for every case, but are not required to be used.
Page 109: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Event Structures

An Event structure works like a Case structure with a built-in Wait on Notification function.

Event Source Event

Code executes only when event occurs.

A case executes every time the loop iterates.

Page 110: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Event Structure

• Event Structure — LabVIEW’s programmatic tool for handling events.

• Specialized type of Case Structure • Execution of code can be dependent on whether or not

an event has occurred

• Waits for an event to occur indefinitely, unless configured to timeout.

Presenter
Presentation Notes
When something happens (a button press, your mouse hovering over a particular region, pressing a key on the keyboard, clicking the mouse – examples of default events) an “event” is fired. This event can be “caught” and “handled” by an Event Structure. Therefore, when an event occurs (such as a mouse down on the Numeric as shown in the event selector label in this slide), the code inside the structure will execute (this slide’s example does not have any code to execute yet)
Page 111: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Event Structures

When the user clicks the Button control, how many times is the Increment function called?

a. 0 b. 1 c. 2 d. 3

Page 112: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Event Structures

When the user clicks the Button control, how many times is the Increment function called?

a. 0 b. 1 c. 2 d. 3

Because a Mouse Down event occurs on both the Button and the Pane, 2 events are registered. The code executes twice.

Page 113: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Block diagram execution is dependent on the flow of data

Block diagram does NOT execute left to right

Node executes when data is available to ALL input terminals

Nodes supply data to all output terminals when done

If the computer running this code had multiple processors, these two pieces of code could run independently without additional coding

Presenter
Presentation Notes
It is good LV programming practice to have your program go from left to right, but data flow is not dependent on location of terminals or nodes on the block diagram. Node executes when data is available to ALL input terminals Nodes supply data to ALL output terminals when done (not before) - this includes loops! – a loop must completely finish all iterations before data will be passed out of its output tunnels. Data flow being dependent on these two major rules allows independent sections of code to operate in parallel
Page 114: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Race Conditions: Sequencing

• What is the final value? Four possible outcomes:

• Value = (Value * 5) +2 • Value = (Value + 2) * 5 • Value = Value * 5 • Value = Value +2

Presenter
Presentation Notes
Because the multiple and add functions do not have a wire forcing one to operate before the other according to LabVIEW data flow, the value in Value may be very different depending on the order of execution. For example, let’s say the Add goes first and Value has a default value of 0. 0+2 = 2. Then the multiple executes. 2*5=10. Let’s compare with the multiply executing first: 0*5 =0. 0+2 = 2. Clearly, 2 and 10 are not the same value and this code could produce both answers. This is a situation in which using wires instead of variable will guarantee consistent results.
Page 115: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Breaking Data Flow

Solution: Use a Local Variable Drawbacks: Introduces a Possible Race Condition

Wiring the Stop Button from one Loop to the other will NOT work.

Situation: Run 2 Loops simultaneously with 1 Stop Button

Local Variable referencing the Stop Button

Page 116: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Breaking Data Flow Name Appearance Function Drawbacks

Wire Connects data at different terminals

Must follow Data Flow

Local Variable Allows a value to be accessed anywhere in a single VI

Introduces the possibility of a race condition

Global Variable Allows a value to be accessed in any VI

Introduces the possibility of a race condition

Functional Global Variable

•Non-reentrant VI •Allows a value to be accessed in any VI •Removes possibility of a race condition •Allows actions to be performed on data

Page 117: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Breaking Data Flow – Functional Global Variable

This Functional Global Variable allows you to get the elapsed time since the last time you called the subVI.

Page 118: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Breaking Data Flow - Queues

Queues ensure no data is lost when it is transferred between loops running at different rates.

Page 119: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Which of the following does not conform to the Dataflow programming paradigm? a. Shift Registers b. Tunnels c. SubVIs d. Local variables

Page 120: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Which of the following does not conform to the Dataflow programming paradigm? a. Shift Registers b. Tunnels c. SubVIs d. Local variables

Local variables do not conform to the Dataflow paradigm because they communicate by reference, not by value. The basic premise of local variables is to allow transfer of data where it is impossible to use wires. This circumvents the Dataflow paradigm.

Page 121: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Which variable is commonly used to eliminate race conditions by preventing simultaneous access to code or data?

a. Functional global variable b. Local variable c. Global variable d. Shared variable

Page 122: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Which variable is commonly used to eliminate race conditions by preventing simultaneous access to code or data?

a. Functional global variable b. Local variable c. Global variable d. Shared variable

You can place critical data or sections of code in functional global variables. Since functional global variables are non-reentrant VIs, the possibility of race conditions is eliminated.

Page 123: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Which data synchronization mechanism ensures that no data is lost when an application temporarily provides data faster than it is able to process it?

a. Notifier b. Queue c. Semaphore d. Local Variable

Page 124: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Which data synchronization mechanism ensures that no data is lost when an application temporarily provides data faster than it is able to process it?

a. Notifier b. Queue c. Semaphore d. Local Variable

Semaphores cannot pass data.

Notifiers pass data, but they can only pass one element at a time. Data is overwritten and lost if the program writes to the notifier twice before data is read.

Local variables have no mechanism for determining when data is updated, so there is no way to tell if data is newly-acquired or not.

Page 125: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Data Flow

Which data synchronization mechanism ensures that no data is lost when an application temporarily provides data faster than it is able to process it?

a. Notifier b. Queue c. Semaphore d. Local Variable

Queues support multiple elements and operate using a FIFO principle, guaranteeing that no data is lost or overwritten.

Semaphores cannot pass data.

Notifiers pass data, but they can only pass one element at a time. Data is overwritten and lost if the program writes to the notifier twice before data is read.

Local variables have no mechanism for determining when data is updated, so there is no way to tell if data is newly-acquired or not.

Page 126: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

String Functions Format Into String • Formats an input into a string • Uses generic format string to

specify output • See detailed help for tips on the

Format String syntax.

String Controls and Constants

• When possible, use the constants included in the string palette instead of typing in a string constant.

Concatenate Strings • Combines two or more strings

Page 127: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Format Date/Time String

• Formats a time stamp or numeric value into a string • Uses the time format string to specify the date/time

string output • Example:

For a January 15, 2020 time stamp input and %m-%d-%Y time format string input, the function returns a date/time string: 01-15-2020

Page 128: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Flatten To / Unflatten From String

These functions flatten or unflatten LabVIEW data to or from binary strings which contain the flattened data.

Unflatten from string: • Interprets a binary string as

the specified data type • Requires a data type

template such as a numeric constant

Flatten to string: • Takes any input data and

flattens it to a single string. • Useful for transferring data to

external programs

Page 129: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

String Functions What is displayed in “String Indicator” after running this code? A. Loop0 Loop1 Loop2 B. Loop 1 Loop 2 Loop 3 C. Loop 0 Loop 1 Loop 2 D. Loop 0 Loop 1 Loop 2

Page 130: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

String Functions What is displayed in “String Indicator” after running this code? A. Loop0 Loop1 Loop2 B. Loop 1 Loop 2 Loop 3 C. Loop 0 Loop 1 Loop 2 D. Loop 0 Loop 1 Loop 2

The iteration terminal is zero-indexed, and each iteration generates a string with an EOL constant, so the correct answer must have three lines.

Page 131: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

String Functions You want to export data from LabVIEW into another environment, but

the other environment does not recognize LabVIEW data types. You should:

A. Export the data using a property node. B. Unflatten the data from a binary string and send it to the other

environment. C. Create a LabVIEW user event to transport the data. D. Flatten the data to a binary string and send it to the other

environment.

Presenter
Presentation Notes
D. Flatten the data to a binary string and send it to the other environment.
Page 132: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

String Functions

You want to export data from LabVIEW into another environment, but the other environment does not recognize LabVIEW data types. You should:

A. Export the data using a property node. B. Unflatten the data from a binary string and send it to the other

environment. C. Create a LabVIEW user event to transport the data. D. Flatten the data to a binary string and send it to the other

environment.

Strings are widely usable. Oftentimes you will be able to bring your data into another programming environment as a string, parse the string, and consume the data.

Page 133: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Clusters

• Clusters group data elements of mixed types.

• Clusters are similar to a record or a struct in text-based programming languages.

Presenter
Presentation Notes
Additional items to mention: Bundling several data elements into clusters eliminates wire clutter on the block diagram and reduces inputs and outputs for subVIs. Most clusters on the block diagram have a pink wire and data type terminal. Clusters of numeric values, sometimes referred to as points, have a brown wire and data type terminal. You can wire brown numeric clusters to Numeric functions to perform the same operation simultaneously on all elements of the cluster.
Page 134: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Why Use Clusters?

• Keep data organized. o Logically group related data values together. o Improve diagram readability by eliminating wire clutter.

• Reduce the number of connector pane terminals.

Page 135: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Cluster

Clusters provide a user with which of the following benefits?

a. Clusters allow a logical grouping of related data elements. b. Clusters increase the number of Connector Pane terminals of

SubVI’s. c. Clusters help to reduce wire clutter on the Block Diagram. d. Both A. and C.

Page 136: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Cluster

Clusters provide a user with which of the following benefits?

a. Clusters allow a logical grouping of related data elements. b. Clusters increase the number of Connector Pane terminals of

SubVI’s. c. Clusters help to reduce wire clutter on the Block Diagram. d. Both A. and C.

Presenter
Presentation Notes
A.
Page 137: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Clusters vs. Arrays

• Clusters are a fixed size.

• Clusters can contain mixed data types.

• Clusters can be a control, an indicator, or a constant.

oAll elements have to be controls, indicators, or constants.

• Arrays vary in size. • Arrays contain only

one data type. • Arrays can be a

control, an indicator, or a constant.

Page 138: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Custom Controls & Type Definitions

• Control • No connection

between the one you saved and the instance in the VI

• Update the file, but the instances are not updated

• Type Def • Connection between

the saved file and all instances

• Forces the data type of each instance to be identical (clusters, enum)

• Changes made to file will populate throughout each instance

Strict Type Def •Connection between saved file and all instances

•Forces everything about an instance to be identical to the strict type definition, except:

•label •description •default value

*.ctl

*.ctl

*.ctl

Presenter
Presentation Notes
A custom control, type def or strict type def all create a *.ctl file, which stores the customizations you make to a front panel control. The thing that is special about type defs and strict type defs is that every instance of that control you use on your block diagram is linked to the *.ctl and will update if you make changes to the file. The purpose of a *.ctl file saved as a Custom Control is to prevent you from going through the potentially lengthy process of creating it again- the file provides easy access to create another. The purpose of a type def is to make sure that the data type is consistent (including the item list for an enum- which is particularly helpful when building state machines) for each instance. Strict typ defs are just that, strict. Everything must be the same (most noticeable is cosmetic changes –size of LED, color, etc). To be able to tell them apart, the label should be different (labels should always be unique and descriptive). Descriptions can be different because they might serve slightly different purposes (LED indicating different warnings in a system – you would want to be able to describe which LED represents which process more than just using the label). Last, the default value can be different. Everything else is the same.
Page 139: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Controls and Type Definitions

You customize a control, select Control from theType Def. Status pull-down menu, and save the control as a .ctl file.

You then use an instance of the custom control on your front panel window. If you open the.ctl file and modify the control, does the control on the front panel window change?

a. Yes b. No

Presenter
Presentation Notes
A. The case for 5 will execute because it is default B. We need to have all outputs wired (unless Use Default If Unwired is selected) C. We need to tell the case structure which case to execute D. Inputs are available for every case, but are not required to be used.
Page 140: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Controls and Type Definitions

You customize a control, select Control from theType Def. Status pull-down menu, and save the control as a .ctl file.

You then use an instance of the custom control on your front panel window. If you open the.ctl file and modify the control, does the control on the front panel window change?

a. Yes b. No

A custom control is used to create controls that behave like existing controls but look different. Instances are not linked to a.ctl file.

A type definition control (type def) is used for changing all

instances of a linked control in a single edit.

Presenter
Presentation Notes
A. The case for 5 will execute because it is default B. We need to have all outputs wired (unless Use Default If Unwired is selected) C. We need to tell the case structure which case to execute D. Inputs are available for every case, but are not required to be used.
Page 141: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Control References

• A control reference is a reference to a front panel object.

• Wire control references to generic Property Nodes.

• Pass control references to subVIs.

Page 142: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Control References

Control references allow you to manipulate controls located on the front panel of VIs loaded in memory.

• Strictly typed control refnums – accept only control refnums of exactly the same data type

• Weakly typed control refnums - accept references to any DigNum control

Presenter
Presentation Notes
Weakly typed control references do not contain data type information. Ex: DigNum control class can be DBL, U32, and so on, and a weakly typed control can accept references to any DigNum control. Strictly typed control references only accept one data type. Ex: DigNum (strict) which references U32 data type DigNum controls, can only accept references to U32 DigNum controls. Strictly typed control refnums accept only control refnums of exactly the same data type. For example, if the type of a strictly typed control refnum is 32-bit integer slide, you can wire only a 32-bit integer slide to the control refnum terminal. You cannot wire an 8-bit integer slide, a double-precision scalar slide, or a cluster of 32-bit integer slides to the control refnum terminal. Control references created using the Create SubVI tool are strictly typed by default. To convert to a weakly typed reference, right-click on the refnum and uncheck the Include Data Type item in the shortcut menu.
Page 143: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Control References

SubVI Front Panel SubVI Block Diagram

Ctl Refnum

Control Reference

Presenter
Presentation Notes
On the previous slides, you showed creating the SubVI using Edit>>Create SubVI. Now, talk about manually creating the subVI, by creating the control reference in the main VI, and placing a control refnum in the SubVI, wired to a generic property node. In the next slide, you will talk about choosing the class in the control refnum.
Page 144: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Control References

Why would you want to use a weakly typed control refnum as a subVI input when wiring your connector pane?

A. To ensure only controls of one data type can be used as the input. B. You want to make your subVI capable of manipulating controls

with varying data types. C. You want to be able to manipulate many controls at once. D. It is best practice to avoid strictly typed control refnums in subVIs.

Presenter
Presentation Notes
B. You want to make your subVI capable of manipulating controls with varying data types.
Page 145: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Control References

Why would you want to use a weakly typed control refnum as a subVI input when wiring your connector pane?

A. To ensure only controls of one data type can be used as the input. B. You want to make your subVI capable of manipulating controls

with varying data types. C. You want to be able to manipulate many controls at once. D. It is best practice to avoid strictly typed control refnums in subVIs.

Weakly typed refnums do not retain information about the data type of the control they reference. This allows you to specify a particular class of control as an input while allowing that control to have multiple representations. Data values will become variant in weakly typed refnums to account for this flexibility.

Page 146: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Supplemental Concepts

Presenter
Presentation Notes
The topics in this section are either less commonly missed or less frequently seen on the CLAD exam. This can be used as additional prep if the materials in the previous section have been mastered.
Page 147: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Enumeration

• An enum represents a pair of values, a string and a numeric, where the enum’s value is one of a defined list of value pairs

• Appears as a string to you, and a number to computer

Presenter
Presentation Notes
An enum (short for enumeration) is a data type that pairs a number with a string (ie, months of the year with the number 0-11). The list of pairings is maintained as part of the data type (this is important when it comes to type definitions and is different from a ring, which looks similar)
Page 148: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Conditional Disable Structure

• Use to define conditions that indicate which code on the block diagram executes

• Examples: • If running as an executable, then programmatically close

LabVIEW when VI finishes • If running on Windows, look for file here; if running on Mac OSX

then look here.

Presenter
Presentation Notes
Use the Conditional Disable structure to define conditions that indicate which code on the block diagram executes. Conditional Disable Structure The Conditional Disable structure, shown as follows, has one or more subdiagrams, or cases, exactly one of which LabVIEW uses for the duration of execution, depending on the configuration of the conditions of the subdiagram. When compiling, LabVIEW does not include any code in the inactive subdiagrams of the Conditional Disable structure. Note LabVIEW does check the syntax of code in inactive subdiagrams. However, broken code within the inactive subdiagrams does not prevent the VI from compiling and executing. Use the Conditional Disable structure to define conditions in which specific code compiles and executes. For example, if one section of the VI is target-specific, you can put this code in a Conditional Disable structure and configure it to run on the specific target. Targets you might configure a Conditional Disable structure for include Windows, Mac, Unix systems and FPGA targets.
Page 149: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Notify Events (green arrow) User action has already occurred

Filter Events (red arrow) User performed action but event is not

processed. Allows you to customize event handling.

Notify and Filter Events in Config. Window

Presenter
Presentation Notes
Notify and Filter Events Filter events have names that end with a question mark, such as Panel Close?, to help you distinguish them from notify events. Most filter events have an associated notify event of the same name, but without the question mark, which LabVIEW generates after the filter event if no event case discarded the event.
Page 150: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Notify Events (green arrow) User action has already occurred

Filter Events (red arrow) User performed action but event is not

processed. Allows you to customize event handling.

Notify and Filter Events in Config. Window

Presenter
Presentation Notes
Notify and Filter Events Filter events have names that end with a question mark, such as Panel Close?, to help you distinguish them from notify events. Most filter events have an associated notify event of the same name, but without the question mark, which LabVIEW generates after the filter event if no event case discarded the event.
Page 151: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Multiple Loop Design Pattern

• Producer/Consumer

Presenter
Presentation Notes
One type of parallel loop design patterns is the Producer/Consumer. The producer will retrieve data – producing it for use in the VI. It will also be tasked with transferring the data/information to the consumer loop, which will process the data. Often, processing may take longer than desired especially if you are acquiring/collecting data at fast rates. By implementing the producer/consumer design patter, you can have the data acquisition and the processing occur at different rates because they are happening in different loops. We will discuss methods of transferring data from the producer to the consumer in the next few slides.
Page 152: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Multiple Loop Design Pattern

• Master/Slave: a type of Producer/Consumer

• uses notifiers to allow loops to run at different rates

Presenter
Presentation Notes
The master/slave design pattern is a type of producer/consumer. It typically uses something called notifiers to communicate between loops. Notifiers send a flag/flair/notice when the Send Notification function executes. The Wait on Notification function (seen in the consumer loop before the case structure) waits for that notification. The Wait on Notification knows which notification to look for because of the reference input. Once the notification is received, the Wait on Notification VI sends its outputs and the rest of the code in the loop can execute according to data flow. On the next consumer loop iteration, the Wait on Notification will begin waiting once again (because it is inside the loop) until there is another notification. Notifiers are designed to have only one notification holding spot. In other words, the size of the memory buffer (temporary memory space) is 1. Therefore, if another notification is sent, it will OVERWRITE the previous notification. As a result, the notification will always have the most current data available. It is possible to send data with the notification. The data type of the data must be set at the Obtain Notifier VI (which creates the place in memory for the notifier) – a string is the data type in this example. You are not required to send data with the notifier, which is one of the reasons this structure is called a master/slave and not producer/consumer (nothing is being produced or consumed, but the timing/when the consumer loop iterates is dependent on the master)
Page 153: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Producer/Consumer with Queues

Data type here determines the data type that can be placed in the queue

Presenter
Presentation Notes
The Obtain Queue creates a memory space for the queue. The data type that can be added to the queue is also defined (a string in this VI). The reference wire allows the queue functions to be operating on the same memory space (because you can have multiple queues in the same VI). In the Producer loop, the Enqueue Element VI adds an item into the queue. The next time the Enqueue Element executes, another item will be added to the queue as if it were getting in line. In the consumer loop, the Dequeue Element VI waits until something is placed in the queue. Once something is in the queue, the Dequeue Element VI removes the item and can pass it out to be used in the consumer loop (not shown in this slide). The process of the Enqueue Element adding to the end of the line and the Dequeue Element removing the item first in line continues, but the enqueuing and dequeuing can occur at different rates. If the enqueuing occurs faster, the line will build up by adding items to the end of the line. If the dequeuing occurs faster, the dequeue element will wait until there is something new to remove from the front of the line. There are also functions available to remove from the back of the line, but typically the Dequeue Element is used. The Release Queue VI releases the memory location for the queue. (Therefore, if the Dequeue Element tries to access that memory after it has been destroyed, an error will occur and that is what will stop the consumer loop in this slide)
Page 154: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Notifier vs. Queue

Tool Function When to use

Notifier - sends alert to helps control timing of parallel loops - can transfer data between loops - data NOT buffered (lossy)

- have a parallel loops that are running at different rates and 1+ loop is dependent on another - want to transfer data from one loop to another

Queue - helps control timing of parallel loops - transfers data between loops - buffers data to be transferred (FIFO)

- have a parallel loops that are running at different rates and 1+ loop is dependent on another - want to transfer ALL data from one loop to another

Page 155: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Semaphores

Run the top VI first

Run the bottom VI second

Presenter
Presentation Notes
Many semaphores can be acquired at one time. By default, only one. This means that of the code segments enclosed by an Acquire Semaphore and a Release Semaphore, only one segment can execute at a time.
Page 156: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

File Formats

ASCII TDMS Direct Binary

Numeric Precision

Good Best Best

Share data Best (Any program easily)

Better (NI Programs easily)

Good (only with detailed metadata)

Efficiency Good Best Best

Ideal Use Share data with other programs when file space and numeric precision are not important

Share data with programs when storing simple array data and metadata

Store numeric data compactly with ability to random access

Presenter
Presentation Notes
- Use text (ASCII) format files for your data: To make the data available to other users or applications If disk space and file I/O speed are not crucial If performing random access reads or writes is unnecessary If numeric precision is not important - Use binary format files for your data: When numeric precision is important When you need to randomly access stored data When efficiency is important A specific type of binary file, known as a Datalog file, is the easiest method for logging cluster data to file Stores arrays of clusters in a binary representation The storage format for Datalog files is complex, and therefore the data is difficult to access in any environment except LabVIEW - Use TDMS files for the following purposes: To store test or measurement data To create a structure for grouping your data To store information about your data To read and write data at high speeds TDMS file format: Binary file (.tdms) that contains data and stores properties about the data Binary index file (.tdms_index) that provides consolidated information on all the attributes and pointers in the TDMS file TDMS file format is publicly documented Can use with TDM Excel Add-in Tool
Page 157: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Modularity and SubVIs

Presenter
Presentation Notes
Can you identify a section of code in this VI that is repeated? Could that section be placed in a subVI, so the subVI could be reused instead of re-writing that section of code?
Page 158: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Modularity and SubVIs

Presenter
Presentation Notes
Now that the repeated section of code has been placed into a subVI, the VI looks cleaner and is easier to understand. If we were to change the channel that the data was being read from, we could edit the subVI and wouldn’t have to change anything in the main VI because the subVI outputs the temperature, not raw data. The subVI icon is descriptive because we can tell that it involves something with temperature.
Page 159: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Icon and Connector Pane: Setting up the Connector Pane • Right-click the icon in the

upper right corner of the front panel and select Show Connector (before LV 2011)

• Each rectangle on the connector pane represents a terminal

• Select a different pattern by right-clicking the connector pane and selecting Patterns from the shortcut menu

Presenter
Presentation Notes
The connector pane defines what can be passed in and out of the subVI. You can get to the connector pane by right-clicking on the icon FROM THE FRONT PANEL and selecting Show Connector. You can right click on the (now showing) connector pane and select Patterns to see the pattern options available.
Page 160: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Errors vs. Warnings

• Error • Status = TRUE

• Warning • Status = FALSE • Code is non-zero

Presenter
Presentation Notes
There are both errors and warnings within LabVIEW. Most products and VI groups only have errors. Some products and VI groups have warnings. VISA is an example of a product group that has warnings. Most error codes are negative values and warning codes are positive values; however, this is not universally true. A status of TRUE is always an error. A non-zero code with a status of FALSE is considered a warning.
Page 161: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Debugging Tools

• use highlight execution

• use probes to see the current value in the wire

• set breakpoints to pause execution at a specific point in the code

• single-step through the code

Presenter
Presentation Notes
Highlight execution, probes, breakpoints and single-stepping are four tools available in LabVIEW to help you determine why the VI is behaving differently than anticipated. Each is discussed in greater detail in the following slides
Page 162: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Variables: Recap Variable Type Scope Notes

Local variable A single VI • Tied to a front panel control/indicator

Global variable Multiple VIs on same computer

• Tied to a special global VI that has a front panel but no block diagram

Functional global Multiple VIs on same computer

• Implemented using a While Loop with an uninitialized shift register to store global data

Single-process shared variable

Multiple VIs on same computer

• Implemented using a project library in a project

• Can easily convert into a network-published shared variable

Network-published shared variable

Across an Ethernet network

• Implemented using a project library in a project

• Often used to communicate with Real-Time targets

Presenter
Presentation Notes
Other notes: Global variable: Each global VI can have multiple variables. Functional global: Often used for more complex data structures, such as a stack or queue. A Functional global VI can be used to protect access to global resources, such as files, instruments, and data acquisition devices, that you cannot represent with a global variable. Single-process shared variable: Similar to a global variable, but can easily be converted to network-published shared variable
Page 163: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Race Conditions: Shared Resources

Presenter
Presentation Notes
Race conditions are most common when two tasks have both read and write access to a resource A resource is any entity that is shared between the processes; most common resources are shared data storage, such as variables Minimize shared resources and limit the number of writers to the remaining shared resources Most race conditions only occur when a resource has multiple writers In top image, the reader reads whichever was the last value written to the resource. In bottom image, all readers read value A.
Page 164: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Generic Object

GObject

Control

Boolean

VI Server: Organization

Pets

Dogs

Labrador Poodle

Cats

Control

Boolean

Stop LED

Array

Presenter
Presentation Notes
Control Class Property: Visible Method: Reinitialize to Default Boolean Sub-Class Property: Boolean Text Array Sub-Class Property: Number of Rows Stop Object Visible: Yes Reinitialize to Default: No Boolean Text: Stop
Page 165: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Control References – Create SubVI To create explicitly-linked Property Nodes in a subVI:

1. Create your VI 2. Select the portion of the block

diagram that will be in the subVI 3. Select Edit»Create SubVI;

LabVIEW automatically creates the control references needed for the subVI

4. Customize and save the subVI

Page 166: Preparing for the Certified LabVIEWAssociate Developer (CLAD) … · 2020. 1. 15.  · LabVIEW Certification Exams and Process Certified LabVIEW . Associate Developer . Certified

ni.com/training

Control References – Create SubVI

SubVI Front Panel SubVI Block Diagram