0% found this document useful (0 votes)
45 views9 pages

Review

This document provides steps to build a virtual calculator in LabVIEW. It involves: 1. Adding event cases for numeric and operation keys to accumulate the input string and store operation codes. 2. Checking for duplicate decimal points and concatenating new keys. 3. Converting the accumulated string to a float for calculations. 4. Storing operands and operation codes, then performing the calculation on the "=" key. 5. Converting the result back to a string for display.

Uploaded by

ARAB GOT TALENT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views9 pages

Review

This document provides steps to build a virtual calculator in LabVIEW. It involves: 1. Adding event cases for numeric and operation keys to accumulate the input string and store operation codes. 2. Checking for duplicate decimal points and concatenating new keys. 3. Converting the accumulated string to a float for calculations. 4. Storing operands and operation codes, then performing the calculation on the "=" key. 5. Converting the result back to a string for display.

Uploaded by

ARAB GOT TALENT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Review Exercise

Lets build a virtual


calculator ,using
the LabView
functions that we
have studied up till
now.
Review Exercise
Review Exercise
Step 1:
• Add event case for all numeric keys {0,1,2,3,4,5,6,7,8,9}.
• Use the CtRef node for obtaining the key text, using Application Control
Palette > Property Node > Boolean Text > Text
• Join the last entered key code accumulated in the shift register with
current using concatenated strings toll.
Review Exercise
Review Exercise
Step 2:
• Add new event case for the point key { . }.
• Check if any point has already been dialed.
• Join the last entered key code accumulated in the shift register with
current point using concatenated strings toll.
Review Exercise
Step 3:

• Add new event case for the Clear key { C }.


Review Exercise
Step 4:
• Add new event case for the Math operation keys { + , - , x , / }.
• Convert the accumulated in the shift register string into a float number.
• Store the float number (First Operand) into second shift register as a
float number.
• Store the math operation key text { + , - , x , / } into third shift register
Review Exercise
Step 5:
• Add new event case for the execution key { = }.
• Convert the accumulated in the shift register string into a float number and
use it as a second operand.
• Perform an appropriate math operation according to the stored operation
code in the third shift register using the case structure.
• Convert the operation result into string using the Format Into String function.
Homework 2

Extend the
previous example
to be able to
calculate more
functions as shown
right.

You might also like