Examples

The following examples were developed with different hardware.

Example 1 - Tutorial

The application of the library blocks is explained in the form of a Tutorial, including the sections 'Integration in a PLC program' and 'Configuration in the TwinCAT System Manager'. Reference is also made to the use of different hardware.

Project Download

Example 2 - Application of virtual Com ports

This example can be used for different applications with virtual Com ports.
Any data can be sent or received.

This is not really an example but a test program for testing the communication connection to the USB device. Nevertheless, as a first step it is advisable to use a Windows terminal program to test the functionality of the VirtualComPort driver of your device.

In an application that uses a virtual Com port only the call of SerialLineControlADS is specific. The other serial communication calls, such as send and receive data, are identical to actual serial ports.

Linking in the TwinCAT System Manager is not required.
The example can be used for convenient commissioning and testing of the device. The example features a visualization.

Project Download

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4016

PC or CX (x86, x64)

Tc2_SerialCom