how to clear a chart or graph programmatically in labvie1

Upload: williamii

Post on 01-Jun-2018

449 views

Category:

Documents


1 download

TRANSCRIPT

  • 8/9/2019 How to Clear a Chart or Graph Programmatically in LabVIE1

    1/2

    How to Clear a Chart or Graph Programmatically in LabVIEW

    Primary Software:Primary Software Version:1.0

    Primary Software Fixed Version:N/ASecondary Software:LabVIEW Development Systems>>LabVIEW Full Development System, LabVIEWDevelopment Systems>>LabVIEW Professional Development System

    Problem:I have a chart and a graph on my front panel in LabVIEW, but the only way I can find to clear it is to right-clickthe chart or graph and choose Data OperationsClear Chartor Data OperationsClear Graphfrom theshortcut menu. Is there a way to clear the chart or graph programmatically?

    Solution:To clear a Waveform Chart programmatically, a Property Node must be used to clear the Chart History. Formore information, see KnowledgeBase 3VGFK1HY: Why Doesn't Reinitializing to Default Value ClearWaveform Charts?in the Related Links section below.

    Waveform Chart:

    1. Right-click the chart and select CreateProperty NodeHistory Data.2. Right-click History Data and select Change to Write.3. Right-click the History Data Terminal and select Create Constant.

    This writes an empty array of data to the chart, which will clear the history when this code is executed.

    Waveform Graph:

    To clear a graph programmatically, a Property Node or Invoke Node can be used.

    Property Node:

    1. Make sure the graph is clear by right-clicking the graph and choosing Data OperationsClear Graph.2. Right-click the graph and select CreateProperty NodeValue.3. Right-click Valueand select Change to Write.4. Right-click the Value Terminal and select Create Constant. This writes empty data to the graph

    which will clear the graph when this code is executed.

    Invoke Node:

    1. Make sure the graph is clear by right-clicking the graph and selecting Data OperationsClear Graph.2. Right-click the graph and select CreateInvoke NodeReinitialize to Default.

  • 8/9/2019 How to Clear a Chart or Graph Programmatically in LabVIE1

    2/2

    In LabVIEW releases prior to 8.0, you cannot create a constant if waveform data is being written to the

    chart. Instead, use one of the methods described below.

    Waveform Chart and Graph (Property Node):

    1. Right-click the property and select CreateControl.2. Go to the Front Panel and right-click the newly created control. Select AdvancedHide Control.

    Waveform Graph (Invoke Node):

    1. Make sure the graph is clear by right-clicking and select Data OperationsClear Graph.2. Right-click the graph and select CreateInvoke NodeReinitialize to Default.

    The following link shows a LabVIEW shipping example that demonstrates how to do this:How to Clear Charts & Graphs

    You can also find this example in the NI Example Finder, or in this file location:[labview]\examples\general\graphs\charts.llb\How to Clear Charts & Graphs.vi

    Related Links:

    KnowledgeBase 3VGFK1HY: Why Doesn't Reinitializing to Default Value Clear Waveform Charts

    Developer Zone Example: Clearing Charts and Graphs Programmatically

    Example: How to Clear Charts & Graphs

    Community: Clearing Charts & Graphs Programmatically

    http://sine.ni.com/devzone/cda/epd/p/id/3786http://sine.ni.com/devzone/cda/epd/p/id/3786http://digital.ni.com/public.nsf/allkb/85F4360085075CEF86257134007C840Ahttp://digital.ni.com/public.nsf/allkb/85F4360085075CEF86257134007C840Ahttp://digital.ni.com/public.nsf/allkb/85F4360085075CEF86257134007C840Ahttp://decibel.ni.com/content/docs/DOC-6360http://decibel.ni.com/content/docs/DOC-6360http://sine.ni.com/devzone/cda/epd/p/id/3786http://sine.ni.com/devzone/cda/epd/p/id/3786https://decibel.ni.com/content/docs/DOC-6360https://decibel.ni.com/content/docs/DOC-6360https://decibel.ni.com/content/docs/DOC-6360http://sine.ni.com/devzone/cda/epd/p/id/3786http://decibel.ni.com/content/docs/DOC-6360http://digital.ni.com/public.nsf/allkb/85F4360085075CEF86257134007C840Ahttp://digital.ni.com/public.nsf/allkb/85F4360085075CEF86257134007C840Ahttp://sine.ni.com/devzone/cda/epd/p/id/3786