Example Code

Local Variables - Race Condition using 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 example code highlights some of the problems associated with using Local Variables to pass data between parallel while loops.

 

Description

Race conditions have to be one of the most difficult coding issues to debug.  The behaviour is difficult to detect and even harder to debug.  This example code highlights some of the problems associated with using Local Variables to pass data between parallel while loops.

 

Requirements:

LabVIEW 2012(or compatible)


Steps to Implement or Execute Code

  1.  Run the vi.
  2. Observe the race conditions by comparing the number between first loop, second loop and third loop.

 

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

 

Robert Ward
Applications Engineer, NI

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