Example Code

Sudo Globally Unique Identifier (GUID)

Code and Documents

Attachment

Download All

Overview

This application creates a Sudo Globally Unique Identifier (GUID), which is intended to be a completely unique identifier for use in computer software.

Description

Since computers cannot truly create random numbers, this is accomplished by creating a random number so large that the probability of repeating it is negligible. This VI uses multiple parallel For Loops to create a random set of numbers that are changed into strings and then concatenated into a single GUID string.

The output of this function is a string of the general form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} where X is a single digit hexadecimal number.

Many operating systems, including Windows, implement a GUID generator. However, this function does not utilize operating system calls in order to remain platform independent (ex. Real-Time).

Steps to Implement or Execute Code

  1. Download the VI or drop the Snippet into existing code
  2. Run the VI

Requirements

Software

LabVIEW 2009 or later

Additional Images or Video

Block_Diagram.png

VI Snippet

Sudo GUID.png

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**

Applications Engineer
National Instruments

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

Comments
UliB
Active Participant
Active Participant
on

A GUID consists of hexadecimal digits, but your code doesn't generate a 'F'.

You should multiply by 15 not 14.

Contributors