Example Code

Seamless Desktop Measurement Widget

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 allows you easily turn any one of your existing Virtual Instruments into a seamless Desktop Widget.

 

Description

This Project below is created to allow you easily turn any one of your existing Virtual Instruments into a seamless Desktop Widget.  

Measurement Widget.jpgThe auther has tried to make this code as modular as possible. All you'll need to do to convert your Virtual Instruments to desktop widgets is copy and paste the 'Measurement Widget' SubVI into a concurrent loop to your code, whilst following the instructions outlined in the given example 'Top VI.vi'.

 

Requirements

  • LabVIEW 2012 (or compatible) in Windows Operating System


Steps to Implement or Execute Code

  1. Close or minimize other windows in the desktop of Windows Operating System.
  2. Run the Top VI.
  3. Rotate the Dial to change the value of Waveform Chart.
  4. Enable 'Move Widget' boolean control and move the Widget about the screen to refresh the background.

 

Additional Information or References 

A few requirements...

  • For Windows Operating Systems only. It makes a call to the registry to read the desktop background image, so it may not be compatible with earlier versions of Windows. I've tested this in Windows 7 only so far, and I would hope that it will be compatible with many earlier versions of Windows too.
  • The desktop background you use shouldn't be on a 'repeat' mode. If you are using a 'Fit to Screen' based background, it should work fine.
  • I've tried to implement an image resizing algorithm; but for now it is very coarse. The closer your desktop background image size fits your monitor, the better this widget will look.
  • You need to move the Widget about the screen (By enabling the 'Move Widget' boolean variable) to refresh the background. It's slightly laggy to update, but Widgets aren't really meant to be frequently moved around anyway.

 

VI Snippet of the top level VI

 1.png

 

This shows just how easy an existing Virtual Instrument (The Top Loop) can be turned into a full desktop widget! The attached project comes in LabVIEW version 8.6, but I can downconvert it if anyone asks.

 

I hope you guys have fun with this one! Any feedback you have is really appreciated, keep in mind that this is a work in progress!

 

- Alex

 

 

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


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

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

Comments
GriffinRU
Member
Member
on

Hi,

I bet you would love this link -> click here?

-Artur

Alex.T
Active Participant
Active Participant
on

Well, I sure feel stupid.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

GriffinRU
Member
Member
on

Hey,

Not everything is working great with layered windows approach iether, just want to share with you another way of playing with transperency...

-Artur

Alex.T
Active Participant
Active Participant
on

No, I appreciate it. It was good fun to try and get this working through the 2D Picture Control, but I didn't even think of using DLLs for the same effect. Very cool.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)