Example Code

Playlist Shuffler in LabVIEW

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
This code illustrates the easiest way of shuffling an array of strings.

 

Description
The intend of this VI is to shuffle an array of strings, which in this case, it represents a musical play list. To make it more fun, the songs listed have been NI-fied. The names were taken from well-known tunes and forced it to fit some of National Instruments' products.

 

Please do note that there is a “randomize factor” constant on the block diagram. It is currently set to 1, but this can be increased to improve the shuffle. Also, note that if you scroll to the right on the front panel, there is a Boolean array which informs you how many tracks are in their original positions – allowing you to rate the efficiency of the shuffle.


Requirements
LabVIEW Base Development System (or compatible)

 

Steps to Implement or Execute Code
1. Run the VI


Additional Information or References

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

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

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

Comments
Snamprogetti
Active Participant
Active Participant
on