Example Code

Changing and Committing Multiple Shared Variables Simulataneously using DSC module

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 demonstrates how to programmatically change and commit multiple shared variables simultaneously using Datalogging and Supervisory Control (DSC) module.

 

Description

This example opens up a library that houses multiple shared variables, then sets the DSC alarming functionality and buffers each shared variable. Once all of the shared variables are set and buffered, the VI then uses the Commit Shared Variables VI to simultaneously commit a large amount of shared variables. This is more efficient than setting and committing each variable during each iteration of the for loop. Finally, the lower For Loop verifies that the shared variable alarming settings were committed by reading the alarm level of each shared variable.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • LabVIEW 2012 Datalogging and Supervisory Control Module (or compatible)

 Hardware

  • No hardware required

 

Steps to Implement or Execute Code

  1. Download and extract the attached file "Change and Commit Shared Variables using DSC LV2012 NIVerified.zip".
  2. Open VI and follow the instructions in Front Panel and Block Diagram and run the program.

 

Additional Information or References

Change and Commit Shared Variables using DSC LV2012 NIVerified.vi - Front Panel.png

 

Change and Commit Shared Variables using DSC LV2012 NIVerified.vi - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Tannerite
National Instruments

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