Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instrument Control System Seminar, 20 th -24 th October 2014 C++ with TwinCAT Mario Kiekebusch (On behalf everyone who took part on this work)

Similar presentations


Presentation on theme: "Instrument Control System Seminar, 20 th -24 th October 2014 C++ with TwinCAT Mario Kiekebusch (On behalf everyone who took part on this work)"— Presentation transcript:

1 Instrument Control System Seminar, 20 th -24 th October 2014 C++ with TwinCAT Mario Kiekebusch (On behalf everyone who took part on this work)

2 Instrument Control System Seminar, 20 th -24 th October 2014 Outlook  Motivation  Development  Applications  Preliminary Conclusions  Live Demo

3 Instrument Control System Seminar, 20 th -24 th October 2014 Introduction  Reuse of existing C/C++ libraries.  Reuse of in house expertise. Why is C/C++ Relevant?  Extending normal capabilities of PLC.  More efficient object code.

4 Instrument Control System Seminar, 20 th -24 th October 2014  Engineering PC  Windows XP or Windows 7  Microsoft Visual Studio 2010 and 2012, Level Professional, Premium or Ultimate.  Microsoft "Windows Driver Kit" (WDK)  TwinCAT 3 installation (XAE Engineering) Introduction

5 Instrument Control System Seminar, 20 th -24 th October 2014  Run-time Machine  Embedded PC  Windows: XP,7 or Embedded Standard  TC 3.1 (XAR Run-Time)  Licenses: TC 1300-00xx: TwinCAT 3 C++ TC 1320-00xx: TwinCAT 3 C++/Matlab TC 1210-00xx: TwinCAT 3 PLC/C++ TC 1220-00xx: TwinCAT 3 PLC/C++/Matlab Introduction

6 Instrument Control System Seminar, 20 th -24 th October 2014  Modular Design  Flexible  Scalable  Based on “Component Object Model (COM)  High Reusability  preemptive multi-tasking  parallel processing of tasks Introduction Run-time Environment

7 Instrument Control System Seminar, 20 th -24 th October 2014 Introduction  Mandatory Attributes Module  Optional Attributes

8 Instrument Control System Seminar, 20 th -24 th October 2014 Introduction State Machine Transitions:  INIT2PREOP (IP)  PREOP2SAFEOP (PS)  SAFEOP2OP(SO)  OP2SAFEOP(OS)  SAFEOP2PREOP(SP)

9 Instrument Control System Seminar, 20 th -24 th October 2014 Development Creating a Project … 1. Select New Item

10 Instrument Control System Seminar, 20 th -24 th October 2014 Creating a Project … 2. Select Project Type Development

11 Instrument Control System Seminar, 20 th -24 th October 2014 Creating a Project … 3. Selecting Module Class Development

12 Instrument Control System Seminar, 20 th -24 th October 2014 Creating a Project … 4. Entering Module Name Development

13 Instrument Control System Seminar, 20 th -24 th October 2014 Development  Project Skeleton

14 Instrument Control System Seminar, 20 th -24 th October 2014 Development

15 Instrument Control System Seminar, 20 th -24 th October 2014 Development Executing the C++ Code… 1. Creating a module instance

16 Instrument Control System Seminar, 20 th -24 th October 2014 Executing the C++ Code… 2. Triggering module execution Development

17 Instrument Control System Seminar, 20 th -24 th October 2014 Development Code Generation via TMC Editor

18 Instrument Control System Seminar, 20 th -24 th October 2014 Development Debugging … 1.Enable debugging 2. Start Debugging 3. Start TwinCAT Live Watch 4. Monitor Variables

19 Instrument Control System Seminar, 20 th -24 th October 2014 Development Deployment … 1.Publishin a module 2. Importing a module Binaries (32 & 64bit) TMC file (XML)

20 Instrument Control System Seminar, 20 th -24 th October 2014 Parameter name FunctionUnitsDV EXLOCWhere the signal is injectedEnum 0 = Disabled 1 = PosTgtE 2 = PosRefE 3 = VelTgtE 4 = VelRefE 5 = TrqTgtE 6 = TrqRefE 6 EXTYPSignal typeEnum 0 = CONSTANT 1 = SQUARE WAVE 2 = TRIANGLE WAVE 3 = SAWTOOTH 4 = SINEWAVE 5 = WHITE NOISE 6 = PINK NOISE 6 EXOFFSignal offsetrad (EXLOC = 1,2) rad/s (EXLOC = 3,4) kNm (EXLOC = 5,6) 0.0 EXAMPNot used (EXTYP = 0) Signal amplitude (EXTYP = 1,2,3,4) Signal RMS (EXTYP = 5,6) rad (EXLOC = 1,2) rad/s (EXLOC = 3,4) kNm (EXLOC = 5,6) 0.05 EXFREQSignal frequency (only used when EXTYP = 1,2,3,4) Hertz0.01 EXDUTYSignal duty cycle (only used when EXTYP = 1) Adimensional0.5 Applications  Signal Generator  Provide excitation signals – reused from ESTAC project.

21 Instrument Control System Seminar, 20 th -24 th October 2014 Applications  Signal Generator

22 Instrument Control System Seminar, 20 th -24 th October 2014 Applications  Signal Generator  Examples of signal generation

23 Instrument Control System Seminar, 20 th -24 th October 2014 Applications  Derotator and ADC  DROT: Compensate for field rotation – adapted from LCU implementation.  ADC: Provides Automatic Atmospheric Dispersion Compensation.

24 Instrument Control System Seminar, 20 th -24 th October 2014 Applications  Derotator  Time Conversion Functions

25 Instrument Control System Seminar, 20 th -24 th October 2014 Prelimnary Conclusions + Simple adaptation of existing code. + CPU consumption when running C++ modules is very low. + Opens the door for implementing more advanced applications. + Communication module to module via input/output is very simple. - Development environment (XAE) is not yet a mature product. - Some problems with Object Ids when exporting C++ code with methods called from PLC code. - Beckhoff documentation is still rather poor in many areas.

26 Instrument Control System Seminar, 20 th -24 th October 2014 Live Demo


Download ppt "Instrument Control System Seminar, 20 th -24 th October 2014 C++ with TwinCAT Mario Kiekebusch (On behalf everyone who took part on this work)"

Similar presentations


Ads by Google