Skip to content

Beckhoff/TC_AI_DOTNET_Samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About this repository

This repository contains official sample code for the TwinCAT Automation Interface offered by Beckhoff Automation. The sample code is provided as-is under the Zero-Clause BSD license.

The Samples are available as VisualStudio solutions here.

Requirements

VS2015 or newer with installed TwinCAT XAE Package 3.1.4022 or newer

ScriptingTestContainer

The ScriptionTestContainer demonstrates various aspects of the TwinCAT XAE Automation Interface.

The Application starts different scripts selectable by the user. The source code of these scripts is located in the 'Scripts' subfolder. To learn about, just set a breakpoint at OnExecute method of the script in the debugger and work through the statements with single step.

The OnExecute method itself is called by some infrastructural code that ensures that the script code can be called several types and is setting up / clearing up its preconditions.

Before starting script:

  • Detection of VisualStudio / TcXaeShell setups
  • Loading VisualStudio / TcXaeShell
  • Opening of an temporary TwinCAT solution/project where the script acts

After execution of the script:

  • Closing Solution
  • Shutting Down VisualStudio/TcXaeShell

CodeGenerationDemo

The Code Generation Demo located in the 'CodeGenerationDemo.sln' solution builds up from the same infrastructure like the ScriptingTestContainer demo application. But instead of demonstrating several scripts this demo shows a little application that generates (serial) Machine Configurations and PLC Code basing from a customer order database.

Here the input is coming from an 'Orders.xml' and the different machine options are generated by a combination of Automation Interface Script code and predefined configuration/program templates.

How to get support

Should you have any questions regarding the provided sample code, please contact your local Beckhoff support team. Contact information can be found on the official Beckhoff website at https://www.beckhoff.com/contact/.

Further information

Further information about this sample code can be found on the Beckhoff Information System in the Automation Interface.