ADS-Read

The ADS-Read- block is a polymorphic VI and supports the following ADS communication modes to read data from TwinCAT:

All modes use the low-level Read blocks in the background to:

1. Initialize the ADS Reader.
2. To send the ADS request.
3. To wait for answer and
4. finally release the reader from the memory.

The section Communication modes provides further information as well as practical application recommendations. In the chapter Examples you will find exemplary implementations in LabVIEW™.

Depending on the selected communication mode, the parameters configured in Symbol Interface are used or remain unused. The relevant parameters are named below.

Sync Single

In this operation mode, the ADS client (LabVIEW™) sends a request to the ADS server (TwinCAT) and waits for a response from the server in the program sequence.

Relevant parameter: Timeout

ADS-Read 1:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[5] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[4] Handle

Handle to the ADS client

[6] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[8] Read status?

Read status

[10] Ads Read Data

ADS raw data

Async Single

In this operation mode, the ADS client (LabVIEW™) sends a request to the ADS server (TwinCAT) and does not wait for a response from the server in the program sequence.

Relevant parameter: Timeout

ADS-Read 2:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[5] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[4] Handle

Handle to the ADS client

[6] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[8] Read Status

Read status

[10] ReadHdl

Handle to the ADS reader

Noti. Single

In this operation mode ADS notifications are registered to the relevant ADS symbols in TwinCAT. Only "on change" registration is possible. The ADS notification is unregistered again from the ADS server when the first "on change" notification is received in LabVIEW™.

Relevant parameters: Timeout, Transmode (= on change)

ADS-Read 3:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[5] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[7] Send

Send flag, TRUE registers the ADS notification

[4] Handle

Handle to the ADS client

[6] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[8] Read Status

Read status

[10] Ads Read Data

ADS raw data (array of two entries, previous value and current value)

Noti. Buffered

In this communication mode ADS notifications are registered on the respective ADS symbols in TwinCAT. The ADS client in LabVIEW™ also uses a buffer memory, which is first filled with feedback messages from TwinCAT before the entire buffer memory is transferred to LabVIEW™. After passing the buffered data to LabVIEW™, the ADS notification is unregistered from the server. Both ADS notification types, "on change" and "cyclic", are supported.

Relevant parameters: Timeout, Transmode, SampleTime, LVBufferSize, TCBufferSize

With Transmode = "on change" the SampleTime and the TCBufferSize are not relevant.

ADS-Read 4:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[5] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[7] Send

Send flag, TRUE registers the ADS notification

[4] Handle

Handle to the ADS client

[6] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[8] Read Status

Read status

[10] Ads Read Data

Buffered ADS raw data

E-Noti. Single

In this operating mode, ADS notifications are registered on the relevant ADS symbols in TwinCAT and then continuously transmitted to LabVIEW™ as a LabVIEW™ event. The ADS notification reports after a defined time if ElapseTimeMs is greater than zero, or remains until it is actively unregistered. For the use of user events in LabVIEW™, see LabVIEW™ documentation. In contrast to E-Noti. Buffered (see below), no LabVIEW™-side buffer memory is used in this case.

Relevant parameters: Timeout, Transmode, SampleTime, TCBufferSize

With Transmode = "on change" the SampleTime and the TCBufferSize are not relevant.

ADS-Read 5:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[1] ElapseTimeMs

Measurement duration in milliseconds:

  • ElapseTimeMs > 0: the notifications stop after the time has elapsed.
  • ElapseTimeMs = 0: the notifications must be stopped from outside.

[5] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[7] Send

Send Flag, TRUE starts the ADS notification

[9] user event

Reference to user event

[4] Handle

Handle to the ADS client

[6] SymbolName

The ADS symbol consisting of AMSNetId and symbol name

E-Noti Buffered

In this operating mode, ADS notifications are registered on the relevant ADS symbols in TwinCAT and then continuously transmitted to LabVIEW™ as a LabVIEW™ event. The ADS notification reports after a defined time if ElapseTimeMs is greater than zero, or remains until it is actively unregistered. For the use of user events in LabVIEW™, see LabVIEW™ documentation. In contrast to E-Noti. Single (see above), a LabVIEW™-side buffer memory of size LVBufferSize is used in this case. When the buffer is filled the collected data are passed to LabVIEW™ via an event.

Relevant parameters: Timeout, Transmode, SampleTime, TCBufferSize, LVBufferSize

With Transmode = "on change" the SampleTime and the TCBufferSize are not relevant.

ADS-Read 6:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[1] ElapseTimeMs

Measurement duration in milliseconds:

  • ElapseTimeMs > 0: the notifications stop after the time has elapsed.
  • ElapseTimeMs = 0: the notifications must be stopped from outside.

[5] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[7] Send

Send Flag, TRUE starts the ADS notification

[9] user event

Reference to user event

[4] Handle

Handle to the ADS client

[6] SymbolName

ADS symbol consisting of AMSNetId and symbol name

E-Noti. Multiple Symbols

This operation mode works like E-Noti. Buffered, except that this VI can be used for several ADS symbols at the same time.

Relevant parameters: Timeout, Transmode, SampleTime, TCBufferSize, LVBufferSize

With Transmode = "on change" the SampleTime and the TCBufferSize are not relevant.

ADS-Read 7:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[1] ElapseTimeMs

An array of U32 consisting of measurement duration in milliseconds:

  • Element of ElapseTimeMs > 0: the notifications stop after the time expires.
  • Element of ElapseTimeMs = 0: the notifications must be stopped externally.

[5] Symbols

An array of LabVIEW™ strings:

  • The ADS symbol consisting of AMS address and symbol name

[9] Noti. E-Buffered Event Refs

An array of references to user event

[4] Handle

Handle to the ADS client

[6] SymbolName

The ADS symbol consisting of AMS address and symbol name

LVB-Noti. Single Symbol

This operation mode works like E-Noti. Buffered, except that this VI provides direct access to LVBuffer instead of using LabVIEW™ events. As a result, no LabVIEW™ events are required to read the notifications.

Relevant parameters: Timeout, Transmode, SampleTime, LVBufferSize, TCBufferSize

With Transmode = "on change" the SampleTime and the TCBufferSize are not relevant.

ADS-Read 8:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[1] ElapseTimeMs

Measurement duration in milliseconds:

  • ElapseTimeMs > 0: the notifications stop after the time has elapsed.
  • ElapseTimeMs = 0: the notifications must be stopped from outside.

[5] SymbolName

ADS symbol consisting of AMSNetId and symbol name

[9] LVBuffer Handle

Handle to the LVBuffer

[4] Handle

Handle to the ADS client

[6] SymbolName

ADS symbol consisting of AMSNetId and symbol name

LVB-Noti. Multiple Symbols

This operation mode works exactly like LVB-Noti. Single Symbol, with the difference that this VI can be used for several ADS symbols at the same time.

Relevant parameters: Timeout, Transmode, SampleTime, LVBufferSize, TCBufferSize

With Transmode = "on change" the SampleTime and the TCBufferSize are not relevant.

ADS-Read 9:

Input/output

Meaning

[0] Handle

Handle to the ADS client

[1] ElapseTimeMs

An array of U32 consisting of measurement duration in milliseconds:

  • Element of ElapseTimeMs > 0: the notifications stop after the time expires.
  • Element of ElapseTimeMs = 0: the notifications must be stopped externally.

[5] Symbols

An array of LabVIEW™ strings:

  • The ADS symbol consisting of AMS address and symbol name

[9] LVBuffer Handle

An array of U32 consisting of handle on LVBuffer

[4] Handle

Handle to the ADS client

[6] Symbols

An array of LabVIEW™ strings:

  • The ADS symbol consisting of AMS address and symbol name