ADS DAQ

The ADS DAQ (Data Acquisition) VI is a LabVIEW™ Express VI for easy configuration of measuring tasks with TwinCAT 3, i.e. you can use this VI for read access to TwinCAT runtimes.

The user interface of the ADS DAQ VI guides you step by step through the configuration of your measuring task:

The configuration window opens after placing the ADS DAQ instance in the LabVIEW™ block diagram or by double-clicking. The configurations can be made with the help of the selection windows described below. After the configuration is complete, the instance creates all the necessary resources for reading the data.

ADS DAQ 1:

Save VI before using the ADS DAQ VI

The ADS DAQ VI stores the configuration of an instance in the path of the current project/VI. Therefore, it is necessary to save the project/VI beforehand.

Open ADS DAQ VI in an accelerated way

The library must be precompiled.
1. Open the settings for "Mass Compile" in the LabVIEW™ settings at Tools > Advanced.
2. Select the folder of the TwinCAT 3 Interfaces for LabVIEW™ library, e.g. C:\Program Files\ National Instruments\LabVIEW 2023\user.lib\Beckhoff-LabVIEW-Interface.
3. Start "Mass Compile".
ADS DAQ 2:

Output

Meaning

[20] Handle

Handle to the ADS client

[25] Loaded Types

An array of LabVIEW™ Enums:

  • Describes which data types have been generated.

[26] Selection

LabVIEW™ cluster consisting of two elements:

  • SymbolName: The name of the ADS symbol
  • Notification Mode: LabVIEW™ Enum
    • Single TypeResolved Queue: Reads only one sample as notification and adds the sample to the LabVIEW™ queue (only in LabVIEW™ 32-bit).
    • Single TypeResolved Control: Reads only one sample as notification and writes the sample to the LabVIEW™ display element (only in LabVIEW™ 32-bit).
    • Buffered TypeResolved Queue: Reads a number of samples as described by LVBufferSize, and adds the samples to the LabVIEW™ queue.
    • Buffered TypeResolved Control: Reads a number of samples as described by LVBufferSize, and writes the samples to the LabVIEW™ display element.
ADS DAQ 3:

Number of symbols

Currently, the ADS DAQ block supports reading a maximum of 10 ADS symbols per instance. Use multiple instances or the upgrade ADS FlexDAQ if you want to read more than 10 ADS symbols.

ADS DAQ 4:

Generation of TwinCAT 3 data types

To support all notification modes, all generated types are converted to arrays. Notifications Buffered as well as Notifications Single are supported in the same way.

Symbol selection window

This window is used to select the ADS symbols to be read with the ADS DAQ instance. The window offers three different ways to select the ADS symbols:

  1. Symbol Interface: Opens an additional graphical user interface for browsing ADS symbols.
    • Browse into the connected targets.
    • Select the desired ADS symbols and drag and drop them into the right field.
    • Optionally, in the right field you can export the selected ADS symbols as a list and save them as an XML file.
  2. Symbol File: Opens a LabVIEW™ file dialog box to read in the ADS symbols using an XML file exported from the Symbol Interface.
    • Reads only the symbols, but does not include all other settings of the ADS DAQ VI from the other configuration views.
  3. Load Previous Configuration: Loads the last configuration (if existing) with which the ADS DAQ instance has already been configured.
    • The configuration always opens as an empty configuration. If you want to adjust the existing configuration, select Load Previous Configuration.
ADS DAQ 5:

After selecting the ADS symbols, select Next.

Click Finish in the dialog at any time to save and close the configuration.

Notification selection window

In this window the notification mode is specified for individual selected ADS symbols. The Notification Mode describes on one side the way of reading (single/buffered) and on the other side the display of the read data in LabVIEW™ (control/queue). Default setting is Buffered TypeResolved Queued.

The following table describes the different properties:

 

Single TypeResolved

Buffered TypeResolved

Control

(Only recommended if the data do not need to be processed or saved)

The individual notifications are displayed directly in a LabVIEW™ control.

Notifications are first written to an intermediate buffer layer and passed into the LabVIEW™ process when the buffer is filled. The data are displayed in a LabVIEW™ control.

Queued

(Recommended if data are to be processed, saved, ...)

The individual notifications are inserted directly into a LabVIEW™ queue.

Notifications are first written to an intermediate buffer layer and passed into the LabVIEW™ process when the buffer is filled. The data are inserted into a LabVIEW™ queue.

For more information on single and buffered mode, see Communication modes and Event driven reading.

ADS DAQ 6:

Click Modify to open the Symbol Interface and make changes to the ADS symbols to be read.

Click Next to go to the next configuration page.

Type generation selection window

In this window you can select whether the respective data type of the ADS symbol to be read is to be generated as a LabVIEW™ constant or as a control/display element. Both constants and control/display elements are automatically generated in the block diagram of the VI, where the ADS DAQ instance is also located. Default setting is Control/Indicator.

ADS DAQ 7:

Measurement Job configurator

In this window the ADS DAQ instance can be configured with additional start/stop/record conditions.

Default setting is at Start: LabVIEW run and at Stop: LabVIEW Abort, no Record.

ADS DAQ 8:

Start Job

The control Start Job configures the start of the reading process. The parameter Start Condition describes the way of starting.

ADS DAQ 9:

The table below describes the transition (Last valueNew value) of different TwinCAT types with the definition of Rising and Falling Edge used here.

TwinCAT type

Rising Edge

Falling Edge

 

Last value

New value

Last value

New value

Boolean type

0

1

1

0

Numeric integer type (i8, i16, i32, i64, u8, u16, u32, u64)

< Threshold

= Threshold

> Threshold

= Threshold

Numeric rational type (float32, float64) Epsilon: 1.0 e-7

< Threshold

= Threshold

> Threshold

= Threshold

Stop Job

The control Stop Job configures the stopping of ADS notifications, i.e. the stopping of the reading process. The parameter Stop Condition describes the way of stopping.

ADS DAQ 10:

Record Job

The recording of ADS DAQ measured data can be configured with the control Record Job. After configuration and clicking Finish, the ADS DAQ instance generates an additional Block To TDMS to save the received data as a LabVIEW™ TDMS file under the specified file name and path.

ADS DAQ 11:

Click Finish to save the settings. The automatic code generation for your configuration starts.

Automatically generated code in the block diagram

In the following, two variants of the automatically generated code are explained as examples.

In the first example, the ADS DAQ VI is generated with default settings, i.e. Buffered Type Resolved Queue, Control/Indicator, Start with LabVIEW™ Run, Stop with LabVIEW™ Stop. An ADS symbol MAIN.aBuffer is read.

ADS DAQ 12:

In the second example, the start condition is changed from LabVIEW™-Run to Trigger on LabVIEW™-Event and the recording to a TDMS file is enabled.

ADS DAQ 13:

Notes on the "To TDMS" in the block diagram

The To TDMS block allows you to save ADS DAQ instance data to a LabVIEW™ TDMS file (the NI TDMS file format). This block is automatically generated by the ADS DAQ instance, but only if Queued has been selected as the notification mode, cf. ADS DAQ.

The TDMS file format provides TDMS objects and TDMS channels to hierarchically arrange data or properties (name, date, ...) among TDMS objects. The inputs Property-/Data Objects can be used to reference or classify both properties and data. The inputs Property-/Data Values help to enter measured values under TDMS objects and channels.

ADS DAQ 14:

Input/output

Meaning

[0] Path In

The path to the TDMS file

[1] Property Objects

An array of a LabVIEW™ string:

  • References a specific object (channel) for properties with the format described below:
  1. Object and channels are separated with slash "/".
  2. The list of properties is entered by a comma-separated string (",").
  3. Items 1 and 2 are separated by a colon (":").

Sample:

Property Object[0]=ObjectABC/ChannelXYZ:Name,Author,Date

TDMS Object=ObjectABC

TDMS Channel=ChannelXYZ

Property[0]=name (string)

Property[1]=author (string)

Property[2]=date (timestamp)

[2] Property Values

An array of LabVIEW™ variants:

  • Describes the values of properties.

[3] Transpose Data?

Flag to transpose the entered 2D of 3D arrays.

[5] Data Objects

An array of a LabVIEW™ string:

  • References a specific object (channel) for data.

The following format is used for referencing:

  1. Object and channels are separated with slash ("/").

Sample:

Data Object[0]=ObjectABC/ChannelXYZ

[7] Data Values

An array of LabVIEW™ variants with the following supported LabVIEW™ types:

  • LabVIEW™ waveform
  • 1D, 2D, 3D array (2D, 3D array are internally converted to 1D):
    • Boolean type
    • Integer numeric types (i8 ... i64,u8 ... u64)
    • Non-integer numeric types (float32, float64)
    • LabVIEW™ string

[4] Path Out

The path of the TDMS file

The following graphic shows an example of the To TDMS block in use.

ADS DAQ 15: