2.3.1 - Lissajous curves

Instructions:

  • Create a new VI
  • Insert an Express XY Graph into the Front Panel
    • Modern -> Graph -> Express XY Graph (Ex XY Graph)
  • Insert four pointer sliders (see the Front Panel below) and name them Trim 1, Trim 2, Type, and Amplitude
  • Adjust the ranges of each slider as follows:
    • Trim 1 & 2: -1 to 1
    • Amplitude: 0 to 1
    • Type: 0 to 4
      • Adjust the datatype to be I8 (integer 8-bit), by right-clicking the slider, selecting properties -> Data Type, clicking the "DBL icon" and selecting "I8"

A Lissajous curve is the result of 4 Sine curves, a fast and a slow on both X and Y axes. To enhance the overview, you would be wise to create free labels to order your sine generators (double-click in an empty area of the Block Diagram). The pointer sliders are used to control the specific frequency and amplitude of each sine curve. On the Block Diagram you thus need to create the following:

  • Insert 4 sine waveform generators (Signal Processing -> Waveform Generation -> Sine Waveform.vi)
  • X-axis
    • Slow sine
      • Frequency = Trim1Slider / 200 + 1
      • Amplitude = 1,95 / AmplitudeSlider
    • Fast sine
      • Frequency = 100
      • Amplitude = AmplitudeSlider
  • Y-axis
    • Slow sine
      • Frequency = 1
      • Amplitude = 1,95 / AmplitudeSlider
    • Fast sine
      • 100 + TypeSlider + Trim2Slider / 200 (use Compound Arithmetic)
      • Amplitude = AmplitudeSlider
  • By default, the sine generators delivers signals with a sampling rate of 1,00k and 1000 number of samples. If you right-click the "Sampling info" input on the bottom of the sine generator, you can create a constant. Change the top value to 2001 (Sampling rate) and the bottom to 2000 (number of samples). Wire this constant to all 4 sine generators.
  • Add the Slow and Fast sines and wire them to the X and Y inputs of the Build XY Graph Express VI.
  • Wire the XY Graph output from the "Build XY Graph Express VI" to the graph
  • Run your VI and enjoy the result:) Try changing the slider values to see their effect.
  • You can enhance your experience by changing the line width (right-click the graph, select properties -> Plots -> Line Width number 3 from the top).
  • Save your VI as LissajousCurves.vi

LabView has a vast array of pre-built examples. Try launching Help -> Examples and search for Lissajous Curves. Take a look at Lissajous Curves 2 to see how to build your program using Express VIs.

Created by Samuel Thrysøe © 2013