Example Code

Flying triangle with area - A triangle-based oscillator

Code and Documents

Attachment

Overview

This VI emulates a triangle screensaver and shows the area of its triangle over time, providing a generator of slow-rate random analog waveforms.


Description

Who of you never looked at the triangle screensaver and wondered how the area of that moving triangle would vary over time? Using basic maths and LabVIEW capabilities, the answer is now on your screen!


Drawing a triangle each 50 ms according to initial angles set by the user on front panel, this VI emulates that well-known Windows screensaver, calculating the area of each of these triangles and plotting it on a waveform chart.


While originally designed without any practical purposes, ‘just for fun’, it can also be used for test as a slow-rate random analog waveform generator.

As far as I know, I've invented a completely new kind of circuit in Electronics.

Differently from standard waveform generators, based on some predictable and boring behavior of a physical material, like crystal-based oscillators, it provides you random waveforms by its own nature, eliminating the need of storing real-world signals in a deep memory as in an arbitrary waveform generator. Changing starting angles and frame dimensions (the 'oscillator' section), you can obtain different curves (for further studies). Using smaller steps and cycle times, you can obtain better resolutions. Let's try it!

Nice comments and suggestions are welcome.

Steps to Implement or Execute Code

  1. Download the zip file and save it into your PC.
  2. Extract the files to a folder
  3. On ‘flying triangle with area v1.zip’, double-click on ‘flying triangle with area v1.vi’. VI will open.
  4. On VI's front panel, vou can set initial angles on front panel from 0 to 360 degrees or leave the default values unchanged.
  5. Run the VI.
  6. Smile

Requirements

Software

Made in LabVIEW 2015.


Hardware

N/A


Additional Images or Video

flying triangle.jpg

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

Contributors