Live API VIs

DataLog Read Last Number.vi DataLog Read Last String.vi DataLog Write String.vi re_DataLog Write Number.vi

Query API VIs

DataLog Interpolate Log.vi DataLog Merge Times.vi DataLog Read Log Strings.vi re_DataLog Tag Info.vi
DataLog Log Info.vi DataLog Read Log Index Range.vi DataLog Read Log Time Range.vi

API objects

obj_DataLog Tag Buffers.vi obj_DataLog Tag Hash.vi

DataLog Read Last Number.vi

Reads the last-written number (the current value) from a number tag of the live database. This is a convenience wrapper around the "Tag Buffers" object which provides a more complete set of methods for reading values from a tag's buffer.

DataLog Read Last Number.vi

cstr

tag

Tag name. It is used when "tag index in" is not wired.

ci32

tag index in (name lookup)

The index of the tag. If left unwired or less than zero, a tag lookup will be performed, and the related inputs must be wired. When performing repeated actions on the same tag, use a shift register initialized to a negative value (e.g. -1) around the tag index in/out. This will cause the first iteration to do a name lookup, and subsequent iterations to use the tag's index.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

idbl

number

Number value read from tag.

idbl

time

Timestamp of the number value.

ii32

tag index out

Duplicate of "tag index in", if wired.

When "tag index in" is left unwired, this returns the index of tag "tag", or -1 when an invalid name is wired to "tag".

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

DataLog Read Last String.vi

Reads the last-written string (the current value) from a string tag of the live database.

DataLog Read Last String.vi

cstr

tag

Tag name. It is used when "tag index in" is not wired.

ci32

tag index in (name lookup)

The index of the tag. If left unwired or less than zero, a tag lookup will be performed, and the related inputs must be wired. When performing repeated actions on the same tag, use a shift register initialized to a negative value (e.g. -1) around the tag index in/out. This will cause the first iteration to do a name lookup, and subsequent iterations to use the tag's index.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

istr

string

String value read from tag.

idbl

time

Timestamp of the string value.

ii32

tag index out

Duplicate of "tag index in", if wired.

When "tag index in" is left unwired, this returns the index of tag "tag", or -1 when an invalid name is wired to "tag".

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

DataLog Write String.vi

Writes a string value to a tag. The current time is used as timestamp if no custom time is wired. The current database must be live.

DataLog Write String.vi

cstr

string

The string to write to the tag.

cdbl

time (current)

Timestamp to apply to the string value being written. When not wired or NaN is wired, the current time is used as timestamp.

cstr

tag

Tag name. It is used when "tag index in" is not wired.

ci32

tag index in (use tag)

The index of the tag. If left unwired or less than zero, a tag lookup will be performed, and the related inputs must be wired. When performing repeated writes to the same tag, use a shift register initialized to a negative value (e.g. -1) that loops "tag index out" back to "tag index in". This will cause the first iteration to do a tag name lookup, and subsequent iterations to use the more efficient index.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ii32

tag index out

Duplicate of "tag index in", if wired.

When "tag index in" is left unwired, this returns the index of tag "tag", or -1 when an invalid name is wired to "tag".

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

re_DataLog Write Number.vi

Writes a number value to a tag. The current time is used as timestamp if no custom time is wired. The value is checked against any limit meta tags and coerced to any max/min meta tags. The current database must be live.

re_DataLog Write Number.vi

cdbl

number

The number value to write to the tag.

cdbl

time (current)

Timestamp to apply to the number value being written. When not wired or NaN is wired, the current time is used as timestamp.

cstr

tag

Tag name. It is used when "tag index in" is not wired.

ci32

tag index in (use tag)

The index of the tag. If left unwired or less than zero, a tag lookup will be performed, and the related inputs must be wired. When performing repeated writes to the same tag, use a shift register initialized to a negative value (e.g. -1) that loops "tag index out" back to "tag index in". This will cause the first iteration to do a tag name lookup, and subsequent iterations to use the more efficient index.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ii32

tag index out

Duplicate of "tag index in", if wired.

When "tag index in" is left unwired, this returns the index of tag "tag", or -1 when an invalid name is wired to "tag".

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

DataLog Interpolate Log.vi

Interpolate the point values in a tag log at the specified times. When the tag is of "sample" temporal type, the values of the two points adjacent to each specified time are linearly interpolated in case of a number tag, or, in case of a string tag, an error is returned. When the tag is of "set&hold" temporal type, the value of the last point prior to each specified time is used: such tags hold their value until changed. In case of a string tag you'll have to use the returned offset values to read the string values from the log. When the tag is of "event" temporal type, an error is returned since such tags have values that are defined only at the time of the event.

Note that this VI tries to read the timerange covered by the specified times from the tag log before commencing with interpolation. This fails when the timerange contains more than "max points" points. In such an event, the specified times are divided in increasingly smaller chunks until the reads succeed. In this eventuality, it helps performance when the specified times increase or decrease monotonically.

DataLog Interpolate Log.vi

cpath

tag log directory

ccclst

tag config

Wire the temporal type of the tag here.

c1ddbl

times

The times to interpolate at.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ipath

dup tag log directory

ienum

value type

Value type of the tag. In case of "string", the returned offset values must be used to retrieve the actual string values.

i1ddbl

interpolated values

Point values interpolated (linearly or held from prior) at the specified times.

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

DataLog Log Info.vi

Returns the log size, that is, the number of values (numbers or strings) contained in the tag's log. Since, on writing, logs are only appended to, this equals the write index. A double is used because it can represent very large integers without overflowing or rounding. In addition, the start time, that is, the timestamp of the first logged point is returned. When the log is empty, the start time is set to NaN.

DataLog Log Info.vi

cpath

tag log directory

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ipath

dup tag log directory

idbl

size

Number of values in the log.

idbl

start time

Timestamp of the first logged point.

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

DataLog Merge Times.vi

Merge times for interpolation. Given two arrays of monotonically increasing times, output an array of times that contains the monotonically increasing union of the input times. When the time arrays contain identical values, the value is copied only once into the output array.

Beware that when either set of times does not increase monotonically, the output times will not either. Though sorting the times is not difficult, this option was rejected to ensure that the algorithm executes in linear time: the arrays might be very large.

DataLog Merge Times.vi

c1ddbl

times to add

c1ddbl

times in

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

i1ddbl

times out

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

DataLog Read Log Index Range.vi

Read the range of points starting at the specified index from a tag's log.

DataLog Read Log Index Range.vi

cpath

tag log directory

cdbl

log index

Index of first point to read.

ci32

number of points

Number of points to read. When more points are requested than the configured "max points", and error is thrown.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ipath

dup tag log directory

i1dtdef

range of points

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

DataLog Read Log Strings.vi

Read the strings at the specified byte offsets from the strings file of a string tag log. These offsets are stored as the values of the tag's point. Consequently, to use this function, you must pass a range of points read from the tag's log or their offset values.

DataLog Read Log Strings.vi

cpath

tag log directory

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

c1dtdef

points (use offsets)

c1ddbl

offsets (use points)

ipath

dup tag log directory

i1dstr

strings

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

i1ddbl

times

The timestamps of the provided points (if any).

Up to API index

DataLog Read Log Time Range.vi

Read a range of points that covers the specified time range from a tag's log. The first returned point's time <= begin, the last returned point's time >= end. An exception to this rule occurs when the range begins before the oldest point in the log or ends after the last point in the log. In that case as much data as possible will be returned. If the range lies before the logged data, only the first point will be returned. If the range lies beyond the logged data, only the last point will be returned.

DataLog Read Log Time Range.vi

cpath

tag log directory

cdbl

begin of range

cdbl

end of range

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ipath

dup tag log directory

ibool

too many points?

True when the VI failed because there were more than "max points" in the specified time range.

i1dtdef

time range of points

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

re_DataLog Tag Info.vi

Return information on a tag in a database. The returned tag log directory can be used to perform queries on the tag's log. The returned tag config cluster can be used to determin the temporal type, value type, or unit of the tag.

The tag can be specified via its name, or via its index. In the latter case the database must be live. The database can be specified via a reference or name. When omitting both, the current database is used.

When true is wired to the flush input, an attempt will be made to flush the buffered tag data to the log before returning. Use this when you are about to query data from the log and require the most recent available data. Note that flushing propagates over the network for a mirrored database provided that a mirroring connection has been established.

This VI is reentrant not only because flushing might take some time, but also to avoid recursion deadlocks when the database being mirrored is part of the local runtime (e.g. for testing purposes).

re_DataLog Tag Info.vi

csvrn

database ref (use name)

Reference to the database object instance. Provides an alternative means of specifying the database.

cbool

flush? (false)

When you need the most recent available data to be present in the tag log, wire true. When the database is live or being mirrored, any buffered data to the tag's log.

cstr

database (current)

Used when no database reference is wired. Specifies the name of the database. When left empty, the current database is used.

cstr

tag

Name of the tag. Used when the database is not live or no tag index is wired.

ci32

tag index (use tag)

The index of the tag for which to contstruct the tag log directory path. Only works when the database is live.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ipath

tag log directory

The directory containing the tag's log. This can be be wired into subsequent query VIs so as to read or interpolate the log.

icclst

tag config

Tag configuration cluster.

ienum

mode

Mode of the database.

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

obj_DataLog Tag Buffers.vi

Provides circular buffers for the tags in the live database. Only the {read} and {read last} methods are intended for public use. All other methods are private.

The implementation pools the tag buffers so as to provide indexing over tags while avoiding more complicated composite data structures that confuse the LabVIEW compiler sufficiently to not to generate in-place code. By restricting the tag buffers in the pool to have a power of two capacity, modulo the capacity reduces to a simple bitwise "and" operation with a mask, and a write or read index overflow (at 2^31) does not invalidate the indexing. To make comparisons of indices overflow insensitve, their difference is compared to zero.

obj_DataLog Tag Buffers.vi

cenum

method

Public methods:

{read} read a point from a tag buffer at the specified index. The returned read index is incremented.

{read last} read the last point written to a tag buffer. The returned read index can be used to {read} the next point to be written.

Private methods:

{inert} internal method used to do nothing when the tag index is invalid.

{write} write a point to a tag buffer. This method is private since the public write interface is provided by the "Write Number" and "Write String" VIs.

{read oldest} read the oldest point still stored in a tag's buffer. Note that subsequent points are not guaranteed to be present during subsequent reads since writes might have occurred in the mean time. Thus, getting the maximum amount of data requires a bit of care. See for example the "Dump Tag Buffer" VI.

{initialize} initialize the buffer pool and other internal state using information stored in the tag info list object.

{cleanup} dispose of the buffer pool and other internal state.

ci32

read index in

{read} the index at which to read a datapoint from the tag's buffer.

cnclst

point in

{write} The datapoint to write to the buffer.

ci32

tag index

{initialize} {cleanup} not applicable.

Other methods: the index of the tag to which the buffer method is to be applied.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ibool

available?

{read} is the indexed point available? If false, the requested point has not yet been written. It might also be that the requested point is no longer available in the buffer, in which case an error will be returned.

{read last} is the last point available? If not, an error will be returned.

{read oldest} is an oldest point available? If not, an error will be returned.

ii32

read index out

{read}, {read oldest}, {read last} points to the next point in the buffer or to be buffered provided that the read point was available. Otherwise it points to the point for which the failed read attempt was made.

other methods: dup of read index in.

inclst

point out

{read} {read oldest} {read last} that point read from the buffer.

Other methods: duplicate of point in.

ii32

tag index dup

Duplicate of tag index in.

icclst

error out

Returns the input error or any error that occurs on execution of this VI.

Up to API index

obj_DataLog Tag Hash.vi

Efficiently associates the names of the tags in the live database with their indices. A tag index is required to access tag-specific data inside data structures set up for the live database. Only the {index tag}, {lookup}, and {#tags} methods are meant for public use. The {index tag} method retrieves the tag's name given a tag index. The {lookup} method retrieves the tag's index given a tag name. The {#tags} method returns the number of tags in the live database.

By storing the tag indices in a hash table, a lookup of a tag's index via its name becomes an O(1) operation (the execution time is independent of the number of tags). In this way, the amount of work during repeated run-time operations is reduced by proper preparation during the once-only initialization.

NOTE: the subVIs for accessing the live database mostly accept both tag indices and tag names. In the latter case, they use this object to {lookup} the tag index.

obj_DataLog Tag Hash.vi

cenum

method

Public methods:

{index tag} retrieve a tag by its tag index.

{lookup} retrieve a tag index by its tag.

{#tags} return the number of tags in the live database.

Private methods:

{initialize} initialize the hash and other internal state.

{add tag} add a tag to the hash and assign an index.

{cleanup} dispose of hash and other internal state.

{write recovery} write the internal state to disk so as to allow it to be used to recover from a crash. This should be called once all tags have been added.

{read recovery} attempts to recover the hash state from disk so that the crash recovery can commence. Crash recovery mostly entails flushing the content of the recovery file. This requires an indexable list of tags. When the system was shut down properly, this function returns an error since the recovery file will have been deleted.

{delete recovery} deletes the recovery file. This prevent a recovery from occurring during the next system startup. It should be called after the aggregation buffer has been fully flushed on shutdown.

cstr

tag in

{add tag}: will be added to the hash table.

{lookup}: used to look up the tag's index.

ci32

tag index in

{index tag} the tag whose name must be retrieved.

ccclst

error in (no error)

When an error is passed in, this VI will return without executing its actions.

ii32

#tags

istr

tag out

{index tag}: the tag with the given index.

ii32

tag index out

{lookup}: the named tag's index.

{add tag}: the assigned tag index.

Other methods: a duplicate of "tag index in".

icclst

error out

Returns the input error or any error that occurs on execution of this VI.