Example Code

Little Meal Planner

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 NXG
  • LabVIEW NXG Web Module

    Operating System

  • Windows

    Programming Language

  • LabVIEW G

Code and Documents

Attachment

Description

This program is designed to sort and consolidate recipes across the week into a sorted weekly shopping list, where duplicate ingredient amounts are added together.

 

The offline code does most of the array sorting and heavy processing, and SystemLink tags and files are transferred to a SystemLink Cloud server where a webVI can input the meals for each day of the week and then read back the sorted shopping list from a tdms file stored on the SystemLink Cloud server (pushed up to the cloud from a local directory).

 

The code could do with some improvements, especially the way the file is handled.

 

Future potential I can think of:

1.) It would be cool to develop some code that reads / imports recipes from another website.

2.) Alternatively, just reading ingredients from an Excel file would be better than having 2D String Array constants.

3.) Would also be good to move the offline code to a low power embedded device like a myRIO (although currently at NXG 5.0 myRIO isn't supported so the code would need to be re-written in current gen LabVIEW to run it on a myRIO).

4.) Better document and refactor the code - should make better subVI icons :slightly_smiling_face:

5.) Share with the community any improvements made - let's see if we can grow this fun piece of code with LabVIEW programmers contributing from around the world :slightly_smiling_face:

 

How to Use

1.) You'll need to generate and add your own SystemLink cloud API keys and file path.

2.) Run the offline LabVIEW NXG code then run the webVI (if you want to run this on a phone or remote device you'll first need to upload the package to your SystemLink Cloud server or alternative.)

 

Additional Information

This YouTube video is great at explaining webVI's:
Here are some NI examples and tutorials I also used:

 

 

Related Links

LinkedIn video of me giving a brief overview and demo of the program:

https://www.linkedin.com/posts/stuartlittle1989_labview-braemac-webtechnologies-activity-67220054311...

 

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

Contributors