LabVIEW™ VIs

The TwinCAT 3 Interface for LabVIEW™ provides controls and VIs for use in LabVIEW™.

The VIs are located in the block diagram in the functions palette: Functions > User Libraries > Beckhoff-LabVIEW-Interface.

LabVIEW™ VIs 1:

The main folder contains the basic VIs that can be used to build a program for reading via ADS, writing via ADS, TypeResolving and releasing the ADS client. In addition, the main folder contains the subfolders: Low-Level, With TypeResolving and Utilities.

Low-Level

The Low-Level subfolder contains Low-Level-VIs. The low-level VIs operate based the same principle as the basic VIs. The low-level VIs involve a little more programming effort but offer higher performance (in terms of data throughput) than the basic VIs and more flexibility for realizing complex programs. Reading with Polling Cycle is an example that uses low-level VIs for fast reading via ADS. Writing with polling cycle is a similar example. Not only reading and writing can be accelerated in this way, but also TypeResolving, see Continous Read, for example.

The table describes the subfolders and their contents and function:

Subfolder

VIs

Function

Init

Base Init

Initializes the ADS client.

Get List of ReadWrite Symbols

Creates a list of ADS read and write symbols.

Get List of Registered Targets

Creates a list of registered ADS target systems.

Read

Init Reader

Initializes the ADS Reader.

Send Reader-Request

Sends a request to the ADS server.

Register Notification

Registers the notification on the ADS server.

TryReadData

Checks the response from the server and reads the data stream.

Release Reader

Releases the reader from memory.

Write

Init Writer

Initializes the ADS Writer.

Send Writer Request

Sends a request to the ADS server.

CheckWriteStatus

Checks for the response from the ADS server to ascertain whether the data packet was received.

Release Writer

Releases the writer from memory.

SumUp

Init SumUp

Initializes the ADS-SumUp.

Add SubCommand

Adds a new command to the SumUp.

Put Data

Puts new data to the initialized command that is to be written to TwinCAT.

Get Data

Gets data from a SumUp command that was read from TwinCAT.

Enable Autosend

Enables automatic sending of SumUp commands.

Send SumpUp

Sends all SumUp commands to the TwinCAT runtime.

Release SumUp

Releases the SumUp handle in the memory.

TypeResolver

Init Type

Initializes the TypeResolver.

Resolve From TC Type

Converts the TwinCAT 3 data type to a LabVIEW™ data type variant.

Resolve To TC Type

Converts the LabVIEW™ data type variant into a TwinCAT 3 data type.

Release Type

Releases the TypeResolver from memory.

LabVIEW™ VIs 2:

With TypeResolving

The With TypeResolving subfolder contains two VIs for reading and writing via ADS with integrated TypeResolver block.

LabVIEW™ VIs 3:

Utilities

The Utilities subfolder contains additional VIs for the following purposes:

Subfolder

VIs

Function

Notification

ADS To LabVIEW Timestamp

Converts ADS timestamps to LabVIEW™ timestamps.

Notification Data To Variant Array

Builds an array of LabVIEW™Variant from the notification data stream.

Stop Notification

Stops the ADS notifications.

Start Notification

Starts the ADS notifications.

Unregister Notification

Unregisters the notification on the server.

LVBuffer

Init LVBuffer Handle

Initializes a handle for reading an ADS notification using the LabVIEW™-side data buffer.

Read From LVBuffer

Reading data from the data buffer

LVBuffer status

Reading the number of samples in the data buffer

Release LVBuffer Handle

Releases the handle to the data buffer

Routes

Get Routes

Reads all target systems that are connected to the local TwinCAT system.

Get Route Info

Specifies all subsystems and ports for a target system.

CoE

Read CoE List

Reads a CoE directory of a terminal and lists the available CoE objects.

Read CoE Description

Reads the description of a CoE object and specifies the sub-elements.

Read CoE Entry

Reads an entry from a CoE directory and outputs the properties.

Read CoE Value

Reads the value of a CoE entry.

Write CoE Value

Writes the value of a CoE entry.

Project Automation

Init Project

Initializes a TwinCAT 3 engineering project. Either an existing project is opened or a new one is created.

Create Task

Creates a task in a TwinCAT 3 project or changes the task parameters.

Scan IO

Checks existing inputs and outputs on the target system and adds them to the project tree.

Create PLC

Creates a PLC within a TwinCAT 3 project.

Activate Solution

Activating a TwinCAT 3 project.

Release Project

Releases the handle to the TwinCAT 3 project.

Heartbeat

Init Heartbeat

Creates a Heartbeat instance with a handle.

Run Heartbeat

Starts connection monitoring.

Stop Heartbeat

Stops connection monitoring.

Release Heartbeat

Releases the handle to the Heartbeat instance from memory.

Get RTD Estimate

Indicates the current estimate of the Round Trip Delay.

 

Heartbeat

Initializes, starts and stops connection monitoring in a VI.

 

Generate Type

Generates a corresponding constant or control with the LabVIEW™ data types for a symbol using the TypeInfo of the TypeResolver.

 

Check License

Checks the license state on a given target system.

Set Device State,
Get Device State

Reads or changes the state of an ADS device.

Get Version Info

Provides information regarding the product version.

LabVIEW™ VIs 4:

Controls

The controls are located in the front panel in the controls palette under: User Controls > Beckhoff-LabVIEW-Interface.

LabVIEW™ VIs 5:

The Notification subfolder contains controls that are required when initializing the LabVIEW™ event for ADS notifications.

Furthermore, the subfolder “TypeGenerator” contains TypeGenerator class objects to convert TwinCAT types into LabVIEW™ types (see Generate LabVIEW™ type).

The following table describes the function of the controls:

Subfolder

Controls

Function

Notification

Single User-Event Data

Control for initializing a LabVIEW™ event for Single ADS notifications.

Buffered User-Event Data

Control for initializing a LabVIEW™ event for Buffered ADS notifications.

TypeGenerator

CBase

Class object; base class of the TypeGenerator

CBool

Class object; Boolean class of the TypeGenerator.

CNumeric

Class object; numeric class of the TypeGenerator.

CString

Class object; LabVIEW™ string class of the TypeGenerator.

CArray

Class object; array class of the TypeGenerator.

CTimestamp

Class object; LabVIEW™ timestamp class of the TypeGenerator.

CCluster

Class object; LabVIEW™ cluster class of the TypeGenerator.