Example Code

XControl - Clock

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 is an example that fulfills the function of analog clock using XControl.  

 

Description

This VI demonstrates how to achieve the analog clock by using XControl.  

 

Requirements

  • LabVIEW 2012(or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI.
  2. See the related figures in front panel.

 

Additional Information or References

VI Snippet

 undefined

 

 

 

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

 

Regards
Prabhakant Patil

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

Comments
Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
on

I know this is quite old, but a word of caution for anyone using this.  I suspect this has what will appear to be a memory leak, where as the application continues to run it will continue to use up resources.  This is because the clock is a 2D picture control, and the image is just continually redrawn on top of the old one.  I don't fully know how resources are kept or not between runs of an XControl but this type of thing should be avoided in normal VIs.  I explored this in a thread years ago here

 

On top of this there are other issues like not having any labels on controls in VIs such as this one.

Untitled.png

And lastly this doesn't actually use the value passed in at all.  The time displayed will always be the time on the system.  If you wire a constant of any number to it, it will always display the system time and not the time wired.