Example Code

Programmatically Create X Markers on XY Graph Using LabVIEW

Code and Documents

Attachment

Overview

This VI is designed to programmatically create X markers on an XY Graph.

 

Description

This VI is designed to programmatically create X markers on an XY Graph. This was originally created to address an issue in LabVIEW 2009 (fixed in LabVIEW 2009 SP1), where XY Graphs do not populate X markers correctly when using absolute time on the X scale.

It uses Graph property nodes to adjust the XScale properties to the increments specified.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Use this VI as a subVI in your program by wiring the reference (refnum) of the Graph into the 'GraphChart Refnum In'.
  2. Run your program

The only required input is a reference to the graph or chart you would like to add markers to.
Make sure you run this code after you have updated your indicators. If you want the markers to update as you zoom, then your program will need to rerun this specific subVI after a zooming activity occurs.

 

Additional Information or References

3502555 - Snippet.png

The screenshot below illustrates how adding X Markers to a Graph would look like. 

Place X Graph Markers B and A.PNG

 

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

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

Comments
FIC
Member
Member
on

So if we migrate to LV 2009, this VI needs to be added..!? Is there a plan to release a Patch sometime soon? Becasue if that happens now we have to remove the VI. If a definite date for patch is communicated, it will be help people make a better decision to migrate now or wait till later. As for us we have reverted back to 8.6. This bug was severe and there were other things such as TDMS file compatibility that got us thinking if it is worth the upgrade.  We feel that a known devil (LV 8.6) is better than an unkown one (LV 9.0). Thanks for your effort though and if a target date for patch is communicated it will help

Not applicable
on

Hello,

I have added a a more sophisticated version. It calculates the number of Markers for resizeable Frontpanels itself and calculates a better increment value. For example: Better use 5:00 than 4:48.

sletrab

HunterSeeker
Member
Member
on

You should be able to go to the edit page an add your version, just be sure to title it something clear.

Not applicable
on

Hello,

My VIs were deleted (don't know why), but the problem is solved in Patch2 for LabVIEW 2009. Look for for example for "2009 f2". The patch works.

sletrab