Example Code

Notifier Refnum LV2 Style Global

Code and Documents

Attachment

Overview

This VI uses a feedback node to hold the refence to a notifier. For demonstration purposes, this notifier uses a boolean as its data type. For other uses, change the data type to suit your application.

Description

Use this VI throughout your application to access your notifier. Because this VI uses a feedback node to hold the reference to the user notifaction, this VI is global, meaning it can be used anywhere in your application instance.

Notifier Refnum LV2 snippet.png

Steps to Implement or Execute Code

  1. Place the subVI on your block diagram to access your notifier.
  2. During the shutdown phase of your application, release the notifier reference.

Requirements

Software

LabVIEW 2013 SP1 or newer.

Hardware

N/A



Ian K.
Software Developer
Data Ahead AG

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

Comments
crossrulz
Knight of NI Knight of NI
Knight of NI
on

I do something similar.  Except I go the full Action Engine route.  I have an enum to state what to do with the reference.  Options include Create, Close, Get Reference, and Send Command.  Yep, I put the sending of the notification inside of the VI.  Whoever wants to read a notifier can get the reference still and then wait for the notification.

I handle my queues the exact same way.  It works very well for queues since only one place should be reading anyways (where you create the queue).  So then anybody (in the project) can send the commands just by calling the Action Engine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Contributors