From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

LabVIEW - Calculator Example

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
Calculator application using LabVIEW

Description:
The calculator can perform a number of simple mathematical operations and utilities the Producer/Consumer (Events) design pattern. When running the program, hover over certain buttons to display a tip strip as to their operation. When analyzing the block diagram, display Context Help (Ctrl-H) and hover over SubVIs to get a description of functionality.

Instructions:
To implement this example:

  1. Run VI

To execute this example:

  1. Install the required software.
  2. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible

Hardware
-

2017-11-03_11-18-29.jpg2017-11-03_11-15-51.jpg

**This document has been updated to meet the current required format for the NI Code Exchange.**


Regards,

Peter D

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Tori.M
Member
Member
on

Hey,

Liked the calculator but quick suggestion would be to switch the numbers around so that they replicate the order in the num pad & not a telephone!

Also I did notice that you've copied the standard windows calculator, and not the scientific one that follows BODMAS e.g. 8 + 2 * 9 it thinks = 90, not 26. Another suggestion could be to implement a little extra code to switch between the two perhaps?

Other than that, nice work!!

Tori
Student
RER
NI Employee (retired)
on

That is a slick architecture Pete.

Nice coding!

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
alecjcook
Member
Member
on

Hi, could someone please tweak the "Calculate Results" sub VI so it operates on BODMAD principals. My programming is OK but my maths is shakey, could someone help please!

Many thanks

e.ono
NI Employee (retired)
on

I love this example, thank you!