Table Of Contents

Read Tag (G Dataflow)

Last Modified: January 12, 2018

Returns the data value stored in a tag.

connector_pane_image
datatype_icon

tag/proxy ref in

The reference to the tag endpoint or tag proxy endpoint from which you want to read the data value.

datatype_icon

data type

Data type you input for the tag that the tag endpoint reads.

To prevent the node from returning an error if the node cannot determine the data type of the tag at run time, wire a value to this input. Otherwise, you can ignore this terminal because the data type of this input automatically changes to match the data type of the tag to which it is wired.

Purposes of data type

This terminal has two purposes:
  • If the compiler cannot determine the type of the tag automatically, you can manually specify the type by wiring this terminal.
  • You want to pre-allocate the memory for the tag at this point. The read operation attempts to reuse any buffers associated with the value you wire to this terminal. Minimizing memory allocations for each read operation can improve performance.

Default: 0

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

tag/proxy ref out

The reference to the tag endpoint or tag proxy endpoint from which this node reads the data value.

datatype_icon

value

The data value stored in the tag.

datatype_icon

timestamp

The timestamp associated with the data value.

This output is available only if all of the following conditions are met:

  • When you create the tag, you enable the Has Timestamps? property.
  • You wire a reference to that tag to tag/proxy ref in.

Associating Timestamps with Tag Data

Complete the following steps to associate a timestamp with the data value stored in a tag.

  1. Navigate to the shared resource collection document where you created the tag and select the tag you want to modify.
    spd-note-note
    Note  

    Shared resource collection documents have the .grsc file extension.

  2. On the Item tab, enable the Has Timestamps? checkbox.

If the tag contains an initial value, the tag now associates that value with the timestamp when the tag was created.

You can also associate a custom timestamp to the data value that you write to a tag. If you wire a timestamp to the Write Tag node when writing a new data value to a tag, the node then associates that timestamp with the new data value.

spd-note-note
Note  

Associating a timestamp with tag data may slow the performance of your application. Associate timestamps with tag data only when necessary.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

What Is a Tag?

A tag is single-point, latest value data that you can access from multiple documents within a project. A tag can store a single value of any data type that represents the state of a process. Tags are similar to global variables in text-based programming languages.

You can create a tag either dynamically, using the Configure and Create Tag node on the diagram, or statically, in the shared resource collection file.

You can create a tag to access the same data from multiple VIs within a project.

What Is a Tag Proxy?

A tag proxy is a reference that is local to part of the application that mirrors the value of the actual tag to which it is linked in another location in the application. You use a tag proxy to access data that is in another location in the application. You can read from and optionally write to a tag proxy only after the tag proxy links to a tag.

Where This Node Can Run:

Desktop OS: Windows

FPGA: All devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics