Application example

The TwinCAT Solution and the corresponding VI (for x86 and x64 LabVIEW™ bit version) can be downloaded here: Application Example.

The VIs are currently compiled with LabVIEW™ 2017 and can be used for subsequent LabVIEW™ versions (2018, 2019, 2020, 2021, 2022) as well.

Description of the example

TwinCAT: The TwinCAT project generates signals in the PLC via signal generator function blocks (sine, amplitude modulated signal, triangle signal, ....). The PLC runs with a cycle time of 5 ms. The signal generator generates 10 values per cycle for the generated signals. Accordingly, an oversampling of 10 is simulated here with the Beckhoff measurement terminals.

LabVIEW™: The LabVIEW™ project uses the Basic examples example to read the ADS notifications as LabVIEW™ events. Two while loops are used in parallel.

  1. The first while loop receives the ADS notifications and converts the raw ADS data to an appropriate LabVIEW™ data type "Variant" using the TypeResolver. The converted raw data is then inserted into a queue.
  2. The second while loop reads the elements from the queue and uses the "Variant to Data" block to finally display the data in a graph. The received data and the ADS timestamps are displayed in two different graphs.

Opening and starting the example

The example contains a TC3 folder and a LabVIEW folder. In the TC3 folder there is a tnzip, which you can open with TwinCAT 3 via File > Open > Open Solution From Archive and then save as TwinCAT Solution on your PC.

You can start the TwinCAT Solution with activate configuration on the target system of your choice. Make sure that a TF3710 license is available on your target system. If you do not have a valid license, you can create a 7-day trial license.

If your TwinCAT runtime is active, you can display the generated signals in TwinCAT with the TC3 Scope. Depending on the selected target system, you only have to select your target system in the properties under
TC Signals > DataPool > aAM (aNoise_1, aNoise_2, aSine).

In the LabVIEW folder select either 32bit (x86) or 64bit (x64) and open the VI contained in it. When you start the program the interface icon opens. Navigate to your target system and select one of the signals.

Application example 1: