Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

124
Manual TC3 Scope View TwinCAT 3 1.5 2017-07-28 TE13xx Version: Date: Order No.:

Transcript of Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Page 1: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Manual

TC3 Scope View

TwinCAT 3

1.52017-07-28TE13xx

Version:Date:Order No.:

Page 2: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...
Page 3: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Table of Contents

TC3 Scope View 3Version: 1.5

Table of Contents1 Foreword .................................................................................................................................................... 5

1.1 Notes on the documentation...........................................................................................................  51.2 Safety instructions ..........................................................................................................................  6

2 Overview..................................................................................................................................................... 7

3 Installation................................................................................................................................................ 103.1 System requirements....................................................................................................................  103.2 Downloading the setup file............................................................................................................  103.3 Installation.....................................................................................................................................  103.4 After the Installation ......................................................................................................................  133.5 Licensing.......................................................................................................................................  14

4 Configuration ........................................................................................................................................... 194.1 Architecture...................................................................................................................................  194.2 Scope menu..................................................................................................................................  244.3 Toolbar..........................................................................................................................................  264.4 Scope properties...........................................................................................................................  284.5 YT-Graph ......................................................................................................................................  29

4.5.1 YT chart properties........................................................................................................... 304.5.2 YT axis properties ............................................................................................................ 334.5.3 YT channel style............................................................................................................... 354.5.4 YT channel acquisition..................................................................................................... 37

4.6 XY-Graph......................................................................................................................................  384.6.1 XY chart properties .......................................................................................................... 394.6.2 XY-axis properties............................................................................................................ 424.6.3 XT channel style............................................................................................................... 454.6.4 XY channel acquisition..................................................................................................... 47

4.7 Bar Chart ......................................................................................................................................  494.7.1 Bar chart properties.......................................................................................................... 494.7.2 Bar axis properties ........................................................................................................... 514.7.3 Bar channel style ............................................................................................................. 544.7.4 Bar channel acquisition.................................................................................................... 55

4.8 Recording .....................................................................................................................................  574.8.1 Target Browser................................................................................................................. 57

4.9 Cursor ...........................................................................................................................................  594.10 Trigger ..........................................................................................................................................  634.11 Saving and exporting data ............................................................................................................  67

4.11.1 Saving and loading .......................................................................................................... 674.11.2 Export CSV / Binary ......................................................................................................... 684.11.3 Export tdms / dat .............................................................................................................. 724.11.4 Automated export............................................................................................................. 72

4.12 Reporting ......................................................................................................................................  724.13 Support Information Report ..........................................................................................................  754.14 Scope options ...............................................................................................................................  77

4.14.1 Options dialog .................................................................................................................. 774.14.2 Multiple selection.............................................................................................................. 78

5 .NET API ................................................................................................................................................... 805.1 ScopeViewControl integration ......................................................................................................  80

5.1.1 Sample YT Chart.............................................................................................................. 81

Page 4: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Table of Contents

TC3 Scope View4 Version: 1.5

5.1.2 Sample XY Chart ............................................................................................................. 865.1.3 Sample YT Cursor............................................................................................................ 915.1.4 Sample Scope Export ...................................................................................................... 985.1.5 Sample Array Bar Chart ................................................................................................... 99

5.2 Integration in a WPF (Windows Presentation Foundation) project .............................................  1065.3 API Documentation.....................................................................................................................  106

6 Samples.................................................................................................................................................. 1086.1 TwinCAT 3 Scope View – first steps...........................................................................................  108

7 Appendix ................................................................................................................................................ 1167.1 FAQ - frequently asked questions and answers .........................................................................  1167.2 How To's .....................................................................................................................................  117

7.2.1 Oversampling recordings with the TwinCAT 3 Scope.................................................... 1177.2.2 Opening .svd files from a network directory ................................................................... 120

7.3 Support and Service ...................................................................................................................  122

Glossary ................................................................................................................................................. 124

Page 5: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Foreword

TC3 Scope View 5Version: 1.5

1 Foreword

1.1 Notes on the documentationThis description is only intended for the use of trained specialists in control and automation engineering whoare familiar with the applicable national standards.It is essential that the documentation and the following notes and explanations are followed when installingand commissioning the components. It is the duty of the technical personnel to use the documentation published at the respective time of eachinstallation and commissioning.

The responsible staff must ensure that the application or use of the products described satisfy all therequirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly underdevelopment.We reserve the right to revise and change the documentation at any time and without prior announcement.No claims for the modification of products that have already been supplied may be made on the basis of thedata, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®, XFC® and XTS® are registeredtrademarks of and licensed by Beckhoff Automation GmbH.Other designations used in this publication may be trademarks whose use by third parties for their ownpurposes could violate the rights of the owners.

Patent Pending

The EtherCAT Technology is covered, including but not limited to the following patent applications andpatents:EP1590927, EP1789857, DE102004044764, DE102007017835with corresponding applications or registrations in various other countries.

The TwinCAT Technology is covered, including but not limited to the following patent applications andpatents:EP0851348, US6167425 with corresponding applications or registrations in various other countries.

EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH,Germany

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.The reproduction, distribution and utilization of this document as well as the communication of its contents toothers without express authorization are prohibited.Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of apatent, utility model or design.

Page 6: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Foreword

TC3 Scope View6 Version: 1.5

1.2 Safety instructions

Safety regulations

Please note the following safety instructions and explanations!Product-specific safety instructions can be found on following pages or in the areas mounting, wiring,commissioning etc.

Exclusion of liability

All the components are supplied in particular hardware and software configurations appropriate for theapplication. Modifications to hardware or software configurations other than those described in thedocumentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG.

Personnel qualification

This description is only intended for trained specialists in control, automation and drive engineering who arefamiliar with the applicable national standards.

Description of symbols

In this documentation the following symbols are used with an accompanying safety instruction or note. Thesafety instructions must be read carefully and followed without fail!

DANGER

Serious risk of injury!Failure to follow the safety instructions associated with this symbol directly endangers thelife and health of persons.

WARNING

Risk of injury!Failure to follow the safety instructions associated with this symbol endangers the life andhealth of persons.

CAUTION

Personal injuries!Failure to follow the safety instructions associated with this symbol can lead to injuries topersons.

Attention

Damage to the environment or devicesFailure to follow the instructions associated with this symbol can lead to damage to the en-vironment or equipment.

Note

Tip or pointerThis symbol indicates information that contributes to better understanding.

Page 7: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Overview

TC3 Scope View 7Version: 1.5

2 OverviewTwinCAT 3 Scope is the charting and analysis tool for TwinCAT. Variables in TwinCAT can be recorded anddisplayed graphically. Sampling rates can be adjusted individually for each channel. Recordings in the µsrange and long-term recordings over several days are equally possible. Due to division into a Scope Viewwith multi-core support for the display of the signals and a Scope Server for the recording of the values, it ispossible it to connect to servers distributed in the field from a central View. A tool is thus available not onlyfor machine commissioning, but also for process monitoring. The TwinCAT 3 Scope functionality includescursor tools and trigger functions.

TwinCAT 3 Scope also sets new standards for Engineering. Like TwinCAT 3 itself, it is integrated inMicrosoft Visual Studio. It is thus possible to use TwinCAT 3 projects and Scope projects in parallel in asingle solution. Variables can be shifted very simply from the TwinCAT 3 project to a Scope configuration. Ofcourse the Scope can also still be used as a standalone tool in the framework of the Visual Studio shell.

Due to the constantly increasing range of functions required of data analysis tools, the TwinCAT 3 Scope issubdivided into product levels with different ranges of features. The TwinCAT 3 Scope Base contains alicense-free View and a license-free Server. Both are installed together with TwinCAT 3 XAE.

Product note

The TwinCAT 3 Scope software consists of two products:

• TwinCAT 3 Scope View is a TwinCAT 3 engineering product and supplies the graphic interface for theconfiguration of recordings and the display of signal curves. The View is available in different productlevels and is licensed for the device on which it is displayed. This document contains the technicalproduct description.

• TwinCAT 3 Scope Server is a TwinCAT 3 function and provides the software for data logging. Theserver sends the recorded data to the View. The software is installed on distributed devices or on thelocal target device. The server license is issued for the device on which the server runs. In most casesthe Base version, which is installed together with TwinCAT XAE or the Scope View, is sufficient. Theserver license is only required if it is used independently, i.e. without View, e.g. for control via a PLCfunction block. The TwinCAT 3 Scope server is documented separately as part of the TwinCAT 3functions.

Both components must be available in the system in order to be able to use the Scope.

Principle of operation

The TwinCAT Scope View communicates over ADS with the Scope Servers distributed in the system. Thelocal server, which is located with the View on a system, can be used for the recording of local variables.However, it is also used whenever saved Scope data files are opened in the View. The View displays thesignal curves and is used for the configuration of recordings.

Product level / feature list

The following table shows which functionalities are available with which TwinCAT Scope level and thecorresponding licensing arrangement.

Page 8: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Overview

TC3 Scope View8 Version: 1.5

Features Scope Base Scope ServerFull Licence

Scope View Professional

Server View Server ViewFull 7 days trial

versionFull 7 days trial

versionGeneral:Free of charge

Local record

Remote Recordusing TargetServerRemote Recordusing LocalServerScope ControlIntegration

- - -

Long TimeRecords > 1h

- - -

ApplicationSettings (TC3.0)

- - -

Ring Buffer

Auto Save - - -

Restart Record - - -

View MulticoreSupport

- - -

Base:CreateConfiguration

- - -

Target BrowserFilter

- - -

IndividualSample Rate

- - -

Drag and DropforConfiguration

- - -

DockingWindows

- - -

YT Time basedCharts

- - -

YT OverviewChart

- - -

Stacked Y-Axes - - -

XY Charts - - -

Array BarCharts

- - -

Logarithmic Y-Axes

- - -

Page 9: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Overview

TC3 Scope View 9Version: 1.5

Features Scope Base Scope ServerFull Licence

Scope View Professional

Chartsynchronization

- - -

Master Chartsynchronisation

- - -

Channel Marks - - -

Channel Offset - - -

Channel Scaling - - -

Panning - - -

Zoom - - -

Cursor - - -

Fillmode - - -

Print Report - - -

Extended dataexport withExport Tool

- - -

Trigger:Event Marker - - -

Start Record - - -

Stop Record - - -

Stop Display - - -

Restart Display - - -

Start Subsave - - -

Stop Subsave - - -

Page 10: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View10 Version: 1.5

3 Installation

3.1 System requirementsThe following system requirements must be fulfilled for proper functioning of the TwinCAT 3 Scope View.

Supported operating systems

Windows XP, Windows XP Embedded, Windows Embedded Standard 2009, Windows 7

TwinCAT

Minimum is TwinCAT 3 ADS.

.NET Framework

.NET Framework 4.0 is required.

The TwinCAT 3 Scope Base is installed together with TwinCAT 3 XAE. The further product levels andfeatures are enabled by licensing. If you use a newer Scope version outside a TwinCAT 3 XAE update, or ifyou want to install the Scope in stand-alone mode on a PC without TwinCAT 3 Engineering, you candownload the corresponding setup file from the internet.

Scope View can be licensed as a full version or as a 7-day test version. For limitations of the test version,please refer to the product overview page.

3.2 Downloading the setup fileTwinCAT Scope View is available for download from the Beckhoff website. In each case the latest productversion that can be licensed for each product level is made available. To download the setup file, perform thefollowing steps:

1. Start a web browser of your choice and go to the Beckhoff website at www.beckhoff.de.2. In the tree structure of the website, navigate to the node Automation > TwinCAT 3 > TE1xxx |

 TC3 Engineering > TE13xx | TC3 Scope View Professional.3. Click on the Download link in order to place the software in the shopping cart. Then click on Start

download.4. (Optional) Transfer the downloaded file to the TwinCAT runtime system you wish to install the product

on.

3.3 InstallationDescription of the installation procedure of a TwinCAT 3 Function for Windows-based operating Systems.

1. Double-click the downloaded setup file TFxxxx.Please note: Under Windows 32-bit/64-bit, please start the installation with "Run as Administrator" byright-clicking the setup file and selecting the corresponding option in the context menu.

Page 11: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View 11Version: 1.5

2. Click Next and accept the license agreement.

3. Enter your user information in the specified area.

Page 12: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View12 Version: 1.5

4. To install the full product, including all sub-components, please choose Complete as the Setup Type.Alternatively, you can also install each component separately by choosing Custom.

5. Click Next and Install to start the installation.

The TwinCAT system must be stopped before proceeding with installation.

Page 13: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View 13Version: 1.5

6. Confirm the Dialog with Yes.

7. Select Finish to end the installation process.

ð The installation is now complete.

After a successful installation, the TC 3 Function needs to be licensed. [} 14]

3.4 After the InstallationThe next step after successful installation is licensing of the products “TE130x Scope View” and/or “TF3300Scope Server”. By default the product level “Base” is active, which is available without a license. Theadvanced functionality can be enabled through corresponding licensing, e.g. for the product level“Professional”. Further steps then are:

• First steps with TwinCAT 3 Scope [} 108]

• Detailed documentation of the individual functions [} 19]

• The integration of TwinCAT 3 Scope View Control into your own .NET-based visualization [} 80]

Page 14: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View14 Version: 1.5

3.5 LicensingThe TwinCAT 3 functions are available both as a full and as a 7-Day trial version. Both license types can beactivated via TwinCAT XAE.For more information about TwinCAT 3 licensing, please consult the TwinCAT 3Help System.The following document describes both licensing scenarios for a TwinCAT 3 function onTwinCAT 3 and is divided into the following sections:

• Licensing a 7-Day trial version [} 14]

• Licensing a full version [} 15]

Licensing a 7-Day trial version1. Start TwinCAT XAE2. Open an existing TwinCAT 3 project or create a new project3. In Solution Explorer, please navigate to the entry System\License

4. Open the tab Manage Licenses and add a Runtime License for your product (in this screenshotTE1300: TC3 Scope View Professional)

5. Optional: If you would like to add a license for a remote device, you first need to connect to the remotedevice via TwinCAT XAE toolbar

Page 15: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View 15Version: 1.5

6. Switch to the tab Order Information and click the button Activate 7 Days Trial License... to activate atest version

7. Please restart TwinCAT 3 afterwards.

Licensing a full version8. Start TwinCAT XAE9. Open an existing TwinCAT 3 project or create a new project

10. In Solution Explorer, please navigate to the entry SYSTEM\License

11. Open the tab Manage Licenses and add a Runtime License for your product (in this screenshotTE1300: TC3 Scope View Professional).

Page 16: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View16 Version: 1.5

12. Optional:If you would like to add a license for a remote device, you first need to connect to the remotedevice via TwinCAT XAE toolbar

13. Navigate to the Order Information tabThe fields System-ID and HW Platform cannot be changed and just describe the platform for thelicensing process in general a TwinCAT 3 license is always bound to these two identifiers:the System-ID uniquely identifies your system.The HW Platform is an indicator for the performance of the device.

14. Optionally, you may also enter an own order number and description for your convenience

15. enter the Beckhoff License ID and click on Generate License Request File.... If you are not aware ofyour Beckhoff License ID please contact your local sales representative.

16. After the license request file has been saved, the system asks whether to send this file via E-Mail to theBeckhoff Activation Server

17. After clicking Yes, the standard E-Mail client opens and creates a new E-Mail message to"[email protected]" which contains the "License Request File"

18. Send this Activation Request to BeckhoffNOTE! The License Response File will be sent to the same E-Mail address used for sending out

the License Request File

Page 17: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View 17Version: 1.5

19. After receiving the activation file, please click on the button Activate License Response File... in theTwinCAT XAE license Interface.

20. Select the received License response file and click on Open

21. The License Response File will be imported and all included licenses will be activated. If there havebeen any trial licenses, these will be removed accordingly.

Page 18: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Installation

TC3 Scope View18 Version: 1.5

22. Please restart TwinCAT to activate licenses.

NOTE! The license file will be automatically copied to...\TwinCAT\3.1\Target\License on thelocal device.

Page 19: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 19Version: 1.5

4 Configuration

4.1 ArchitectureNot only are signal curves represented in the TwinCAT Scope View; recording configurations are alsocreated. For the creation of these configurations it is important to be familiar with the architecture of theScope View. The architecture is reflected in the tree structure within the Measurement Project in theSolution Explorer.

Scope architecture

Page 20: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View20 Version: 1.5

Measurement Scope Project: Main level, at which several Scopes can be added. The Scopes within a project can be controlledindependently of one another.

Standard Scope Project: A Scope always stands for a recording configuration. This means that all elements inserted below it aresubject to the same recording settings. If a Scope is selected, the setting options such as recording time andring buffer are displayed in the Visual Studio Properties window.See also: Scope properties [} 28]

YT Chart: Several YT charts can exist in parallel in a Scope. They are the actual display area in the view and providethe timebase. Each chart has its own toolbar for changing the display. The color and axis settings can bemade in the Properties window. Clicking on the signal curve in the chart highlights the respective channel inthe Solution Explorer.See also: YT chart properties [} 30]

Axis: An (YT or XY) chart can feature several axes. An axis provides the range of values for the connectedchannels. Amongst others, the automatic or free scaling can be set in the Properties window.See also: Axis properties [} 33]

Channel: A channel represents the style characteristics of a selected variable. In the Properties window the color,marks and other parameters can be set. Double-clicking on the channel highlights the respective signal inthe chart.

Acquisition: The acquisition contains information on the actually selected variables.

Cursor: Cursors are hierarchically assigned to the charts. X and Y cursors can be added within a chart. The CursorTool window shows the current values of the signal/cursor interface and the differences compared with othercursors. Any desired number of X and Y cursors can be set.See also: Cursor properties [} 59]

XY Chart: Several XY charts can exist in parallel in a Scope. They represent the actual display area in the view. Eachchart has its own toolbar for changing the display. The color and scaling settings can be made in theProperties window. Clicking on the signal curve in the chart highlights the respective channel in theSolution Explorer.See also: XY chart properties [} 39]

Array Bar Chart:An array bar chart can connect to an array in the controller and display each array element as a bar. Severalarray bar charts can exist in parallel in a Scope. The settings for the chart can be entered in the Propertieswindow.

Trigger:Triggers are assigned to the Scopes in the tree structure of the Scope View. The Trigger action, e.g. StopRecord, can be set in the Properties window of the Trigger group. The lower-level triggers can be logicallylinked to form a trigger condition. The variable selection also takes place here in the Properties window.See also: Trigger properties [} 63]

Window

The interfaces for the control of the Scope View are divided into several individual windows (Tool windows)and their position and size are freely configurable.

Page 21: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 21Version: 1.5

Overview of the individual windows:

Solution Explorer Display of the project structure within a solution.Cursor [} 59] Display of the values present at the X/Y-cursor.Error List List of errors, warnings and messages. Each scope

project lists the generated messages independentlyhere. The messages for the respectively selectedScope can be deleted via the context menu itemClear Error List.

Target Browser [} 57] With the Target Browser you can be add Scopeconfiguration channels via their symbol names.

Properties Under Properties, the settings for the respectiveelement selected in the Solution Explorer can bemodified.

ScopeViewControl Display of the individual charts. The charts can bedisplayed next to each other or in overlapping tabswithin the control, exactly like all other windows.

Page 22: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View22 Version: 1.5

Configuration

The following section explains how to create and edit a Scope configuration. The way in which the propertiesof the respective elements can be changed is described in the description of the associated window.

Creation of a Measurement project

In the menu File > New select the command Project. In the dialog that opens select the category TwinCATMeasurement and the required template.

List of the available templates:

Empty Measurement Project Empty Measurement Project. Scope configurations(.sv2 | .tcscope) or scope data (.svd) cansubsequently be inserted here.

Scope YT Project Contains a Scope instance and a preconfigured YTchart with a corresponding axis.

Scope YT Project with Reporting See “Scope YT Project”  + a ready-made printingtemplate for printing charts.

Scope YT NC Project Contains a Scope instance, which was speciallypreconfigured for working with drive axes. Thetemplate can easily be extended to the number ofactually configured drive axes.

Scope XY Project Contains a Scope instance and a preconfigured XYchart with a corresponding axis.

Scope XY Project with Reporting See “Scope XY Project” + a ready-made printingtemplate for printing charts.

Scope Array Bar Project Contains a Scope instance and a preconfigured arraybar chart with a corresponding axis.

Addition of a Scope/report to a Measurement Project:

In the context menu of the Measurement project select the command Add > New Item..., then select therequired template in the dialog that opens.

Page 23: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 23Version: 1.5

List of the available templates:

Scope Project Scope instance with a pre-configured chart and anaxis.

Scope NC Project Scope instance that has been specially pre-configured for working with axes.

Standard Report Printing template for printing charts.

In the context menu of the Measurement project select the command Add > Existing Item, then select therequired file (.tcscope | .sv2 | .svd | .rdlc) in the dialog that opens or drag & drop the required file to theproject in the Solution Explorer.

Addition of individual elements

New Chart In the context menu of the Scope instance select New YT Chart or New XY ChartNew axis Select New Axis in the context menu of the Scope / chart instanceNew channel • Select New Empty Channel in the context menu of the Scope / chart instance.

• Dragging & dropping symbol data from the Target Browser to an existingScope / chart / axis instance.

• In the PLC editor, select Add to Scope in the context menu of variables.

Deletion of elements

In the Solution Explorer, select the element to be deleted and press the [Del] key or select the Deletecommand in the context menu.

Moving and copying individual elements• Each element can be moved with drag & drop in the Solution Explorer. In doing so it must always be

added to an element that is one level higher in the hierarchy.• If you move an element to another Scope, it is copied. Thus it is still available in the original Scope.• The described moving operations are available within a Scope even after the start of recording.• If you press the [Ctrl] key during drag & drop, the selected element is copied instead of moved.

Saving a Scope configuration:

In the File menu select the command Save. (default keyboard shortcut: [Ctrl] + [S])

Page 24: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View24 Version: 1.5

Loading a Scope configuration• In the menu File > Open select the command Project/Solution, then select the solution or the

Measurement project in the dialog that opens.• Scope files (.tcscope | .sv2 | .svd) can be opened directly by double-clicking. Since a Measurement

project is missing as a basis, a selection dialog appears in which you can create a new project. TheScope called up by double-clicking is added to the newly created project (a copy of the file is placed inthe new project directory). The “Empty Measurement Project” template is useful in this context.

• Measurement project files (.tcmproj) and solutions (.sln) can be opened directly by double-clicking.

Sending projects by email

In the context menu of the Scope instance to be sent, select the command Send Project by Email

If the Scope contains data (Scope state: replay), you can select whether the data should also be sent.

Disabling and enabling a channel

A channel can be disabled in the configuration in order to prevent it being recorded. However, it is retainedwhen saving the configuration.

In the Solution Explorer select the channel to be deactivated, and in the Properties view set the propertyDisabled to “TRUE”.

4.2 Scope menuThe Scope functions are accessible via the menu. The menu content may differ, depending on the nodeselected in the Solution Explorer. (For this reason the screenshot shown below differs from the description.)The Scope menu also shows the corresponding key assignments.

Page 25: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 25Version: 1.5

Page 26: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View26 Version: 1.5

Target Browser Opens the Target Browser.Cursor Window Opens the cursor window.Send Project By E-Mail... Corresponds to the command Send Project By E-

Mail... in the context menu of the Scope instance tobe sent.If the Scope contains data (Scope state: replay), youcan select whether the data should also be sent.

Clear Error List Deletes all entries (Error | Warning | Message) of thecurrently active Scope from the error list.

Change Ads Symbol... Dialog for the replacement of character strings. Thesymbol names of all channels located below theselected element are edited.

Change Index Group... Dialog for incrementing / decrementing the IndexGroup / Index Offset. The acquisitions of all channelslocated below the selected element are edited.

New YT Chart Creates a new YT chart within the Scope.New XY Chart Creates a new XY chart within the Scope.New Array Bar Chart Creates a new array bar chart within the Scope.New Axis Creates a new axis within the chart. If the selected

element is not a chart, then a new chart isadditionally created.

New Empty Channel Creates a new channel within the axis. If no axis isselected, then a new axis is additionally created.

Delete Deletes the element currently selected in the SolutionExplorer.

Export to CSV Export to a CSV or TXT file.Export to Binary Export to a binary file.Export to DAT Export to a DAT file.Export to TDMS Export to a TDMS file.Extract Scope Configuration Extracts the Scope Configuration from the

selected .svd file.Upload Configuration To Target Downloads the current configuration as a .tcscope file

to a user-selected target system.Save Data After stopping the recording, the current data

including the configuration can be saved in a .svd file.The generated Scope data file (.svd) can be addeddirectly to the Measurement Project or saved in adirectory of your choice via the directory selectiondialog.

Scope Messages Some frequently occurring message boxes in thescope are equipped with a checkbox – Remembermy answer and don't ask again! – so that thequestion is not repeated the next time. This makesthe handling of the program individually adjustable foreach user. If a message box has been deactivated, itcan be activated again here.

Local Scope Server... Opens the configuration interface of the ScopeServer.

Options... Opens the Visual Studio Options window and selectsthe Scope entry.

4.3 ToolbarThe commands available in the TwinCAT Measurement toolbar can be used to start and stop the Scoperecording and to save recorded data.

Page 27: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 27Version: 1.5

If the toolbar is not visible by default or was closed, you can call it up again via View > Toolbars.

The following elements are available by default in the toolbar:

Start Record: All required servers are called and the recording settings and connected channelsare entered. If data are already present from a preceding session, then a query appears askingwhether the current data should be saved. Afterwards the recording is started in accordance with theabove settings. After the start it is no longer possible to change the Scope settings or acquisition orto add or remove channels.Stop Record: The recording is stopped. However, the recorded data remain on the connectedservers and can be viewed.After stopping the recording it is possible to change the Scope configuration. The current data willthen be lost, however, if they are not saved.

The toolbar can be extended or customized, as required. To this end, select the command Add or RemoveButtons in the context menu of the toolbar (can be made visible on the right-hand side of the toolbar), andselect the command Customize in the dialog that opens. The Customize dialog opens.

The commands pertaining to the Scope can be found under Add Command > Categories: Scope.

Page 28: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View28 Version: 1.5

4.4 Scope propertiesThe Scope properties must be determined before a recording is started. The settings are entered via theProperty window for the Scope element selected in the Solution Explorer.

Auto Save• Auto Save Path: Here you can select the path for saving the recording via the file browser.

Page 29: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 29Version: 1.5

• Filename Mask: Affects the filename of the recording to be saved. In this way it is possible to realizecontinuous timestamps, for example.

• Use Auto Save: Turns on automatic saving for a stopped recording.

Common• Comment: A free comment can be stored here.• File Name: Filename of the current Scope instance.• File Path: Directory in which the Scope instance was saved.• Graphics: Shows the currently used graphic. A distinction is made between GDI+ and DirectX.• ViewDetailLevel: Here you can set the level of detail for showing or hiding various options. For a

better overview, the Extended level is particularly recommended for XY plots. The option is thereforeonly available for XY plots at present. The options “Default” and “Extended” are available for all charttypes.

Record• Restart Record: Here you can restart a stopped recording.• Ring buffer: Here you can specify how the server should respond, once the recording time has been

reached.◦ If the option is disabled, the recording is stopped when the recording time is reached. The

recording can be terminated prematurely via the stop button.◦ If the option is enabled the recording is not stopped, but the oldest data in the memory is

overwritten. This increases the start time of the recording. The recording can be stopped bypressing the stop button.

• Start Record: Here you can set whether the recording should be started via the recording button(UserStart) or when a trigger event occurs (TriggerStart).

Record Mode• File Store: Here you can specify whether the server should buffer the data in a local file (True) or only

in the RAM (False). The choice depends on the quantity of data to be recorded and the recordingequipment. The access time is faster, if only the RAM is used. For larger data quantities it is usuallynecessary to activate the “File Store” option.

• Record Time: Here you can specify the total recording time. It is entered in the formatDays:Hours:Minutes:Seconds.

Changes by group

To change the settings for several Scopes at the same time, please refer to the chapter Multiple selection[} 78].

4.5 YT-GraphThe properties of the individual hierarchy levels of YT plots are explained below. The View Detail level, whichcan be set in the Scope settings, can be used to separate Channel Style and Channel Acquisition at channellevel through an additional hierarchy level. Channel Style and Channel Acquisition are described separatelybelow.

Page 30: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View30 Version: 1.5

4.5.1 YT chart propertiesHere you can enter all the settings relating to a YT chart.

Page 31: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 31Version: 1.5

Behaviour• Auto Start: If this option is enabled, the chart starts the live display when a new recording is started.• Data Tool Tip: If this option is enabled, a click on a data point results in display of a tool tip with the

exact values of the data point on the X- and Y-axis, plus the timestamp and name of the correspondingchannel.

• Default Display Width: This time specifies the standard width of the associated chart. This value isset, for example, when the rescale button is selected in the chart toolbar.

• Invert X-Axis: Switches the signal sequence from the default (left to right) to right to left.• Master Chart: In the drop-down list that is available here, a chart that is part of the current

configuration can be selected and designated as master chart. All actions that are executed in themaster chart are also automatically executed in this chart. A separate stop display option is provided,through which Y-zoom and Y-panning modes are available. An overview chart can also be displayed.

Page 32: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View32 Version: 1.5

• Time Bar: Specifies whether the time bar is displayed in the chart.• Tool Bar: Specifies whether the toolbar is displayed in the chart.

Color• The background and frame color can be set by means of color dialogs.

Common• Comment: A free comment can be saved here.• CPU Core: Here you can set (for each chart individually) which CPU core should be used for the

current chart display. If required, multiple CPU cores can be specified for a chart. This may improve theperformance.

• Show Name: Specifies whether the name of the chart is shown in the graph.

X-Axis Grid• Use X-Axis Grid: The X-subdivisions in the chart can be switched on or off here.• Use X-Axis SubGrid: Auxiliary lines for the finer X-subdivision of the main grid can be shown or

hidden here.• X-Grid Color: Color of the grid• X-Grid Line Width: Line width of the grid in pixels• X-SubGrid Divisions: Number of areas into which the main grid is subdivided by auxiliary lines.

X-Axis Style

Since the X-axis is permanently assigned to a chart, all associated settings can be made here.

• Ticks: Number of subdivisions• X-Axis Color: Color of the X axis• X-Axis LineWidth: Line width of the axis in pixels

Y-Settings• Scale on Zoom: If this option is selected, the chart instructs all axes (X and Y) to perform an auto-

scaling after a zoom or panning action. This can be used to expand the selected area.• Stacked Y-Aches: This setting can be used to specify whether the axes of a chart should be displayed

side by side, so that the values of the attached channels are shown within the same area, or whetherthe axes should be above each other, each with its own display area.

• Y-Zoom: Here you can set the chart behavior during zooming. If the option is set, you can navigate inthe data of a chart in the Y-direction as well. This includes both zooming and panning (shifting thedisplay with the mouse).

Changes by group

To change the settings for several charts at the same time, please refer to the chapter Multiple selection[} 78].

The chart display is operated with the toolbar. The overview shows all buttons and their explanation (fromleft):

• Play: Starts the live display mode. The data currently being accumulated are displayed.• Pause: The display switches to the pause mode. You can now navigate in the data already recorded

without stopping the recording.

Page 33: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 33Version: 1.5

• Display-Width: The current display width is displayed here. It can be edited in the format hh:mm:ss,fff.The zoom function works down to the µs range. Alternatively, the display width can be changed byturning the mouse wheel in the selected chart window. The changed value is adopted automatically.

• Scroll buttons: The outer scroll buttons move the current display in steps that correspond to thedisplay width. The inner scroll keys move the display only by a tenth of the display width and can bekept pressed to view the data set.

• Position: Shows the position. It can be edited in the format hh:mm:ss,fff. The colons are used asseparators. If not all units are edited the format is sorted in ascending order, starting with seconds.

• Undo/Redo Time/Position: This option can be used to undo step changes in the display width or thecurrent position, irrespective of how they were made (e.g. zoom, scroll, etc.). The right mouse button islikewise assigned this function. Once undone, values can be repeated with redo.

• Panning Horizontal: In the horizontal panning mode the current display can be shifted along the x-axis by clicking and dragging with the mouse.

• Panning Free: In the free panning mode the current display can be shifted along the x- and y-axes byclicking and dragging with the mouse.

• Zoom Horizontal: A new time range for the display can be selected by stretching a rectangle over thex-axis.

• Zoom Free: You can zoom into the current display by stretching a rectangle over the graphic area.• Zoom to Default: Carries out an autoscale on all axes. The x-axis is/axes are set to the default display

time.• Zoom Out Max: Scales the x-axis in such a way that all current values in the recording appear in the

display.• Overview: Use the Overview option to display a chart within the chart. The signal range currently

shown in the main chart is highlighted in the Overview Chart. The Overview Chart also offers anabsolute time axis for the whole recording time.

By turning the mouse wheel you can also zoom in or out on the current display. The cursor position of themouse determines the center.

The current recording times are displayed in the chart toolbar:

• Start-Time: The common starting point of the recordings of all connected channels. The start timedefines the zero point of the recording.

• End-Time: Maximum common time of all connected channels. The end time thus marks the final valueof the recording. The difference between the end time and start time is maximally as large as thedefined record time (see Scope properties [} 28]).

• Position: The position time represents the zero point of the current chart, i.e. the time from the starttime to the beginning of the display.

• Time: Absolute time at the chart origin• Date: Absolute date at the chart origin

4.5.2 YT axis propertiesHere you can implement separate settings for each available YT axis.

Page 34: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View34 Version: 1.5

Common• Caption: Here you can enter an axis label.• Comment: A free comment can be saved here.• Enabled: Here you can switch the axis on or off completely. This functionality is also available via the

context menu.• Show Caption: Defines whether the name of the chart (Caption) is shown in the graph.

Grid• Grid Color: Color of the grid• Grid Line Width: Line width of the grid in pixels• SubGrid Divisions: Number of areas into which the main grid is subdivided by auxiliary lines.

In the case of logarithmic scaling the auxiliary lines for subdivision are shown only in the set number ifthe range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows thedecades not displayed in the main grid.

• Use Grid: The Y-subdivisions of the axis can be shown or hidden here.• Use SubGrid: Auxiliary lines for the finer Y-subdivision of the main grid can be shown or hidden here.

Auxiliary lines have no axis labeling.

Page 35: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 35Version: 1.5

Scale• Auto Scale: If Auto Scale is active, each axis is scaled such that the last-known minimum and

maximum of all connected channels lie within the display range.• Axis Max: If Auto Scale is inactive, the maximum value can be edited directly.• Axis Min: If Auto Scale is inactive, the minimum value can be edited directly.• Logarithmic: Switches between logarithmic and linear scaling of the axes.• Precision: Here you can specify the number of significant digits for the axis labeling. It corresponds to

the number of visible digits on the axis.• Scale Mode: Two auto-scaling modes are available for selection. The default mode is AutoGrowOnly.

This means the y-axis always scales to the historic maximum, until a rescale is carried out for thecurrent view. Alternatively, AutoGrowNShrink can be selected. This mode always automatically adjuststhe maximum of the y-axis to the maximum in the current view (display width).

Axis Style• Color: Color of the axis• Line Width: Line width in pixels• Ticks: Maximum number of subdivisions. If there is not enough space for the selected number of ticks,

these are automatically reduced in the chart.In the case of logarithmic scaling the number of ticks depends on the displayed range of values andcan thus deviate from the settings.

• Visible: Specifies whether the axis is shown or hidden in the chart.

Changes by group

To change the settings for several axes at the same time, please refer to the chapter Multiple selection[} 78].

4.5.3 YT channel styleAll style settings belonging to a YT channel can be made here.

Page 36: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View36 Version: 1.5

Common• Comment: A free comment can be saved here. If applicable the comment will be adopted from the

connected ADS symbol.• Visible: Here you can set whether the channel should be displayed in the chart.

Line• Antialias: This option decides how the lines will be drawn. Antialias is "nicer" but requires considerably

more computing. This has an effect in particular if there are many channels with large movements.• Fill Color: Fill mode can be used to color an area, e.g. above or below a curve. Here you can select

the fill color.• Fill Mode: Fill mode can be used to color an area, e.g. above or below a curve. The default setting is

“None”. Variables with the data type BOOL are an exception. For BOOL variables the default value is“Horizontal Zero”. Further alternatives: Bottom, Top, Center and Source.

• Fill Transparency: Here you can set the transparency value of the fill color. The default value is 50.• Line Color: Graph color• Line Width: Line width of the chart. The line width 1 requires least computing.• Type: Changes the value display between line, steps and bars. The default value is line.

Marks• Mark Color: Color of the interpolation point markers

Page 37: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 37Version: 1.5

• Marks: Selection of the visibility of markings: On (permanently visible) | Auto (dependent on the zoomlevel) | Off (markings switched off).

• Mark Size: Size of the interpolation point markers

Modify• Bit Mask: In this field a value can be entered with which the display value is masked, provided it is not

of the type floating point. This means that the value of the channel is ANDed with the binary value ofthe mask. This helps you, for example, to observe individual bits of a status byte.

• Offset: A free offset can be added to the function value of the channel in the offset field.• Scale Factor: The display value of a channel can be changed with the scale factor. This makes sense

if angle signals are to be displayed in degrees, rather than radians, for example. With a scaling factorof k = 360 / (2*Pi) = 57.296, therefore, degrees would be displayed instead of radians.

• Time Shift: This option enables the graph to be moved along the time axis. This can be useful tocompensate a known bus runtime, for example.

Changes by group

To change the settings for several channels at the same time, please refer to the chapter Multiple selection[} 78].

4.5.4 YT channel acquisitionAll acquisition settings belonging to a YT channel can be made here.

Page 38: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View38 Version: 1.5

Note

The properties may differ.The properties of the channels can deviate from the illustration shown here.Some setting possibilities are visible / editable only for special channels.Example: The setting Array Length is only visible for array symbols.

Acquisition• Array Length: Shows the number of array elements.• Data-Type: Indicates the data type of the selected variable.• Enabled: Here you can decide whether the configured channel should be recorded or not.• Oversampling: This option is only shown for arrays. The array is interpreted as a variable, and the

values of the individual array elements are displayed contiguously as oversampling values. Thiscorresponds to the behavior of EtherCAT oversampling terminals. The value that can be entered heredescribes the number of oversampling values to be displayed. By default, the value corresponds to thearray length. See also: Oversampling recordings [} 117]

• Sample State: Here you can specify whether the data for the selected variables are to be sampledwith the TaskSampleTime or the FreeSampleTime.

• Sample Time: If the sample state “FreeSampleTime” was selected, you can set the sampling ratehere. It is always greater than the TaskSampleTime.

• Symbol based: If this option is set, the variables are communicated via the symbol name. If this optionis not set, the variables are communicated via the Group and Offset indices, and the input fields forGroup and Offset are enabled.

• Symbol Comment: Here the actual symbol comment is displayed, if such a comment exists.• Symbol Index Group: Group index of the variable• Symbol Index Offset: Offset index of the variable• Symbol Name: Symbol name of the selected variable• Symbol Size: Shows the size of the variables in bytes.• Target Port: Shows the variable port on the respective TwinCAT system. A drop-down list can be used

to select the available ports for the selected target system.• Target System: Indicates the target system selected for a recording. By default this is the target

system for the selected variable.• Time Offset [s]: This can be used for one-time manipulation of the original time stamp during

recording of the data point. e.g. to compensate path differences of different target systems. The phasedifferences have to be determined manually by the user.

• Use Local Server: If this option is set, the Scope Server installed on the Scope View system is usedfor the recording. If the option is not set, a connection with the remote server of the target system isestablished.

Changes by group

To change the settings for several channels at the same time, please refer to the chapter Multiple selection[} 78].

4.6 XY-GraphThe properties of the individual hierarchy levels of XY plots are explained below. The View Detail level,which can be set in the Scope settings, can be used to separate Channel Style and Channel Acquisition atchannel level through an additional hierarchy level. Channel Style and Channel Acquisition are describedseparately below.

Page 39: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 39Version: 1.5

4.6.1 XY chart propertiesAll settings assigned to the XY chart can be made here.

Page 40: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View40 Version: 1.5

Behaviour• Auto Start: If this option is enabled, the chart starts the live display when a new recording is started.• Data Tool Tip: If this option is enabled, a click on a data point results in display of a tool tip with the

exact values of the data point on the X- and Y-axis, plus the timestamp and name of the correspondingchannel.

• Default Display Width: This time indicates the display time for the signal or the signal length in the XYchart. This value is set, for example, when the rescale button is selected in the chart toolbar.

• Master Chart: In the drop-down list that is available here, a chart that is part of the currentconfiguration can be selected and designated as master chart. All actions that are executed in themaster chart are also automatically executed in this chart. A separate pause option is provided,through which XY-zoom and XY-panning modes are available.

• Time Bar: Specifies whether the time bar is displayed in the chart.• Tool Bar: Specifies whether the toolbar is displayed in the chart.

Color• The background and frame color can be set by means of color dialogs.

Common• Comment: A free comment can be saved here.• CPU Core: Here you can set (for each chart individually) which CPU core should be used for the

current chart display. If required, multiple CPU cores can be specified for a chart. This may improve theperformance.

Page 41: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 41Version: 1.5

• Max Data Points: Determines the maximum number of data points that can be displayed at the sametime. The default value is 120,000. This means that, at a sampling rate of 1 ms (TaskSampleTime), themaximum recording time for which values can be displayed simultaneously is 2 minutes.

• Show Name: Specifies whether the name of the chart is shown in the graph.

Settings• Scale on Zoom: If this option is selected, the chart instructs all axes (X and Y) to perform autoscaling

after a zoom or panning action. This can be used to expand the selected area.• Stacked Axes: This setting can be used to specify whether the axes of a chart are shown side by side

or above each other. In the side by side display, the values of the appended channels are shown withinthe same area. If they are shown above each other, the channels are displayed in their own areas.

Changes by group

To change the settings for several charts at the same time, please refer to the chapter Multiple selection[} 78].

The chart display is operated with the toolbar. The overview shows all buttons and their explanation (fromleft):

• Play: Starts the live display mode. The data currently being accumulated are displayed.• Pause: The display switches to the pause mode. You can now navigate in the data already recorded

without stopping the recording.• Display-Width: The current display width is displayed here. It can be edited in the format hh:mm:ss,fff.

Alternatively, the display width can be changed by turning the mouse wheel in the selected chartwindow. The changed value is adopted automatically.

• Scroll buttons: The outer scroll buttons move the current display in steps that correspond to thedisplay width. The inner scroll keys move the display only by a tenth of the display width and can bekept pressed to view the data set.

• Position: Shows the position. It can be edited in the format hh:mm:ss,fff. The colons are used asseparators. If not all units are edited the format is sorted in ascending order, starting with seconds.

• Panning Free: In the free panning mode the current display can be shifted along the X- and Y-axes byclicking and dragging with the mouse.

• Zoom Free: You can zoom into the current display by stretching a rectangle over the graphic area.• Zoom to Default: Carries out an autoscale on all axes. The x-axis is/axes are set to the default display

time.• Zoom Out Max: Scales the X and Y-axis in such a way that all current values in the recording appear

in the display. Up to the maximum number of data points that can be shown. The maximum number is60,000 data points.

By turning the mouse wheel you can also zoom in or out on the current display. The cursor position definesthe center.

The current recording times are displayed in the chart toolbar:

• Start-Time: The common starting point of the recordings of all connected channels. The start timedefines thus the zero point of the recording.

Page 42: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View42 Version: 1.5

• End-Time: Maximum common time of all connected channels. The end time marks the final value ofthe recording. The difference between the end time and start time is maximally as large as the definedrecord time (see Scope properties [} 28]).

• Position: The position time represents the zero point of the current chart, i.e. the time from the starttime to the beginning of the display.

• Time: Absolute time at the chart origin.• Date: Absolute date at the chart origin.

4.6.2 XY-axis propertiesHere you can set separate settings for each available XY axis.

Page 43: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 43Version: 1.5

Common• Comment: A free comment can be saved here.• Enabled: Here you can switch the axis on or off completely. This functionality is also available via the

context menu.• Show X Caption: Specifies whether the name of the x-axis is shown in the chart.• Show Y Caption: Specifies whether the name of the y-axis is shown in the chart.• X Caption: Here you can enter an x-axis label.• Y Caption: Here you can enter an y-axis label.

Page 44: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View44 Version: 1.5

X Grid• Use X Grid: The X-subdivisions of the axis can be shown or hidden here.• Use X SubGrid: Auxiliary lines for the finer X-subdivision of the main grid can be shown or hidden

here. Auxiliary lines have no axis labeling.• X Grid Color: Color of the grid• X Grid Line Width: Line width of the grid in pixels• X SubGrid Divisions: Number of areas into which the main grid is subdivided by auxiliary lines.

In the case of logarithmic scaling the auxiliary lines for subdivision are shown only in the set number ifthe range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows thedecades not displayed in the main grid.

X Scale• X Auto Scale: If Auto Scale is active, each axis is scaled such that the last-known minimum and

maximum of all connected channels lie within the display range.• X Axis Max: If Auto Scale is inactive, the maximum value can be edited directly.• X Axis Min: If Auto Scale is inactive, the minimum value can be edited directly.• X Logarithmic: Switches between logarithmic and linear scaling of the axes.• X Precision: Here you can specify the number of significant digits for the axis labeling. It corresponds

to the number of visible digits on the axis.• X Scale Mode: Two auto-scaling modes are available for selection. The default mode is

AutoGrowOnly. This means the x-axis always scales to the historic maximum, until a rescale is carriedout for the current view. Alternatively, AutoGrowNShrink can be selected. This mode alwaysautomatically adjusts the maximum of the x-axis to the maximum in the current view (display width).

X Style• X Color: Color of the axis• X Line Width: Line width in pixels• X Ticks: Maximum number of subdivisions. If there is not enough space for the selected number of

ticks, these are automatically reduced in the chart.In the case of logarithmic scaling the number of ticks depends on the displayed range of values andcan thus deviate from the settings.

• X Visible: Specifies whether the axis is shown or hidden in the chart.

Y Grid• Use Y Grid: The Y-subdivisions of the axis can be shown or hidden here.• Use Y SubGrid: Auxiliary lines for the finer Y-subdivision of the main grid can be shown or hidden

here. Auxiliary lines have no axis labeling.• Y Grid Color: Color of the grid• Y Grid Line Width: Line width of the grid in pixels• Y SubGrid Divisions: Number of areas into which the main grid is subdivided by auxiliary lines.

In the case of logarithmic scaling the auxiliary lines for subdivision are shown only in the set number ifthe range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows thedecades not displayed in the main grid.

Y Scale• Y Auto Scale: If Auto Scale is active, each axis is scaled such that the last-known minimum and

maximum of all connected channels lie within the display range.• Y Axis Max: If Auto Scale is inactive, the maximum value can be edited directly.• Y Axis Min: If Auto Scale is inactive, the minimum value can be edited directly.• Y Logarithmic: Switches between logarithmic and linear scaling of the axes.• Y Precision: Here you can specify the number of significant digits for the axis labeling. It corresponds

to the number of visible digits on the axis.

Page 45: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 45Version: 1.5

• Y Scale Mode: Two auto-scaling modes are available for selection. The default mode isAutoGrowOnly. This means the y-axis always scales to the historic maximum, until a rescale is carriedout for the current view. Alternatively, AutoGrowNShrink can be selected. This mode alwaysautomatically adjusts the maximum of the y-axis to the maximum in the current view (display width).

Y Style• Y Color: Color of the axis• Y Line Width: Line width in pixels• Y Ticks: Maximum number of subdivisions. If there is not enough space for the selected number of

ticks, these are automatically reduced in the chart.In the case of logarithmic scaling the number of ticks depends on the displayed range of values andcan thus deviate from the settings.

• Y Visible: Specifies whether the axis is shown or hidden in the chart.

Changes by group

To change the settings for several axes at the same time, please refer to the chapter Multiple selection[} 78].

4.6.3 XT channel styleAll style settings belonging to a XY channel can be made here.

Page 46: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View46 Version: 1.5

Cap• Cap Color: Specifies the colour of the active cap.• Cap Size: Specifies the size of the cap.• End Cap: Activates the end cap for the channel.• Start Cap: Activates the start cap for the channel.

Common• Comment: A free comment can be saved here. If applicable the comment will be adopted from the

connected ADS symbol.• Visible: Here you can set whether the channel should be displayed in the chart.

Page 47: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 47Version: 1.5

Line• Antialias: This option decides how the lines will be drawn. Antialias is "nicer" but requires considerably

more computing. This has an effect in particular if there are many channels with large movements.• Fill Color: Fill mode can be used to color an area, e.g. above or below a curve. Here you can select

the fill color.• Fill Mode: Fill mode can be used to color an area, e.g. above or below a curve. The default setting is

“None”. Alternatives are: Horizontal Zero, Bottom, Top, Center and Source.• Fill Transparency: Here you can set the transparency value of the fill color. The default value is 50.• Line Color: Graph color• Line Width: Line width of the chart. The line width 1 requires least computing.

Marks• Mark Color: Color of the interpolation point markers• Marks: Selection of the visibility of markings: On (permanently visible) | Auto (dependent on the zoom

level) | Off (markings switched off).• Mark Size: Size of the interpolation point markers

Modify• X Bit Mask: In this field a value can be entered with which the display value is masked, provided it is

not of the type floating point. This means that the value of the channel is ANDed with the binary valueof the mask. This helps you, for example, to observe individual bits of a status byte.

• X Offset: A free offset can be added to the function value of the channel in the offset field.• X Scale Factor: The display value of a channel can be changed with the scale factor.• Y Bit Mask: In this field a value can be entered with which the display value is masked, provided it is

not of the type floating point. This means that the value of the channel is ANDed with the binary valueof the mask. This helps you, for example, to observe individual bits of a status byte.

• Y Offset: A free offset can be added to the function value of the channel in the offset field.• Y Scale Factor: The display value of a channel can be changed with the scale factor.

Changes by group

To change the settings for several channels at the same time, please refer to the chapter Multiple selection[} 78].

4.6.4 XY channel acquisitionAll acquisition settings belonging to a XY channel can be made here.

Page 48: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View48 Version: 1.5

Note

The properties may differ.The properties of the channels can deviate from the illustration shown here.Some setting options are only visible/editable for special channels.Example: The setting Array Length is only visible for array symbols.

Acquisition• Data-Type: Indicates the data type of the selected variable.• Enabled: Here you can decide whether the configured channel should be recorded or not.• Oversampling: This option is only shown for arrays. The array is interpreted as a variable, and the

values of the individual array elements are displayed contiguously as oversampling values. Thiscorresponds to the behavior of EtherCAT oversampling terminals. The value that can be entered heredescribes the number of oversampling values to be displayed. By default, the value corresponds to thearray length. Comparisons: Oversampling recordings [} 117].

• Sample State: Here you can specify whether the data for the selected variables are to be sampledwith the TaskSampleTime or the FreeSampleTime.

• Sample Time: If the sample state “FreeSampleTime” was selected, you can set the sampling ratehere. It is always greater than the TaskSampleTime.

• Symbol based: If this option is set, the variables are communicated via the symbol name. If this optionis not set, the variables are communicated via the Group and Offset indices, and the input fields forGroup and Offset are enabled.

• Symbol Comment: Here the actual symbol comment is displayed, if such a comment exists.• Symbol Index Group: Group index of the variable• Symbol Index Offset: Offset index of the variable• Symbol Name: Symbol name of the selected variable.

Page 49: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 49Version: 1.5

• Symbol Size: Shows the size of the variables in bytes.• Target Port: Shows the variable port on the respective TwinCAT system. A drop-down list can be used

to select the available ports for the selected target system.• Target System: Indicates the target system selected for a recording. By default this is the target

system for the selected variable.• Time Offset [s]: This can be used for one-time manipulation of the original timestamp during recording

of the data point. e.g. to compensate path differences of different target systems. The phasedifferences have to be determined manually by the user.

• Use Local Server: If this option is set, the Scope Server installed on the Scope View system is usedfor the recording. If the option is not set, a connection with the remote server of the target system isestablished.

Changes by group

To change the settings for several channels at the same time, please refer to the chapter Multiple selection[} 78].

4.7 Bar ChartThe properties of the individual hierarchy levels of array bar charts are explained below. The View Detaillevel, which can be set in the Scope settings, can be used to separate Channel Style and ChannelAcquisition at channel level through an additional hierarchy level. Channel Style and Channel Acquisition aredescribed separately below.

4.7.1 Bar chart propertiesHere you can enter all the settings relating to a array bar chart.

Page 50: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View50 Version: 1.5

Behaviour• Auto Start: If this option is enabled, the chart starts the live display when a new recording is started.• Data Tool Tip: If this option is enabled, a click on a data point results in display of a tool tip with the

exact values of the data point on the X- and Y-axis, plus the timestamp and name of the correspondingchannel.

• Default Display Width: This time refers to the display times of the minimum and maximum values inthe array bar chart. The extreme values are always recorded. The freely adjustable display time makesit possible to display an extended history of the extreme values.

• Master Chart: In the drop-down list that is available here, a chart that is part of the currentconfiguration can be selected and designated as master chart. All actions that are executed in themaster chart are also automatically executed in this chart. A separate pause option is provided,through which XY-zoom and XY-panning modes are available.

• Time Bar: Specifies whether the time bar is displayed in the chart.• Tool Bar: Specifies whether the toolbar is displayed in the chart.

Color• The background and frame color can be set by means of color dialogs.

Common• Comment: A free comment can be saved here.

Page 51: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 51Version: 1.5

• CPU Core: Here you can set (for each chart individually) which CPU core should be used for thecurrent chart display. If required, multiple CPU cores can be specified for a chart. This may improve theperformance.

• Show Name: Specifies whether the name of the chart is shown in the graph.

Settings• Stacked Axes: This setting can be used to specify whether the axes of a chart are shown side by side

or above each other. In the side by side display, the values of the appended channels are shown withinthe same area. If they are shown above each other, the channels are displayed in their own areas.

Changes by group

To change the settings for several charts at the same time, please refer to the chapter Multiple selection[} 78].

The chart display is operated with the toolbar. The overview shows all buttons and their explanation (fromleft):

• Play: Starts the live display mode. The data currently being accumulated are displayed.• Pause: The display switches to the pause mode. You can now navigate in the data already recorded

without stopping the recording.• Display-Width: This time refers to the display times of the minimum and maximum values in the array

bar chart. The extreme values are always recorded. The freely adjustable display time makes itpossible to display an extended history of the extreme values.

• Scroll buttons: The outer scroll buttons move the current display in steps that correspond to thedisplay width. The inner scroll keys move the display only by a tenth of the display width and can bekept pressed to view the data set.

• Position: The displayed position can be edited in the Position field in the format hh:mm:ss,fff. Thecolons serve here as separators. If not all units are edited the format is sorted in ascending order,starting with seconds.

• Undo/Redo Time/Position: This option can be used to undo step changes in the display width or thecurrent position, irrespective of how they were made (e.g. zoom, scroll, etc.). The right mouse button islikewise assigned this function. Once undone, values can be repeated with redo.

• Panning Horizontal: In the horizontal panning mode the current display can be shifted along the x-axis by clicking and dragging with the mouse.

• Panning Free: In the free panning mode the current display can be shifted along the x- and y-axes byclicking and dragging with the mouse.

• Zoom Horizontal: A new time range for the display can be selected by stretching a rectangle over thex-axis.

• Zoom Free: You can zoom into the current display by stretching a rectangle over the graphic area.• Zoom to Default: If autoscale is set, this option triggers a zoom to the maximum number of array

elements. If autoscale is disabled, the zoom automatically focuses on the defined limits.• Zoom Out Max: Scales the x-axis such that all array elements are displayed.

4.7.2 Bar axis propertiesAll the settings for the axes of array bar charts are described here.

Page 52: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View52 Version: 1.5

Common• Comment: A free comment can be saved here.• Enabled: Here you can switch the axis on or off completely. This functionality is also available via the

context menu.• Show X Caption: Specifies whether the name of the x-axis is shown in the chart.• Show Y Caption: Specifies whether the name of the y-axis is shown in the chart.• X Caption: Here you can enter an x-axis label.• Y Caption: Here you can enter an y-axis label.

Page 53: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 53Version: 1.5

X Grid• Use X Grid: The X-subdivisions of the axis can be shown or hidden here.• Use X SubGrid: Auxiliary lines for the finer X-subdivision of the main grid can be shown or hidden

here. Auxiliary lines have no axis labeling.• X Grid Color: Color of the grid• X Grid Line Width: Line width of the grid in pixels• X SubGrid Divisions: Number of areas into which the main grid is subdivided by auxiliary lines.

In the case of logarithmic scaling the auxiliary lines for subdivision are shown only in the set number ifthe range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows thedecades not displayed in the main grid.

X Scale• X Auto Scale: If Auto Scale is active, each axis is scaled such that the last-known minimum and

maximum of all connected channels lie within the display range.• X Axis Max: If Auto Scale is inactive, the maximum value can be edited directly.• X Axis Min: If Auto Scale is inactive, the minimum value can be edited directly.• X Logarithmic: Switches between logarithmic and linear scaling of the axes.• X Precision: Here you can specify the number of significant digits for the axis labeling. It corresponds

to the number of visible digits on the axis.

X Style• X Color: Color of the axis• X Line Width: Line width in pixels• X Ticks: Maximum number of subdivisions. If there is not enough space for the selected number of

ticks, these are automatically reduced in the chart.In the case of logarithmic scaling the number of ticks depends on the displayed range of values andcan thus deviate from the settings.

• X Visible: Specifies whether the axis is shown or hidden in the chart.

Y Grid• Use Y Grid: The Y-subdivisions of the axis can be shown or hidden here.• Use Y SubGrid: Auxiliary lines for the finer Y-subdivision of the main grid can be shown or hidden

here. Auxiliary lines have no axis labeling.• Y Grid Color: Color of the grid• Y Grid Line Width: Line width of the grid in pixels• Y SubGrid Divisions: Number of areas into which the main grid is subdivided by auxiliary lines.

In the case of logarithmic scaling the auxiliary lines for subdivision are shown only in the set number ifthe range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows thedecades not displayed in the main grid.

Y Scale• Y Auto Scale: If Auto Scale is active, each axis is scaled such that the last-known minimum and

maximum of all connected channels lie within the display range.• Y Axis Max: If Auto Scale is inactive, the maximum value can be edited directly.• Y Axis Min: If Auto Scale is inactive, the minimum value can be edited directly.• Y Logarithmic: Switches between logarithmic and linear scaling of the axes.• Y Precision: Here you can specify the number of significant digits for the axis labeling. It corresponds

to the number of visible digits on the axis.

Y Style• Y Color: Color of the axis• Y Line Width: Line width in pixels

Page 54: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View54 Version: 1.5

• Y Ticks: Maximum number of subdivisions. If there is not enough space for the selected number ofticks, these are automatically reduced in the chart.In the case of logarithmic scaling the number of ticks depends on the displayed range of values andcan thus deviate from the settings.

• Y Visible: Specifies whether the axis is shown or hidden in the chart.

Changes by group

To change the settings for several axes at the same time, please refer to the chapter Multiple selection[} 78].

4.7.3 Bar channel styleAll Style properties of array bar chart channels are explained here.

Common• Comment: A free comment can be saved here. If applicable the comment will be adopted from the

connected ADS symbol.• Visible: Here you can set whether the channel should be displayed in the chart.

Line• Antialias: This option decides how the lines will be drawn. Antialias is "nicer" but requires considerably

more computing. This has an effect in particular if there are many channels with large movements.

Page 55: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 55Version: 1.5

• Graph Type: Here you can switch between different display types. The default value for an array barchart is Bar. Other options are: Line and Stair.

• Line Color: Graph color• Line Width: Line width of the chart. The line width 1 requires least computing.• Show Max: If the option is set to TRUE, the maximum values for the set display width are shown.• Show Min: If the option is set to TRUE, the minimum values for the set display width are shown.

Marks• Mark Color: Color of the interpolation point markers• Marks: Selecting the visibility of markings → On (permanently visible) | Off (markings switched off).• Mark Size: Size of the interpolation point markers

Modify• BitMask: In this field a value can be entered with which the display value is masked, provided it is not

of the type floating point. This means that the value of the channel is ANDed with the binary value ofthe mask. This helps you, for example, to observe individual bits of a status byte.

• X Offset: A free offset can be added to the function value of the channel in the offset field.• X Scale Factor: The display value of a channel can be changed with the scale factor.• Y Offset: A free offset can be added to the function value of the channel in the offset field.• Y Scale Factor: The display value of a channel can be changed with the scale factor.

Changes by group

To change the settings for several channels at the same time, please refer to the chapter Multiple selection[} 78].

4.7.4 Bar channel acquisitionThis section explains all settings for the channel acquisition of array bar chart channels.

Page 56: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View56 Version: 1.5

Acquisition• Array Length: Indicates the length of selected arrays, which is also the maximum displayed on the x-

axis.• Data-Type: Indicates the data type of the selected variable.• Enabled: Here you can decide whether the configured channel should be recorded or not.• Sample State: Here you can specify whether the data for the selected variables are to be sampled

with the TaskSampleTime or the FreeSampleTime. The default value for array bar charts is“FreeSample”, since it makes no sense to scan a bar display so quickly that it is not possible for thehuman eye to observe it.

• Sample Time: If the sample state “FreeSampleTime” was selected, you can set the sampling ratehere. It is always greater than the “TaskSampleTime”. The default setting for array bar charts is 100ms. This is a sampling rate for bar charts that is comfortable for the human eye.

• Symbol based: If this option is set, the variables are communicated via the symbol name. If this optionis not set, the variables are communicated via the Group and Offset indices, and the input fields forGroup and Offset are enabled.

• Symbol Comment: Here the actual symbol comment is displayed, if such a comment exists.• Symbol Index Group: Group index of the variable• Symbol Index Offset: Offset index of the variable• Symbol Name: Symbol name of the selected variable• Symbol Size: Shows the size of the variables in bytes.• Target Port: Shows the variable port on the respective TwinCAT system. A drop-down box can be

used to select the available ports for the selected target system.• Target System: Indicates the target system selected for a recording. By default this is the target

system for the selected variable.

Page 57: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 57Version: 1.5

• Time Offset [s]: This can be used for one-time manipulation of the original time stamp duringrecording of the data point. e.g. to compensate path differences of different target systems. The phasedifferences have to be determined manually by the user.

• Use Local Server: If this option is set, the Scope Server installed on the Scope View system is usedfor the recording. If the option is not set, the system tries to connect to the remote server of the targetsystem.

Changes by group

To change the settings for several channels at the same time, please refer to the chapter Multiple selection[} 78].

4.8 Recording

4.8.1 Target BrowserWith the Target Browser you can be add Scope configuration channels via their symbol names. The TargetBrowser is divided into two halves.

One half shows a structure tree with the first entry: ROUTES. Below that all devices registered in the SystemManager are shown. The color of the target indicates the system state: red = cannot be reached (Stopmode), blue = Config mode, green = system in Run mode.

The second half shows a detailed list of subitems for the element selected in the tree structure.

Use the Upper Folder button to navigate to a higher level within the tree structure.

Add channel

To add channels to the configuration, double-click on the corresponding channels in the tree structure orselect the channels, then select the command Add Symbols (Add Subsymbols) in the context menu or thetoolbar.

Page 58: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View58 Version: 1.5

Alternatively, you can add selected elements anywhere in the configuration via drag & drop.

If you select a folder, an Ads Big type or an array containing subsymbols, the command Add Subsymbolsadds a channel for each subsymbol. The command Add Symbol only adds one channel with the informationfor the selected symbol.

Task selection

If you select a target computer in the tree structure, the connected tasks become visible. They are color-coded: green = PLC task, blue = NC task, red = other.

If a task is not displayed, you can use Enable Server Ports to call up a selection menu that displays therestriction to particular tasks.

All common Ads ports are displayed here, irrespective of whether server tasks are involved. If a port is notlisted here it can be entered in the text field at the bottom left. All selected ports that are servers are adoptedafter confirming with OK. Subsequently a check is made as to which of the ports exist, in order to update thedisplay.

Page 59: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 59Version: 1.5

Viewing the symbol list

If a symbol list is available for the selected, it can be called up by selecting it. All symbols of a task aretransferred into a hierarchical view according to separators (e.g. '.'), allowing simple browsing.

Settings

The option Name Detail Level in the settings can be used to set the detail level of the channel name formedfrom the symbol name. If the detail level is zero, only the part of the symbol name after the last dot istransferred. Each further level then adds the term before the respective next full stop. For example, with adetail level of “0” the symbol “Main.Signals.Sine” becomes “Sine”, with a detail level of “1” it becomes“Signals.Sine”, with a detail level of “2” or higher “Main.Signals.Sine”.

Starting and stopping a recording

If all channels were selected for the recording, you can start the recording with the command Record in the

Scope toolbar ( ) and stop it with the command Stop Record ( )

4.9 CursorA chart cursor can be added and changed via the cursor module.

Page 60: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View60 Version: 1.5

Cursor module

The cursor module (listed in each chart element as “cursor”) offers the following setting options:

Page 61: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 61Version: 1.5

• Delta Values: If several cursors are used in one direction, the differences can be displayed if DeltaValues is enabled.

• Hex Values: Hexadecimal notation of the average values of the individual channels.

Cursor Settings

Each X/Y-cursor within the cursor module offers its own setting options

• Color: Color of the cursor• Comment: A comment can be saved here.• Line Width: Line width of the cursor in pixels

Cursor Window

The values are displayed in the Cursor window. The Cursor window can be called from the Scope contextmenu.

Page 62: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View62 Version: 1.5

Status Times

The times pertaining to an added X-cursor are displayed in three formats:

• Absolute Position: Corresponds to the actually registered time.• Record Position: Time value of the cursor since the beginning of the recording.• Chart Position: Time value of the cursor within the recording.

Channel

The average values of the individual channels are displayed with the respective X-cursor in the Channelfield. The displayed average values are, like the display, compromised to pixel width. To display theintermediate values, zoom in on the recording.

Axis

The values of the Y-cursors on the respective axes are indicated in the lowest field.

Page 63: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 63Version: 1.5

4.10 TriggerVarious trigger functions can be added to the Scope configuration.

In order to facilitate combination of individual trigger conditions and actions, these are grouped into triggergroups.

Page 64: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View64 Version: 1.5

Note

Deviating properties of the trigger groupThe properties of the trigger groups may differ from the properties shown here. Some setting options are visible and editable only when specific trigger actions.Example: The setting Trigger Position is only visible with the trigger actions “Stop Display”and “Restart Display”.

Trigger groups and trigger sets can be added via the trigger context menu.

Trigger group

The trigger group provides settings for the trigger actions and for the general properties.

Trigger actions: • Set Mark: If this option is selected, the position at which the trigger set condition occurs is marked by a

horizontal line.

Page 65: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 65Version: 1.5

• Start Record: If this option is selected, the Start Record condition should be set to Trigger Start in theScope settings. Otherwise the Scope would start recording as usual. With setting this action, therefore,a question box appears that carries out this setting if necessary. When the Record button is pressed inthe menu bar, the scope connects to the participating servers as usual and starts to monitor theconnected channels, without starting the actual recording. The recording begins with the trigger time ofthe last trigger set condition.

• Stop Record: If the stop action is selected, the Scope should be operated in the ring buffer mode. Withsetting this action, therefore, a question box appears that carries out this setting if necessary. Therecording is then stopped when the Trigger Set condition occurs. In addition, the options Pre-Triggerand Post-Trigger appear, which can be used to indicate whether a fixed time range should appear inthe recording before and/or after the trigger event. Is Pre-Trigger is selected, trigger events that occurbefore this time has elapsed are ignored. If Post-Trigger is active, the recording continues for thespecified time after the trigger event.

• Start Subsave: This trigger event starts a background recording with the current configuration. Thissubsave always runs in the ring buffer mode (independent of the settings in the Scope settings). It ispossible to start up to five subsaves simultaneously (via one or more trigger events). The maximummemory capacity of the subsave can be specified in the Record Time field. This recording duration mayalso be longer than the recording duration of the basic configuration (in this case ring buffer operationshould also be selected).

• Stop Subsave: After the StopSubsave trigger event, the oldest subsave is stopped and transferred tothe view in the background. From here it is saved in a .svd file via the specified path. The generatedfilename consists of the name of the Scope in the basic configuration and an ID composed of the dateand time, in alphanumeric order.

• Stop Display: The Stop Display action stops all the charts of the Scope, which are in live mode at thetrigger time, after the Trigger Set condition has occurred and the entire display width is full. If the triggercondition is met again, the display jumps to this new event. Pause can be actuated in the chart in orderto prevent this retriggering.

• Restart Display: All charts paused due to a StopDispay trigger are resumed on fulfillment of the triggercondition.

General properties of the trigger group:• Color: Color of the trigger• Comment: A free comment can be saved here.• Enable: Here you can switch the trigger group on or off.• Trigger Release Capacity: The Trigger Release Capacity indicates how many trigger markers are to

be stored and displayed simultaneously. These are always the last recorded markers. The defaultvalue is 20, so that the last 20 recorded trigger markers are visible in the overview chart and can bedisplayed in the chart.

• Post-Trigger: This option is only available with the “Stop Record” and “Stop Subsave” trigger actions.Post-Trigger causes the recording to continue for a certain time after the Trigger Set condition hasoccurred. This time can be entered here.

• Pre-Trigger: This option is only available with the “Stop Record” and “Stop Subsave” trigger actions.Pre-Trigger causes the Trigger Set conditions to be ignored from the start of the recording to theexpiration of the Pre-Trigger time. The corresponding time can be set here.

• Use Post-Trigger: This option is only available with the “Stop Record” and “Stop Subsave” triggeractions. The Post-Trigger can be switched on or off here.

• Use Pre-Trigger: This option is only available with the “Stop Record” and “Stop Subsave” triggeractions. The Pre-Trigger can be switched on or off here.

• Record Time: This option is only available with the trigger action “Start Subsave”. The recording timefor the subsaves can be entered here. This recording duration may also be longer than the recordingduration of the basic configuration (in this case ring buffer operation should also be selected).

• Save Path: This option is only available with the “Stop Subsave” trigger action. The path to the file inwhich the subsave is to be saved can be entered here.

• Clear Chart: This option is only available with the “Stop Display” and “Restart Display” trigger actions.If this option is set, the chart range visible on the display is deleted when the Trigger Set conditionoccurs again. It can be seen how the chart is continued until the next trigger event.

Page 66: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View66 Version: 1.5

• Trigger Position: This option is only available with the “Stop Display” and “Restart Display” triggeractions. The trigger position can be used to select the percentage of the display (display width) beforeor after the trigger event (for example: positive 0 pass of the green signal at 10 % of 2.5 s = 0.25 s).

Trigger Set

Each trigger set can be regarded as a stand-alone trigger condition.

The action report of the trigger group defines what happens when a trigger group is triggered.

The trigger set offers the following setting options:

• Channel: A channel is assigned to each set whose state is to be checked for the selected triggercondition

• Combine: By selecting a logic operation these individual conditions can be placed in relation to oneanother. Note here that AND operations are handled before OR operations.

• Release: The release condition can be either a rising or falling edge.• Threshold: Corresponding limit value for the rising or falling edge.

When a Trigger Set is triggered, the icon in the Solution Explorer changes from to .

All Trigger Sets remain set until the entire trigger group has tripped.

Manual triggering of trigger set

Triggers can be manually triggered for test purposes via the trigger set context menu item Manual TriggerHit.

Trigger Window

The Trigger window can be opened via the Trigger context menu. It displays the triggers with the times atwhich they were triggered.

Page 67: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 67Version: 1.5

4.11 Saving and exporting data

4.11.1 Saving and loadingData that were logged with the TwinCAT 3 Scope can be saved in .svd format. A .svd file stores data is aspecial, proprietary Scope View format.

Saving data• Select the command Save Data in the Scope menu or in the toolbar. This creates a Scope data file

(.svd) that can be added directly to the measurement project or saved in a directory via the directoryselection dialog.

• If you add multiple files to a measurement project, the name of the svd file is automatically incrementedwith a digit.

Loading data

The following options are available for loading data:

• Double-click the desired .svd file in the file system. Visual Studio opens and the dialog New Projectappears. Select the Empty Measurement Project. The .svd files is added to the new measurementproject.

• If a measurement project already exists, the svd file can be selected and opened via the commandAdd Existing Item.

• Open the measurement project, to which the .svd file that was created has been added. In menuFile > Open select the command Project/Solution; in the dialog that opens open the correspondingproject.

Page 68: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View68 Version: 1.5

Reloading of svd files

If data that has already been saved is not displayed due to a disconnect in the internal communication to theScope server, the command Reload is available in the context menu in order to reload the dataautomatically from the .svd file.

Extracting Scope configurations from an svd file

An svd file is visually identified as such. A yellow data icon is displayed in the Solution Explorer. This enablesexclusively data analysis within the file.

If you want to reuse the configuration, for example to make a new recording with the same configuration,select the command Extract Scope Configuration in the Scope menu.

4.11.2 Export CSV / BinaryRecorded data can be saved in a scope data file (.svd). Alternatively, once the current recording hasstopped, data can be exported in .csv, .txt or binary format for use in other programs.

Page 69: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 69Version: 1.5

To export the recording, select the command Export to CSV or Export to Binary in the Scope menu.

Export to CSV

The resulting file has a tabular format. The rows are separated by lines, the columns by tabs. The first rowscontain information about the recording, such as Scope name and start and the end time of the recording.

Afterwards a definition range with the acquisition data follows for each channel.

Finally a list with the recorded data follows for each channel. Each time offset from the Start Record time isallocated the corresponding data value.

Page 70: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View70 Version: 1.5

Export to Binary

The binary data format is based on the text format, but contains no separators. Instead the byte lengths of allvariable data types (such as character strings) are contained in the corresponding headers. All times arespecified in the file time format: 1 tick = 100 ns; the origin is 1.1.1601 0h. All characters are stored in UTF8.

Page 71: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 71Version: 1.5

Variable Size (Bytes) or Number of character DataTypeMAIN-HEADERHeaderSize 8 Int64NameSize 4 Int32Name NameSize Array of CharStartTime 8 Int64EndTime 8 Int64ChannelCount 4 Int32

Variable Size (Bytes) DataTypeChannel - Header #1ChannelHeaderSize 8 Int64NameSize 4 Int32Name NameSize Array of CharNetIdSize 4 Int32NetId NetIdSize Array of CharPort 4 Int32Sample Time 8 Int64SymbolBased 1 bool (as byte)SymoblNameSize 4 Int32Symbol name: SymbolNameSize Array of CharCommentSize 4 Int32Comment CommentSize Array of CharIndexGroup 8 Int64IndexOffset 8 Int64DataTypeSize 4 Int32DataType DataTypeSize Array of CharDataTypeId 4 Int32VariableSize 4 Int32Samples in File 8 Int64Data in File 8 Int64File-StartPosition 8 Int64Scalefactor 8 Real64Offset 8 Real64Bitmask 8 Int64Channel-Header #2...Channel-Header #MainHeader.ChannelCount

Variable Size (Bytes) DataTypeData Channel #1DataPoint #1Timestamp 4 UInt32Value ChannelHeader1.VariableSize ChannelHeader.DataTypeDataPoint #2...DataPoint ChannelHeader #1.Samples In FileData Channel #2...

Page 72: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View72 Version: 1.5

Data Channel #MainHeader.ChannelCount

4.11.3 Export tdms / datRecorded data can be saved in a scope data file (.svd). Alternatively data can be exported to .tdms or .datformat once the current recording is stopped. Both data formats are widely used in measurementapplications and can be used with the TwinCAT 3 Scope View Professional version.

To export the recording, select the command Export to DAT or Export to TDMS in the Scope menu.

4.11.4 Automated exportFrom Scope version 3.2.3129 an additional TC3ScopeExport tool is installed in the TE130X Scope Viewfolder. This can be used to convert content from .svd files into the supported export formats. The tool comeswith integrated documentation and requires a Professional license.

The TC3ScopeExport tool can also be used for export via a command line call, based on specifiedparameters. The interface shown here can be suppressed by entering the keyword “silent” in the commandline. In this case the export is executed in the background.

To automate the export, the tool can be called from the PLC via NT_StartProcess. A small code examplewith fixed strings and fbStartExport as instance of NT_StartProcess is shown below:fbStartExport(    NETID:= '',     PATHSTR:= 'C:\TwinCAT\Functions\TE130X-Scope-View\TC3ScopeExportTool.exe',     DIRNAME:= 'C:\TwinCAT\Functions\TE130X-Scope-View',     COMNDLINE:= '"svd=c:\Scope Project.svd" target=c:\TestExport.csv silent',     START:= bStart,     TMOUT:= T#20S,     BUSY=> ,     ERR=> ,     ERRID=> );

4.12 ReportingWith the help of the Microsoft Visual Studio Report Designer it is possible to generate complex printingtemplates which are used by the TwinCATMeasurement, for example, to print Scope charts.

Page 73: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 73Version: 1.5

From the recording shown here, the following report is generated via the Print command in the File menu ofVisual Studio ([Ctrl] + [P]): https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/pdf/18014398691815691.pdf.

Integration of a report in a TwinCAT Measurement Project

Beckhoff already supplies a ready-made printing template with each installation of TwinCAT 3.1 in theTwinCAT Measurement. It can be added in any existing TwinCAT measurement project via the context menucommand Add > New Item > Standard Report. This printing template is already contained in the projectwith the TwinCAT Measurement Template “Measurement Scope Project with Reporting”.

Editing a report

To edit a report, open Microsoft Visual Studio Report Designer by double-clicking the print template.

Page 74: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View74 Version: 1.5

For editing report templates please refer to the following article: Report Designer (Visual Studio).

Data of the data set

For the design of your own printing templates, Beckhoff offers a ready-made data set containing all relevantdata of a Scope chart.

• Built-in Fields◦ Execution Time: time at which a print job was created.◦ Page Number: Current page number◦ Report Name: Name of the report◦ Total Pages: Total number of pages in the document◦ User ID: User ID of the user who commissioned the report.◦ Language: Set system language

• Parameters◦ ChartImage: Converted image of the chart. Can be converted back to an image using the

expression (System.Convert.FromBase64String (Parameters!ChartImage.Value).◦ FilePath: Storage location of the associated Scope file.◦ Comment: The comment saved in the Scope element

Page 75: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 75Version: 1.5

◦ RecordStart: Start time of the recording.◦ RecordStop: Stop time of the recording.

• Images◦ logo: Beckhoff logo used in the standard template

• Channel_Properties◦ AxisName: Name of the axis◦ ChannelColorHex: Color of the channel in hexadecimal notation◦ ChannelComment: Comment on the channel◦ ChannelName: Name of the channel

• Cursor_Status_Times◦ ColorHex: Color of the cursor in hexadecimal notation◦ Column: Name of the cursor column◦ Row: Name of the cursor row◦ Value: Displayed value

• Cursor_X_Values◦ ColorHex: Color of the cursor in hexadecimal notation◦ Column: Name of the cursor column◦ Row: Name of the cursor row◦ Value: Displayed value

• Cursor_Y_Values◦ ColorHex: Color of the cursor in hexadecimal notation◦ Column: Name of the cursor column◦ Row: Name of the cursor row◦ Value: Displayed value

• Chart_Data◦ Channel: Name of the channel◦ Time: Time stamp of the value◦ Value: Displayed value

Note

Use of Chart_DataThe Chart_Data are the raw data of the chart. The data are only exported if the setting Ex-port Raw Data to Report was selected (Options dialog [} 77])This setting significantly delays the creation of reports.The raw data of the chart are for the creation of your own displays.

4.13 Support Information ReportThe Support Information Report is a tool for collecting product information for submission to Beckhofftechnical support. Collecting product-related data such as TwinCAT version/build, product version, imageversion and device type reduces email traffic significantly and enables more efficient advice.

Plug-in mechanism

Various Beckhoff products interface with the Support Information Report via a plug-in mechanism. Theseproducts, such as the TwinCAT Database Server, have a Support Information Report entry in thecorresponding product menu.

Creating and submitting a Support Information Reportü A Support Information Report is open.1. Use the Behaviour text field to describe the behavior that occurred in as much detail as possible.

Page 76: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View76 Version: 1.5

2. In the Attachment area, you can add files (screenshots etc.) to the report via the Add Attachmentbutton, if required. Files can optionally be selected via remote access. To do this, select a target fromthe Remote System dropdown list. Depending on the selected target, it may be possible to browseWindows CE devices.

3. Enter your contact details and select a Beckhoff subsidiary for your country.NOTE! This information is obligatory for submitting the Support Information Report.

4. You will be offered the option to store your contact details for future Support Information Reports. To dothis, tick the Store personal data check box.

5. The product-specific plug-ins can be found in the lower section of the Support Information Report. Tickthe Include in report check box. The information required for the product is added automatically, if it isavailable. The screenshot shows the current configuration of a TwinCAT Database Server in the form ofan XML file as an example.

6. Submitting the Support Information Report:• If the device has an email connection, you can submit the Support Information Report directly to the

Beckhoff subsidiary for your country via the Send Report button.• If the device does not have an email connection, you can save the Support Information Report locally

as a .zip file via the Save .zip button and then make it available via FTP, USB etc.

Page 77: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 77Version: 1.5

4.14 Scope options

4.14.1 Options dialogThe TwinCAT measurement options can be opened in Visual Studio via the Scope menu commandOptions…

The standard or default settings can be made here.

Page 78: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View78 Version: 1.5

Reporting• General

◦ Show Chart Timebar: Specifies whether the time bar of the Scope chart should be visible inthe printing template.

◦ Show Chart Toolbar: Specifies whether the toolbar of the Scope chart should be visible in theprinting template.

◦ Use Custom Color: If “Use Custom Color” is active, the following color settings are appliedbefore the chart is exported for the report. (You can select color combinations that reduce theink consumption for printing).

◦ Border Background Color: Color for the border of the chart◦ Chart Background Color: Color for the background of the chart◦ X-Axis Color: Color for the labeling of the X-axis◦ X-Axis Color: Color for the grid of the X-axis◦ Y-Axis Color: Color for the labeling of the Y-axis◦ Y-Axis Color: Color for the grid of the Y-axis◦ Y-Axis Color: Color for the grid of the Y-axis◦ Export Raw Data to Report: Provides the raw chart data for the report. (Significantly extends

the time it takes to generate a report | Only required for creating custom charts).

Scope• General: Here you can enter settings relating to tracing of the Scope View product components.• Acquisition: Defines the standard acquisition data (used if empty channels are inserted); for a detailed

description see Acquisition [} 37].• Channel: Defines the standard channel settings (used if empty channels are inserted); for a detailed

description see Channel properties [} 35].• Chart: Defines the standard chart settings (used if new charts are inserted); for a detailed description

see Chart properties [} 30].• Error List

◦ Clear on Record: Deletes the respective error messages for the Scope instance from theerror list as soon as a Scope changes to the record mode.

◦ Show Clear List Command: Shows the context menu command Clear Error List....◦ Show Messages: Shows messages from the Scope in the error list.◦ Show Warnings: Shows warnings from the Scope in the error list.

• Scope: Defines the standard Scope settings (used if new Scope instances are inserted); for a detaileddescription see Scope properties [} 28].

• X-Axis: Specify the standard axis settings for the X-axis (this option is used when new axes areadded); for a detailed description see Axis properties [} 33].

• Y-Axis: Specify the standard axis settings for the X-axis (this option is used when new axes areadded); for a detailed description see Axis properties [} 33].

4.14.2 Multiple selection

Changes by group

Some parameters are often modified for several or all elements. To do this you can mark several elementsvia the Solution Explorer and edit the settings of all marked elements at the same time. Data that differbetween the selected elements are represented as empty fields.

Page 79: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Configuration

TC3 Scope View 79Version: 1.5

To make multiple selections, keep the [Ctrl] key pressed during the selection. In the case of successiveelements you can select the first element, keep the [Shift] key pressed and then select the last element inorder to mark all elements in between. In addition, it is easily possible to select all channels of a Scope,regardless of the configuration structure. Press and hold the [Alt] key and double-click on the first channel inthe Scope configuration.

All elements of the same type can be selected.

Multiple selection is implemented for:

• Scopes• Charts• Axes• Channels• Cursor• Trigger Groups• Trigger Sets

Page 80: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View80 Version: 1.5

5 .NET API

5.1 ScopeViewControl integration

Integration of the ScopeViewControl in your own applications

The TwinCAT Scope consists of different components. The main components are Scope View and ScopeServer. The Scope View includes the ScopeViewControl, which can be used as a separate component forcustom visualizations. The ScopeViewControlLib developed in .NET is available with the installation ofTwinCAT 3.1 from version 4006. In this way simple integration is possible in C#, VB.Net or WPFapplications.

Note

Required softwareThe ScopeViewControl requires .NET Framework 4.0. The .NET Framework 4 Client Pro-file is not supported.

Installation of the .NET Framework 4.01. Right-click on the project and select Properties.2. Under Application, select “.NET Framework 4” as the target framework.ð The .NET Framework 4.0 is installed.

MS Visual Studio

To add the ScopeViewControl to an existing or newly created project, use the Designer in Visual Studio:

1. Open the form or the control to which the ScopeViewControl is to be added.2. Right-click on a blank area in the toolbox and select Choose Items....

ð A dialog opens.

Page 81: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 81Version: 1.5

3. Select Browse.4. Find the folder TwinCAT.Scope2.View in the .NET-GAC (Global Assembly Cache) and open it.

(Computer > Local Disk (C:) > Windows > Microsoft.NET > assembly > GAC_MSIL > TwinCAT.Scope2.View.Control)

5. Select TwinCAT.Scope2.View.Control.dll and confirm.ð A gearwheel now appears in toolbox with the entry “ScopeViewControl”.

6. Use the mouse to drag one or several ScopeViewControls in the Designer and position it.ð You have now added the ScopeViewControl to a project.

If the project is now compiled, Visual Studio may report missing references to theTcAdsScope2Communications and TwinCAT.Scope2.Tools libraries. Execute the following steps:

1. Right-click on the current project in the Solution Explorer and select Add Reference.ð A dialog opens.

2. In the Browse tab, select the installation path of the .NET-GAC (Global Assembly Cache).3. Add the following libraries to the project:

• TwinCAT.Ads.dll• TwinCAT.Scope2.Tools.dll• TwinCAT.Scope2.Communications.dll

5.1.1 Sample YT ChartThe application shown in the example below serves to illustrate the main aspects of ScopeViewControl.

First, a new Windows Forms application is created. Use the toolbox to add a toolbar and the buttons shownabove to the form. By double clicking, a click event handler can be created for each button, which is filledwith the sample code below. Then, a ScopeViewControl is added to the form and the “Dock” property is setto “Fill”.

Page 82: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View82 Version: 1.5

Note

Required softwareThe ScopeViewControl requires .NET Framework 4.0. The .NET Framework 4 Client Pro-file is not supported.

Installation of the .NET Framework 4.01. Right-click on the project and select Properties.2. Under Application, select “.NET Framework 4” as the target framework.ð The .NET Framework 4.0 is installed.

The example developed here is available as a VS2010 project: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/2646930955.zip

The example accesses variables from the sample PLC program: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/9007201536966411.zip

5.1.1.1 Loading the configuration

Loading the configuration

The project, which is now executable, shows a gray surface at the start, since no configuration has beenloaded or created. A configuration can either be created programmatically, or a file created with the TwinCATScope can be loaded. In this case, clicking on the Load button loads an existing configuration from a file.

The C# code example shows the call from a ButtonClick EventHandler:private string filename = @"ScopeTest.tcscope";

private void button_Load_Click(object sender, EventArgs e){ FileInfo finfo = new FileInfo(filename); if (!finfo.Exists) {    MessageBox.Show(this, "File not found! Please use the 'New' buttons to create a config.\r\n        Once a config is created and saved it can be load using the 'Load' -But-ton!", "File not found!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else {    // alte Konfiguration löschen    while (scopeViewControl1.Charts.Count > 0)    {     scopeViewControl1.DeleteChart(scopeViewControl1.Charts[0]);    }    // Konfiguration laden    scopeViewControl1.LoadScopeConfig(filename);

    foreach (ScopeViewControlChannel channel in scopeViewControl1.ConnectedChannels)    {     channel.Acquisition.AmsNetId = AmsNetId.Local;    } }}

Creating the configuration by programming

The ScopeViewControl offers methods for all functions that are also called from the TwinCAT Scope. Furtherdetails can be found in the API documentation for ScopeViewControlLib: ScopeViewControlLib

5.1.1.2 Adding elements

All elements that can be added in the TwinCAT Scope are generated in the ScopeViewControl by a methodin the respectively higher element:

Charts:

Page 83: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 83Version: 1.5

private void buttonChart_Click(object sender, EventArgs e){ ScopeViewControlChart chart = scopeViewControl1.NewChart();}

(Y-)Axes: private void buttonAxis_Click(object sender, EventArgs e){ if (scopeViewControl1.Charts.Count == 0) {    MessageBox.Show(this, "Please create a chart first!", "No chart        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);  } else {    ScopeViewControlYAxis axis = scopeViewControl1.Charts[0].NewAxis(); }}

Channels:private void buttonChannel_Click(object sender, EventArgs e){ if (scopeViewControl1.Charts.Count == 0) {    MessageBox.Show(this, "Please create a chart first!", "No chart        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (scopeViewControl1.Charts[0].Axes.Count == 0) {    MessageBox.Show(this, "Please create an YAxis first!", "No axis        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (scopeViewControl1.Charts[0].Axes[0].Channels.Count > 0) {    MessageBox.Show(this, "This sample contains only one channel!",        "Channel still connected!", MessageBoxButtons.OK,        MessageBoxIcon.Exclamation); } else {    ScopeViewControlChannel channel = scopeViewControl1.        Charts[0].Axes[0].NewChannel();        ChangeChannelSettings(channel);        SetAcquisition(channel); }

5.1.1.3 Adapting the styles

Each of the elements created has a “Style” property, in which all the properties are saved that are alsovisible in the corresponding Visual Studio Properties window. A channel can be assigned a color and a linewidth, for example.private void ChangeChannelSettings(ScopeViewControlChannel channel){ if (scopeViewControl1.Charts.Count == 0) {    MessageBox.Show(this, "Please create a chart first!", "No chart connected!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (scopeViewControl1.Charts[0].Axes.Count == 0) {    MessageBox.Show(this, "Please create an YAxis first!", "No axis connected!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (scopeViewControl1.Charts[0].Axes[0].Channels.Count == 0) {    MessageBox.Show(this, "Please create a Channel first!", "No channel connected!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else {    channel.Style.LineColor = Color.Red;    channel.Style.MarkColor = Color.DarkRed;    channel.Style.LineWidth = 2; }}

Page 84: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View84 Version: 1.5

5.1.1.4 Adaptation of the acquisition data

In addition to the “Style” property, each channel also the an “Acquisition” property. This is where the link to asystem variable is set:private void SetAcquisition(ScopeViewControlChannel channel){ if (scopeViewControl1.Charts.Count == 0) {    MessageBox.Show(this, "Please create a chart first!", "No chart connected!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (scopeViewControl1.Charts[0].Axes.Count == 0) {    MessageBox.Show(this, "Please create an YAxis first!", "No axis connected!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (scopeViewControl1.Charts[0].Axes[0].Channels.Count == 0) {    MessageBox.Show(this, "Please create a Channel first!", "No channel connected!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else {    // AmsNetId und AmsPort benötigen die TwinCAT.Ads.dll    channel.Acquisition.AmsNetId = AmsNetId.Local;    channel.Acquisition.TargetPort = 851;    channel.Acquisition.IsSymbolBased = true;    channel.Acquisition.SymbolName = "Variables.fStairs";    channel.Acquisition.DataType = DataTypeConverter.AdsToScope2Datatype(AdsDatatypeId.ADST_INT16);    channel.Acquisition.SampleTime = (uint)(10 * TimeSpan.TicksPerMillisecond); }}

5.1.1.5 Controlling the recording

All methods and properties that can be used for ScopeViewControl are consolidated in the “Operating”property. Here, all the properties can be found that are also visible in the Visual Studio Properties windowwith the Scope selected. Beyond that, methods are available for starting and stopping the recording or forsaving and export.private void button_StartRecord_Click(object sender, EventArgs e){ try {    // alte Daten verwerfen    if (scopeViewControl1.State == ScopeViewControlStates.REPLY)     scopeViewControl1.Operating.DisConnect(false);

    // Aufnahme starten    if (scopeViewControl1.State == ScopeViewControlStates.CONFIG)     scopeViewControl1.Operating.StartRecord();

    // alle Charts starten    if (scopeViewControl1.State == ScopeViewControlStates.CONNECTED)     scopeViewControl1.Operating.StartAllDisplays(); } catch (Exception err) {    MessageBox.Show(this, err.Message, "Error on start record!",         MessageBoxButtons.OK, MessageBoxIcon.Error); }

}    private void button_StopRecord_Click(object sender, EventArgs e){ try {    if (scopeViewControl1.State == ScopeViewControlStates.RECORD)     scopeViewControl1.Operating.StopRecord(); } catch (Exception err) {    MessageBox.Show(this, err.Message, "Error on stop record!",         MessageBoxButtons.OK, MessageBoxIcon.Error);

Page 85: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 85Version: 1.5

 }}

private void button_Save_Click(object sender, EventArgs e){ try {    // wenn Daten da sind speichern    if (scopeViewControl1.State == ScopeViewControlStates.REPLY)    {     File.Create("ExportData.svd").Close();     scopeViewControl1.Operating.SaveData("ExportData.svd");    }    // sonst nur die Konfiguration speichern    else    {     File.Create(filename).Close();     scopeViewControl1.SaveScopeConfig(filename);    } } catch (Exception err) {    MessageBox.Show(this, err.Message, "Error on save!",         MessageBoxButtons.OK, MessageBoxIcon.Error); }}

5.1.1.6 Controlling a chart

All charts that have been added to the configuration have their own toolbox in order to make them operable.However, it is also possible to operate these functions via the “ChartOperating” property. This also includesoptions for showing and hiding the toolbar and the timeline.private void button_Run_Click(object sender, EventArgs e){ if (scopeViewControl1.State != ScopeViewControlStates.RECORD) {    MessageBox.Show(this, "Only possible if a record is running!", "Run not possible!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);  } if (scopeViewControl1.State == ScopeViewControlStates.RECORD)    scopeViewControl1.Charts[0].ChartOperating.StartDisplay();}

private void button_Pause_Click(object sender, EventArgs e){ if (scopeViewControl1.State != ScopeViewControlStates.RECORD) {    MessageBox.Show(this, "Only possible if a record is running!", "Pause not possible!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } if (scopeViewControl1.State == ScopeViewControlStates.RECORD)    scopeViewControl1.Charts[0].ChartOperating.StopDisplay();}

private void button_DeleteChart_Click(object sender, EventArgs e){ if (scopeViewControl1.Charts.Count == 0) {    MessageBox.Show(this, "No chart is connected!", "Nothing to delete!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (scopeViewControl1.State == ScopeViewControlStates.RECORD) {    scopeViewControl1.Operating.StopRecord();    scopeViewControl1.Operating.DisConnect(false); } else if (scopeViewControl1.State == ScopeViewControlStates.REPLY) {    scopeViewControl1.Operating.DisConnect(false); } else {    scopeViewControl1.DeleteChart(scopeViewControl1.Charts        [scopeViewControl1.Charts.Count - 1]); }}

Page 86: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View86 Version: 1.5

5.1.2 Sample XY ChartThe form shown above illustrates a Scope View control integration in C# with an XY chart. The procedure forcreating this chart is explained below.

First, a Windows Forms application is created. Use the toolbox to add a toolbar and the buttons shownabove to the form. Then add a ScopeViewControl and set the “Dock” property to “Fill”, so that the chart fillsthe window.

Note

Required softwareThe ScopeViewControl requires .NET Framework 4.0. The .NET Framework 4 Client Pro-file is not supported.

Installation of the .NET Framework 4.01. Right-click on the project and select Properties.2. Under Application, select “.NET Framework 4” as the target framework.ð The .NET Framework 4.0 is installed.

The program can be found in the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282227083.zip

The variables refer to the TwinCAT program behind the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/9007201536966411.zip

5.1.2.1 Loading the configuration

The code specified above is executed by clicking the Load button in the interface. It is used to load aconfiguration file (.tcscope), which is created with the TwinCAT Scope. This file only contains theconfiguration data, without any recorded values (measured data).

Page 87: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 87Version: 1.5

This method first checks the existence of the file. If this is the case, the configuration opened in the programis deleted, and the configuration from the file is transferred to ScopeViewControl.

The graph can then be displayed by clicking on the Start button. Further information can be found in section“Control recording”.private string filename = @"ScopeTest.tcscope";

private void button_load_Click(object sender, EventArgs e){FileInfo finfo = new FileInfo(filename);if (!finfo.Exists){    MessageBox.Show(this, "File not found! Please use the 'Add'    buttons to create a config.\r\nOnce a config is created and saved it        can be load using the 'Load' Button!", "File not found!",        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else{    // delete old configuration     while (scopeViewControl1.Charts.Count > 0)    {        scopeViewControl1.DeleteChart(scopeViewControl1.Charts[0]);    }    // load configuration     scopeViewControl1.LoadScopeConfig(filename);

    foreach (ScopeViewControlChannel channel in scopeViewControl1.ConnectedChannels)    {        channel.Acquisition.AmsNetId = AmsNetId.Local;    }}}

5.1.2.2 Create configuration

A configuration consists of three hierarchy levels, which build on each other: the chart, the axes and thechannel. The following three buttons are therefore required for creating the configuration: Add Chart, AddAxis and Add Channel.

In Scope, first use the Add Chart button to create a new chart. The chart is the environment, in which thegraph with the coordinate system appears. The chart represents the basic framework and must be createdfirst. Ensure that the “ChartType” property is set to XY.private void button_AddChart_Click(object sender, EventArgs e){ScopeViewControlChart chart = scopeViewControl1.NewChart();scopeViewControl1.Charts[scopeViewControl1.Charts.Count - 1].ChartType = TwinCAT.Scope2.Communica-tions.scopeDisplayModes.XY;scopeViewControl1.ViewDetailLevel = ScopeViewDetailLevel.Extended;}

Then use the Add Axis button to add the X- and Y-axis to create the coordinate system. Since thiscoordinate system is created in the chart, the presence of a chart must be verified. Without a chart, thecoordinate system cannot be created.private void button_AddAxis_Click(object sender, EventArgs e){if (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "Please create a chart first!","No chart        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else{    ScopeViewControlYAxis axis = scopeViewControl1.Charts[0].NewAxis();    if (axis is ScopeViewControlXYAxis)    {        ScopeViewControlXYAxis xyAxis = (ScopeViewControlXYAxis)axis;    }}}

Page 88: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View88 Version: 1.5

Once the axes have been created, the Add Channel button can be used to add an XY-channel. This XY-channel is linked directly to the axes. Therefore, the system first checks whether charts and axes havealready been created. When creating the XY-channel, ensure that casting takes place from the Y-objects tothe XY-objects. This is easily possible, since the XY-objects inherit from the Y-objects.private void button_AddChannel_Click(object sender, EventArgs e){if (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "Please create a chart first!", "No chart        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.Charts[0].Axes.Count == 0){    MessageBox.Show(this, "Please create the Axis first!", "No axis        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.Charts[0].Axes[0].Channels.Count > 0){    MessageBox.Show(this, "This sample contains only one channel!",        "Channel still connected!", MessageBoxButtons.OK, MessageBoxIcon.        Exclamation);}else{    ScopeViewControlYAxis axis = scopeViewControl1.Charts[0].Axes[0];

    if (axis is ScopeViewControlXYAxis)    {        ScopeViewControlXYAxis xyAxis = (ScopeViewControlXYAxis)axis;        ScopeViewControlXYChannel channel = xyAxis.NewChannelPair();        ChangeChannelSettings(channel);        SetAcquisition(channel);    }}}

Once the channel has been created, the chart style can be modified, and the acquisition can be set. Themethods ChangeChannelSettings and SetAcquisition used for this are explained in more detail in thefollowing chapters.

5.1.2.3 Edit channel

The “Style” and the acquisition data can be edited for each channel.

For the appearance of the chart there is a “Style” property, in which the corresponding values are defined.This is where colors and line width can be assigned, for example.private void ChangeChannelSettings(ScopeViewControlXYChannel channel){channel.Style.LineColor = Color.Red;channel.Style.MarkColor = Color.DarkRed;channel.Style.LineWidth = 2;}

The acquisition data of a channel describe the connection between the Scope and the respective value ofthe machine control. During the acquisition the “SymbolName” is set. This is the hierarchical variable nameof the signal to be monitored. The signal determines the data type, which is entered in “DataType”. The“AmsNetId” and the “TargetPort” are the connection data leading to the TwinCAT project.private void SetAcquisition(ScopeViewControlXYChannel channel){channel.Acquisition.AmsNetId = AmsNetId.Local;channel.Acquisition.TargetPort = 851;channel.Acquisition.IsSymbolBased = true;channel.Acquisition.SymbolName = "Variables.aBufferSine[1]";channel.Acquisition.DataType = DataTypeConverter.AdsToScope2Datatype(AdsDatatypeId.ADST_REAL64);channel.Acquisition.SampleTime = (uint)(1 * TimeSpan.TicksPerMillisecond);

channel.XAcquisition.AmsNetId = AmsNetId.Local;channel.XAcquisition.TargetPort = 851;channel.XAcquisition.IsSymbolBased = true;channel.XAcquisition.SymbolName = "Variables.aBufferMulti2[1]";

Page 89: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 89Version: 1.5

channel.XAcquisition.DataType = DataTypeConverter.AdsToScope2Datatype(AdsDatatypeId.ADST_REAL64);channel.XAcquisition.SampleTime = (uint)(1 * TimeSpan.TicksPerMillisecond);}

5.1.2.4 Control recording

Use the Start and Stop buttons to start and stop the recording.private void button_Start_Click(object sender, EventArgs e){try{    // alte Daten verwerfen    if (scopeViewControl1.State == ScopeViewControlStates.REPLY)        scopeViewControl1.Operating.DisConnect(false);

    // Aufnahme starten    if (scopeViewControl1.State == ScopeViewControlStates.CONFIG)        scopeViewControl1.Operating.StartRecord();

    // alle Charts starten    if (scopeViewControl1.State == ScopeViewControlStates.CONNECTED)        scopeViewControl1.Operating.StartAllDisplays();}catch (Exception err){    MessageBox.Show(this, err.Message, "Error on start record!",         MessageBoxButtons.OK, MessageBoxIcon.Error);}}

private void button_Stop_Click(object sender, EventArgs e){try{    if (scopeViewControl1.State == ScopeViewControlStates.RECORD)        scopeViewControl1.Operating.StopRecord();}catch (Exception err){    MessageBox.Show(this, err.Message, "Error on stop record!",         MessageBoxButtons.OK, MessageBoxIcon.Error);}}

The properties of the “Operation” class are available in ScopeViewControl for starting or stopping therecording.

If a recording is currently displayed, it must be removed before a new recording. The recording is thenstarted. For display on the interface the display is then started.

To stop a recording, execute the method StopRecord. Press the Stop button.

5.1.2.5 Save configuration / recordingprivate void button_Save_Click(object sender, EventArgs e){try{    // wenn Daten da sind speichern    if (scopeViewControl1.State == ScopeViewControlStates.REPLY)    {        File.Create("ExportData.svd").Close();        scopeViewControl1.Operating.SaveData("ExportData.svd");    }    // sonst nur die Konfiguration speichern    else    {        File.Create(filename).Close();        scopeViewControl1.SaveScopeConfig(filename);    }}catch (Exception err){    MessageBox.Show(this, err.Message, "Error on save!", 

Page 90: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View90 Version: 1.5

        MessageBoxButtons.OK, MessageBoxIcon.Error);}}

There are two save options, as indicated in the code:

• Saving the recorded data in a .svd file• Creating a configuration file (.tcscope)

The difference is that the .svd file can be opened in any TwinCAT 3 Scope view, in order to display themeasured data. The .tcscope file, on the other hand, only contains the configuration, without measured data.It can be used to start new recordings, as required.

5.1.2.6 Control chart

The Run and Pause buttons can be used to pause and resume the graph during recording. Use theDelChart button to remove the chart from the display.private void button_Run_Click(object sender, EventArgs e){if (scopeViewControl1.State != ScopeViewControlStates.RECORD){    MessageBox.Show(this, "Only possible if a record is running!", "Run         not possible!", MessageBoxButtons.OK, MessageBoxIcon.        Exclamation);}if (scopeViewControl1.State == ScopeViewControlStates.RECORD)    scopeViewControl1.Charts[0].ChartOperating.StartDisplay();}

private void button_Pause_Click(object sender, EventArgs e){if (scopeViewControl1.State != ScopeViewControlStates.RECORD){    MessageBox.Show(this, "Only possible if a record is running!",         "Pause not possible!", MessageBoxButtons.OK, MessageBoxIcon.        Exclamation);}if (scopeViewControl1.State == ScopeViewControlStates.RECORD)    scopeViewControl1.Charts[0].ChartOperating.StopDisplay();}

private void btn_DelChart_Click(object sender, EventArgs e){if (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "No chart is connected!", "Nothing to delete!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.State == ScopeViewControlStates.RECORD){    scopeViewControl1.Operating.StopRecord();    scopeViewControl1.Operating.DisConnect(false);}else if (scopeViewControl1.State == ScopeViewControlStates.REPLY){    scopeViewControl1.Operating.DisConnect(false);}else{    scopeViewControl1.DeleteChart(scopeViewControl1.Charts        [scopeViewControl1.Charts.Count - 1]);}}

Since this function can only be used in recording mode, the system checks whether signals are currentlybeing recorded.

The Run button and the method StartDisplay behind it can then be used to resume the chart. TheStopDisplay method can be used to pause the display via the Pause button. The recording continues in thebackground. This is apparent if the Overview chart is active, for example.

Page 91: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 91Version: 1.5

Before the chart is deleted, the system checks whether a chart is open in the display. It then checks whetherrecording is active. If this is the case, the current recording is stopped. The method DisConnect underOperating can be used to remove the chart from the display. The method DeleteChart can be used to deletea chart from ScopeViewControl.

5.1.3 Sample YT CursorThe following section describes the use of cursors in a ScopeViewControl, based on an YT-chart.

In this sample the programming language C# is used.

First, a Windows Forms application is created. Use the toolbox to add a toolbar and the buttons shownabove to the form. Then add a ScopeViewControl and set the “Dock” property to “Fill”, so that the chart fillsthe window. The cursor values should be displayed in tables. This corresponds to the Cursor window inScope View. To this end, two DataGridView elements have to be added to the form. The two columns “Y-Cursor” and “Position” have to be added to the DataGridView on the right. To do this, click on Browse in the“Columns” row in the Properties window to open the dialog Edit Columns. You can then use Add to createnew columns. The header text corresponds to the displayed column header.

The code after the buttons Load and Create Configuration largely corresponds to the code from the samplefor the ScopeViewControl YT chart. All you have to do is create an additional column for the channel inDataGridView.private string filename = @"ScopeTest.tcscope";

private void button_Load_Click(object sender, EventArgs e){ FileInfo finfo = new FileInfo(filename); if (!finfo.Exists) {    MessageBox.Show(this, "File not found! Please use the 'Create Configuration' button to cre-ate a config.\r\n

Page 92: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View92 Version: 1.5

        Once a config is created and saved it can be load using the 'Load' -But-ton!", "File not found!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else {    // alte Konfiguration löschen    while (scopeViewControl1.Charts.Count > 0)    {     scopeViewControl1.DeleteChart(scopeViewControl1.Charts[0]);    }    // Konfiguration laden    scopeViewControl1.LoadScopeConfig(filename);

    foreach (ScopeViewControlChannel channel in scopeViewControl1.ConnectedChannels)    {        channel.Acquisition.AmsNetId = AmsNetId.Local;        dataGridView1.Columns.Add(channel.Acquisition.SymbolName, channel.Acquisition.SymbolName);        dataGridView1.Columns[channel.Acquisition.SymbolName].DefaultCellStyle.ForeColor = chan-nel.Style.Color;    } }}

Create Configuration is a combination of the three buttons Add Chart, Add Axis and Add Channel.private void button_CreateConfiguration_Click(object sender, EventArgs e){//Add ChartScopeViewControlChart chart = scopeViewControl1.NewChart();

//Add Axisif (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "Please create a chart first!", "No chart connected!",        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else{    ScopeViewControlYAxis axis = scopeViewControl1.Charts[0].NewAxis();}

//Add Channelif (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "Please create a chart first!", "No chart connected!",        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.Charts[0].Axes.Count == 0){    MessageBox.Show(this, "Please create an YAxis first!", "No Axis connected!",        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.Charts[0].Axes[0].Channels.Count > 0){    MessageBox.Show(this, "This sample contains only one channel!", "Channel still connected",        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else{    ScopeViewControlChannel channel = scopeViewControl1.Charts[0].Axes[0].NewChannel();    ChangeChannelSettings(channel);    SetAcquisitions(channel);    dataGridView1.Columns.Add(channel.Acquisition.SymbolName, channel.Acquisition.SymbolName);    dataGridView1.Columns[channel.Acquisition.SymbolName].DefaultCellStyle.ForeColor = chan-nel.Style.Color;}}

Note

Required softwareThe ScopeViewControl requires .NET Framework 4.0. The .NET Framework 4 Client Pro-file is not supported.

Installation of the .NET Framework 4.01. Right-click on the project and select Properties.

Page 93: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 93Version: 1.5

2. Under Application, select “.NET Framework 4” as the target framework.ð The .NET Framework 4.0 is installed.

The program can be found in the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282228747.zip

The variables refer to the TwinCAT program behind the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/9007201536966411.zip

5.1.3.1 Add cursors

The cursors for a chart can be found in the “CursorModule” class. To add a cursor, call the methodNewCursor(Boolean). The Boolean value determines whether the cursor is an X- or Y-cursor. To create anX-cursor, set the value to “false”. For a Y-cursor, set the value to “true”.

Once the cursors have been created, add the method events to update the tables on the interface. The lastevent is triggered with a mouse click on the cursor. These methods are discussed in more detail below.

The new cursor, including its color, is then added in the table. In addition the refreshX method is called toupdate the values in the table.

Finally, the method is called which recreates the view of the delta values. This method is described in moredetail below.private void buttonXCursor_Click(object sender, EventArgs e){try{    //X-Cursor hinzufügen    ScopeViewControlCursor newCursor = scopeViewControl1.Charts[0].CursorModule.NewCursor(false);

    //Methodenevents    newCursor.ChannelValuesChanged += new System.EventHandler(this.resfreshX);    newCursor.StatusTimesChanged += new System.EventHandler(this.timeRefreshX);    newCursor.Selected += new System.EventHandler(this.actCursorRefresh);

    //Cursor der Tabelle hinzufügen und Tabelle aktualisieren    dataGridView1.Rows.Insert(scopeViewControl1.Charts[0].CursorModule.        XCursor.Count -1, newCursor.StatusTimes.ChartPositionTime.ToString(), newCursor.Style.Name);    dataGridView1.Rows[scopeViewControl1.Charts[0].CursorModule.XCursor.Count - 1].Cells[1].Style.        ForeColor = newCursor.Style.Color;    resfreshX(newCursor, null);

    //Delta-Werte aktualisieren    setXDeltaView();}catch (Exception) { }}

private void buttonYCursor_Click(object sender, EventArgs e){try{    //Y-Cursor hinzufügen    ScopeViewControlCursor newCursor = scopeViewControl1.Charts[0].CursorModule.NewCursor(true);

    //Methodenevents    newCursor.AxesValuesChanged += new System.EventHandler(this.resfreshY);    newCursor.Selected += new System.EventHandler(this.actCursorRefresh);

    //Cursor der Tabelle hinzufügen    dataGridView2.Rows.Insert(scopeViewControl1.Charts[0].CursorModule.        YCursor.Count - 1, newCursor.Style.Name, newCursor.AxesValues[0]);    dataGridView2.Rows[scopeViewControl1.Charts[0].CursorModule.YCursor.Count - 1].DefaultCellStyle.        ForeColor = newCursor.Style.Color;

    //Delta-Werte aktualisieren    setYDeltaView();}catch (Exception) { }}

Page 94: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View94 Version: 1.5

5.1.3.2 Delete cursor

The method DeleteCursor from the “CursorModule” class deletes the cursor that was transferred to it. Thecursor data in the table are then updated. First, the cursor is deleted from the table. Then, the method forupdating the delta values is called.private void buttonDeleteXC_Click(object sender, EventArgs e){try{    scopeViewControl1.Charts[0].CursorModule.DeleteCursor(scopeViewControl1.Charts[0].CursorModule.        XCursor[dataGridView1.SelectedCells[0].RowIndex]);    dataGridView1.Rows.RemoveAt(dataGridView1.SelectedCells[0].RowIndex);    setXDeltaView();}catch (Exception) { }}

private void butteonDeleteYC_Click(object sender, EventArgs e){try{    scopeViewControl1.Charts[0].CursorModule.DeleteCursor(scopeViewControl1.Charts[0].CursorModule.        YCursor[dataGridView2.SelectedCells[0].RowIndex]);    dataGridView2.Rows.RemoveAt(dataGridView2.SelectedCells[0].RowIndex);    setYDeltaView();}catch (Exception){}}

5.1.3.3 Delta values

To ensure that the display of the delta values matches the edited cursor, all old delta values are deleted first.The current delta values are then calculated and added to the table.

Note that X-cursors have several delta values if there are several channels, since all possible differences arecalculated for each individual channel. For these cursors all channel values therefore have to be queriedagain. These queries are not required for the Y-cursors, since they only display the Y-values of the cursors.

The values are updated under events. This procedure is explained in section “Updating values”.private void setXDeltaView(){//delete old valueswhile (scopeViewControl1.Charts[0].CursorModule.XCursor.Count != dataGridView1.Rows.Count){    dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count - 1);}//set new valuesfor (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; i++){    for (int k = i + 1; k < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; k++)    {        dataGridView1.Rows.Add(TimeSpan.Parse(dataGridView1[0, i].Value.            ToString()) - TimeSpan.Parse(dataGridView1[0, k].Value.ToString()),             dataGridView1[1, i].Value + " - " + dataGridView1[1, k].Value);

        for (int h = 2; h < scopeViewControl1.Charts[0].Axes[0].Channels.Count + 2; h++)        {            if (dataGridView1[h, k].Value != null)            {                dataGridView1[h, dataGridView1.Rows.Count - 1].Value = Convert.                    ToDouble(dataGridView1[h, i].Value) - Convert.ToDouble(dataGrid-View1[h, k].Value);            }        }    }}}

private void setYDeltaView(){//delete old valueswhile (scopeViewControl1.Charts[0].CursorModule.YCursor.Count != dataGridView2.Rows.Count){

Page 95: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 95Version: 1.5

    dataGridView2.Rows.RemoveAt(dataGridView2.Rows.Count - 1);}//add new valuesfor (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.YCursor.Count; i++){    for (int k = i + 1; k < scopeViewControl1.Charts[0].CursorModule.YCursor.Count; k++)    {        dataGridView2.Rows.Add(dataGridView2[0, i].Value + " - " + dataGridView2            [0, k].Value, Convert.ToDouble(dataGridView2[1, i].Value) - Convert.ToDouble(dataGrid-View2[1, k].Value));    }}}

5.1.3.4 Update values

There are three methods for updating the cursor values in the tables: refreshX, refreshY and timeRefreshX.Since these methods are called through events, the respective cursor is sent as a parameter.

This allows this cursor to be found in the table first, so that the values can then be modified.

The delta values are then revised. Several rows are edited during this process. Each cell is recalculated. Thevalues in each cell should be edited, rather than deleting and recreating the row. The latter approach wouldhave a negative impact on the performance, resulting in flickering of the interface, since the program isunable to update the values fast enough.

Note that, in contrast to the Y-cursors, the X-cursors have several delta values if several channels arerecorded at the same time.private void resfreshX(object sender, EventArgs e){try{    ScopeViewControlCursor tmpCursor = (ScopeViewControlCursor)sender;    //set new channel value    for (int k = 0; k < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; k++)    {        if (scopeViewControl1.Charts[0].CursorModule.XCursor[k] == tmpCursor)        {            for (int j = 0; j < tmpCursor.ChannelValues.Count; j++)            {                dataGridView1[j + 2, k].Value = tmpCursor.ChannelValues[j];            }            break;        }    }    //refresh all delta values    int m = scopeViewControl1.Charts[0].CursorModule.XCursor.Count;    for (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; i++)    {        for (int k = i + 1; k < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; k++)        {            for (int h = 2; h < scopeViewControl1.Charts[0].Axes[0].Channels.Count + 2; h++)            {                if (dataGridView1[h, k].Value != null)                {                    dataGridView1[h, m].Value = Convert.ToDouble                        (dataGridView1[h, i].Value) - Convert.ToDouble(dataGridView1[h, k].Value);                }            }            m++;        }    }}catch (Exception) { }}

private void resfreshY(object sender, EventArgs e){try{    ScopeViewControlCursor tmpCursor = (ScopeViewControlCursor)sender;    //set new axes value    for (int i = 0; i < dataGridView2.Rows.Count; i++)    {

Page 96: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View96 Version: 1.5

        if (dataGridView2[0, i].Value.ToString() == tmpCursor.Style.Name)        {            dataGridView2[1, i].Value = tmpCursor.AxesValues[0].ToString();            break;        }    }    //refresh all deltavalues    int m = scopeViewControl1.Charts[0].CursorModule.YCursor.Count;    for (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.YCursor.Count; i++)    {        for (int k = i + 1; k < scopeViewControl1.Charts[0].CursorModule.YCursor.Count; k++)        {            dataGridView2[1, m].Value = Convert.ToDouble                (dataGridView2[1, i].Value) - Convert.ToDouble(dataGridView2[1, k].Value);        }        m++;    }}catch (Exception) { }}

The time values may also change for the X-cursors, which is why the timeRefreshX method is used toupdate the time. The method has the same structure as the methods described above, except that only thetime rows are relevant.private void timeRefreshX(object sender, EventArgs e){//refresh the cursortimefor (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; i++){    dataGridView1[0, i].Value = scopeViewControl1.Charts[0].CursorModule.        XCursor[i].StatusTimes.ChartPositionTime.ToString();}//refresh the deltatimeint m = scopeViewControl1.Charts[0].CursorModule.XCursor.Count;for (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; i++){    for (int k = i + 1; k < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; k++)    {        dataGridView1[0, m].Value = TimeSpan.Parse(dataGridView1[0, i].            Value.ToString()) - TimeSpan.Parse(dataGridView1[0, k].Value.ToString());        m++;    }}}

5.1.3.5 Control cursor via the keyboard

When the cursor is moved via the keyboard, only the cursor selected last is moved. This is also highlightedin the interface.

The KeyDown event of the form is used to move the cursor. This event is always triggered when a key ispressed. The value of the pressed key can be found in the parameter of type “KeyEventArgs” under theproperty “KeyCode”. This value can be compared with the expected values. In this case the cursors shouldbe moved with the keys [D], [A], [W] and [S]. By default, the cursor can also be moved as usual using themouse and the arrow keys. No additional implementation is necessary.

Use the method MoveCursor(int) to move the cursor. The parameter indicates how far the cursor moves. If apositive number is entered, the cursor is shifted in the positive direction and in the negative direction in thecase of a negative number.private void Form1_KeyDown(object sender, KeyEventArgs e){if (e.KeyCode == Keys.D){    try    {        scopeViewControl1.Charts[0].CursorModule.XCursor            [dataGridView1.SelectedCells[0].RowIndex].MoveCursor(5);    }    catch (Exception)    {        MessageBox.Show("There is no X-Axis to move!");    }}

Page 97: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 97Version: 1.5

else if (e.KeyCode == Keys.A){    try    {        scopeViewControl1.Charts[0].CursorModule.XCursor            [dataGridView1.SelectedCells[0].RowIndex].MoveCursor(-5);    }    catch (Exception)    {        MessageBox.Show("There is no X-Axis to move!");    }}else if (e.KeyCode == Keys.W){    try    {        scopeViewControl1.Charts[0].CursorModule.YCursor            [dataGridView2.SelectedCells[0].RowIndex].MoveCursor(5);    }    catch (Exception)    {        MessageBox.Show("There is no Y-Axis to move!");    }}

else if (e.KeyCode == Keys.S){    try    {        scopeViewControl1.Charts[0].CursorModule.YCursor            [dataGridView2.SelectedCells[0].RowIndex].MoveCursor(-5);    }    catch (Exception)    {        MessageBox.Show("There is no Y-Axis to move!");    }}}

There are two ways to select a cursor in the table:

• by direct clicking on the table row. No further code is required.• by clicking on the cursor in ScopeViewControl

The “Select” event of the cursor is called. This event calls the actCursorRefresh method, and the respectivecursor is transferred.

The system then checks the “Style.Orientation” property of the cursor to ascertain whether it is X-cursor oran Y-cursor. The corresponding cursor is then selected, and the corresponding row is selected.private void actCursorRefresh(object sender, EventArgs e){ScopeViewControlCursor tmpCursor = (ScopeViewControlCursor)sender;

if (tmpCursor.Style.Orientation == TwinCAT.Scope2.Charting.ChartingBase.CursorDirection.Vertical){    for (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.XCursor.Count; i++)    {        if (tmpCursor == scopeViewControl1.Charts[0].CursorModule.XCursor[i])        {            dataGridView1.ClearSelection();            dataGridView1[1, i].Selected = true;        }    }}else{    for (int i = 0; i < scopeViewControl1.Charts[0].CursorModule.YCursor.Count; i++)    {        if (tmpCursor == scopeViewControl1.Charts[0].CursorModule.YCursor[i])        {            dataGridView2.ClearSelection();            dataGridView2[0, i].Selected = true;        }    }}}

Page 98: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View98 Version: 1.5

5.1.4 Sample Scope ExportThe following example illustrates the export of a Scope file into another file type (e.g. .txt or .csv).

This sample is based on the programming language C# in a Windows Forms project.

The interface for this sample consists of two text boxes for entering the paths and a button for starting theexport.

Note

The ScopeViewControl requires .NET Framework 4.0. The .NET Framework 4 Client Pro-file is not supported.This application is 32-bit-based.

Installation of the .NET Framework 4.01. Right-click on the project and select Properties.2. Under Application, select “.NET Framework 4.0” as the target framework.

The program can be found in the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282223499.zip

The variables refer to the TwinCAT program behind the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/9007201536966411.zip

5.1.4.1 Export

First, the content of the respective textbox is assigned to the variables svdFile and destination. The systemthen checks whether the user has entered both paths correctly.

The configuration file (.svd file) is then loaded in a ScopeViewControl. Unlike in the other samples, this is notused to output the configuration on the interface, but for export.

Once the configuration is loaded, the path under which the new file is to be stored is split, so that a stringcontaining the file format is formed. The file extension is first checked for all possible file formats available forexport. Once the required format has been found, the respective export method is called on theScopeViewControl instance. The target path of the new file is transferred to the method as parameter(destination).

Finally, the configuration is separated from the control with the method DisConnect(true), and the chart isdeleted with the method DeleteChart().static String svdFile, destination;

ScopeViewControl control = new ScopeViewControl();

private void export_button_Click(object sender, EventArgs e){svdFile = @textBox_SVD.Text;destination = @textBox_Export.Text;

try{    //Checking the existens of the path    if (destination == null)    {

Page 99: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 99Version: 1.5

        destination = Environment.CurrentDirectory;    }    else if (string.IsNullOrEmpty(svdFile) || !File.Exists(svdFile))    {        Console.Write("SVD File could not be found.");    }    else    {        control.LoadScopeConfig(svdFile);    }

    if (string.IsNullOrEmpty(destination))    {        Console.Write("No destination file defined.");    }    else    {        //search the Method with the right export        FileInfo fInfo = new FileInfo(destination);        string format = fInfo.Extension;

        if (format.Equals(ScopeViewControl.socpeExportTdmsExtention))        {            control.Operating.ExportDataToTDMS(destination);        }        else if (format.Equals(ScopeViewControl.ScopeExportCSVExtension) ||            format.Equals(ScopeViewControl.ScopeExportTXTExtension))        {            control.Operating.ExportData(destination);        }        else if (format.Equals(ScopeViewControl.ScopeExportBinaryExtention))        {            control.Operating.ExportDataBinary(destination);        }        else if (format.Equals(ScopeViewControl.ScopeExportDatExtention))        {            control.Operating.ExportDataToDat(destination);        }        else        {            Console.Write("Unknown format.");        }    }    //Disconnect the .svd File    control.Operating.DisConnect(true);    control.DeleteChart(control.Charts[0]);}

catch (Exception ex){    Console.Write(ex.ToString());    Console.ReadLine();    control.Operating.DisConnect(true);}}

5.1.5 Sample Array Bar ChartThe following section explains how to perform a Scope View Control Integration on an Array bar chart bymeans of an example. First, a Windows Forms application is created. Then, the toolbox is used to add atoolbar and the elements shown below, in order to present different functions. In addition to the basicfunctions such as start and stop recording, this also involves scaling the axes and showing or hiding extremevalues in the bar display. The core of the application is, of course, a ScopeViewControl, where the “Dock”property is set to “Fill” so that the graph completely fills the window.

Page 100: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View100 Version: 1.5

Note

Required softwareThe ScopeViewControl requires .NET Framework 4.0. The .NET Framework 4 Client Pro-file is not supported.

Installation of the .NET Framework 4.01. Right-click on the project and select Properties.2. Under Application, select “.NET Framework 4” as the target framework.ð The .NET Framework 4.0 is installed.

The program can be found in the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/3714818315.zip

The variables refer to the TwinCAT program behind the following file: https://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/Resources/zip/9007201536966411.zip

5.1.5.1 Loading the configuration

The code specified above is executed by clicking the Load button in the interface. It is used to load aconfiguration file (.tcscope), which is created with the TwinCAT Scope. This file only contains theconfiguration data, without any recorded values (measured data).

This method first checks the existence of the file. If this is the case, the configuration opened in the programis deleted, and the configuration from the file is transferred to ScopeViewControl.

The graph can then be displayed by clicking on the Start button. Further information can be found in section“Control recording”.private string filename = @"ScopeArrayTest.tcscope";

private void button_load_Click(object sender, EventArgs e){FileInfo finfo = new FileInfo(filename);if (!finfo.Exists){    MessageBox.Show(this, "File not found! Please use the 'Add'    buttons to create a config.\r\nOnce a config is created and saved it        can be load using the 'Load' Button!", "File not found!",        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else{    // delete old configuration     while (scopeViewControl1.Charts.Count > 0)

Page 101: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 101Version: 1.5

    {        scopeViewControl1.DeleteChart(scopeViewControl1.Charts[0]);    }    // load configuration     scopeViewControl1.LoadScopeConfig(filename);

    foreach (ScopeViewControlChannel channel in scopeViewControl1.ConnectedChannels)    {        channel.Acquisition.AmsNetId = AmsNetId.Local;    }}}

5.1.5.2 Create configuration

A configuration consists of three hierarchy levels, which build on each other: the chart, the axes and thechannel. The following three buttons are therefore required for creating the configuration: Add Chart, AddAxis and Add Channel.

In Scope, first use the Add Chart button to create a new chart. The chart is the environment, in which thegraph with the coordinate system appears. The chart represents the basic framework and must be createdfirst. Note that when the NewChart method is called, the DisplayMode “Array” is passed as a parameter, sothat an Array bar chart can be displayed. Optionally, the ViewDetailLevel can be set to “Extended” and theDataToolTips can be switched on, so that they are displayed when the user clicks on a data point.private void button_AddChart_Click(object sender, EventArgs e){ScopeViewControlChart chart = scopeViewControl1.NewChart(scopeDisplayModes.ARRAY);scopeViewControl1.ViewDetailLevel = ScopeViewDetailLevel.Extended;chart.Style.DataPointToolTip = true;}

Then use the Add Axis button to add the X- and Y-axis to create the coordinate system. Since thiscoordinate system is created in the chart, the presence of a chart must be verified. Without a chart, thecoordinate system cannot be created. Note that the newly created Y-axis must be converted to an Arrayaxis.private void button_AddAxis_Click(object sender, EventArgs e){if (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "Please create a chart first!", "No chart connected!",        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else{    ScopeViewControlYAxis axis = scopeViewControl1.Charts[0].NewAxis();

    if (axis is ScopeViewControlArrayAxis)    {        ScopeViewControlArrayAxis arrayAxis = (ScopeViewControlArrayAxis)axis;    }}}

Once the axes have been created, the Add Channel button can be used to add a channel. This channel islinked directly with the axes. Therefore, the system first checks whether charts and axes have already beencreated. The new channel is then created and the ChangeChannelSettings and SetAcquisition methods arecalled to set the channel's style and the acquisition data. The channel that was created first is passed to twomethods as parameter.private void button_AddChannel_Click(object sender, EventArgs e){if (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "Please create a chart first!", "No chart        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.Charts[0].Axes.Count == 0){    MessageBox.Show(this, "Please create the Axis first!", "No axis        connected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.Charts[0].Axes[0].Channels.Count > 0)

Page 102: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View102 Version: 1.5

{    MessageBox.Show(this, "This sample contains only one channel!",        "Channel still connected!", MessageBoxButtons.OK, MessageBoxIcon.        Exclamation);}else{    ScopeViewControlArrayAxis axis = (ScopeViewCOntrolArrayAxis) scopeViewCon-trol1.Charts[0].Axes[0];

    if (axis is ScopeViewControlArrayAxis)    {        ScopeViewControlArrayAxis arrayAxis = (ScopeViewControlArrayAxis)axis;        ScopeViewControlChannel channel = ScopeViewControl1.Charts[0].Axes[0].NewChannel();        ChangeChannelSettings(channel);        SetAcquisition(channel);    }}}

5.1.5.3 Edit channel

The “Style” and the acquisition data can be edited for each channel.

For the appearance of the chart there is a “Style” property, in which the corresponding values are defined.This is where colors and line width can be assigned, for example. For the Array bar chart, it is also importantto set the series type “Bar”.private void ChangeChannelSettings(ScopeViewControlChannel channel){channel.Style.ColorValue = Color.Red.ToArgb();channel.Style.MarkColorValue = Color.DarkRed.ToArgb();channel.Style.LineWidth = 2;channel.Style.SeriesType = SeriesTypes.Bar;channel.Style.SolidLine = true;}

The acquisition data of a channel describe the connection between the Scope and the respective value ofthe machine control. During the acquisition the “SymbolName” is set. This is the hierarchical variable nameof the signal to be monitored. The signal determines the data type, which is entered in “DataType”. The“AmsNetId” and the “TargetPort” are the connection data leading to the TwinCAT project. Some additionalacquisition data have to be set for Array bar chart, for example the fact that it is an array (IsArray), the lengthof the array (ArrayLength) and the oversampling settings (ForceOversampling).private void SetAcquisition(ScopeViewControlChannel channel){channel.Acquisition.AmsNetIdString = AmsNetId.Local.ToString();channel.Acquisition.TargetPort = 851;channel.Acquisition.IsSymbolBased = true;channel.Acquisition.SymbolName = "Variables.AM";channel.Acquisition.DataType = DataTypeConverter.AdsToScope2Datatype(AdsDatatypeId.ADST_REAL64);channel.Acquisition.IsArray = true;channel.Acquisition.UseTaskSampletime = false;channel.Acquisition.SampleTime = (uint)(100 * TimeSpan.TicksPerMillisecond);channel.Acquisition.ArrayLength = 10;channel.Acquisition.ForceOversampling = false;}

5.1.5.4 Control recording

Use the Start and Stop buttons to start and stop the recording.private void button_Start_Click(object sender, EventArgs e){try{    // alte Daten verwerfen    if (scopeViewControl1.State == ScopeViewControlStates.REPLY)        scopeViewControl1.Operating.DisConnect(false);

    // Aufnahme starten    if (scopeViewControl1.State == ScopeViewControlStates.CONFIG)        scopeViewControl1.Operating.StartRecord();

Page 103: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 103Version: 1.5

    // alle Charts starten    if (scopeViewControl1.State == ScopeViewControlStates.CONNECTED)        scopeViewControl1.Operating.StartAllDisplays();}catch (Exception err){    MessageBox.Show(this, err.Message, "Error on start record!",         MessageBoxButtons.OK, MessageBoxIcon.Error);}}

private void button_Stop_Click(object sender, EventArgs e){try{    if (scopeViewControl1.State == ScopeViewControlStates.RECORD)        scopeViewControl1.Operating.StopRecord();}catch (Exception err){    MessageBox.Show(this, err.Message, "Error on stop record!",         MessageBoxButtons.OK, MessageBoxIcon.Error);}}

The properties of the “Operation” class are available in ScopeViewControl for starting or stopping therecording.

If a recording is currently displayed, it must be removed before a new recording. The recording is thenstarted. For display on the interface the display is then started.

To stop a recording, execute the method StopRecord. Press the Stop button.

5.1.5.5 Save configuration / recording

There are two save options, as indicated in the code below:

• Saving the recorded data in a .svd file• Creating a configuration file (.tcscope)

The difference is that the .svd file can be opened in any TwinCAT 3 Scope view, in order to display themeasured data. The .tcscope file, on the other hand, only contains the configuration, without measured data.It can be used to start new recordings, as required.private void button_Save_Click(object sender, EventArgs e){try{    // wenn Daten da sind speichern    if (scopeViewControl1.State == ScopeViewControlStates.REPLY)    {        File.Create("ExportData.svd").Close();        scopeViewControl1.Operating.SaveData("ExportData.svd");    }    // sonst nur die Konfiguration speichern    else    {        File.Create(filename).Close();        scopeViewControl1.SaveScopeConfig(filename);    }}catch (Exception err){    MessageBox.Show(this, err.Message, "Error on save!",         MessageBoxButtons.OK, MessageBoxIcon.Error);}}

5.1.5.6 Control chart

The Run and Pause buttons can be used to pause and resume the graph during recording. Use the DeleteChart button to remove the chart from the display.

Page 104: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View104 Version: 1.5

private void button_Run_Click(object sender, EventArgs e){if (scopeViewControl1.State != ScopeViewControlStates.RECORD){    MessageBox.Show(this, "Only possible if a record is running!", "Run         not possible!", MessageBoxButtons.OK, MessageBoxIcon.        Exclamation);}if (scopeViewControl1.State == ScopeViewControlStates.RECORD)    scopeViewControl1.Charts[0].ChartOperating.StartDisplay();}

private void button_Pause_Click(object sender, EventArgs e){if (scopeViewControl1.State != ScopeViewControlStates.RECORD){    MessageBox.Show(this, "Only possible if a record is running!",         "Pause not possible!", MessageBoxButtons.OK, MessageBoxIcon.        Exclamation);}if (scopeViewControl1.State == ScopeViewControlStates.RECORD){    scopeViewControl1.Charts[0].ChartOperating.StopDisplay();}}

Since the functions Run and Pause can only be used in recording mode, an initial query is required toascertain whether signals are currently being recorded.

The StopDisplay method can then be used to stop the display via the Pause button. The Run button and theStartDisplay method associated with it can be used to resume the chart. When the display is stopped, therecording continues in the background. This is apparent if the Overview chart is active, for example.private void btn_DelChart_Click(object sender, EventArgs e){if (scopeViewControl1.Charts.Count == 0){    MessageBox.Show(this, "No chart is connected!", "Nothing to delete!",         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}else if (scopeViewControl1.State == ScopeViewControlStates.RECORD){    scopeViewControl1.Operating.StopRecord();    scopeViewControl1.Operating.DisConnect(false);}else if (scopeViewControl1.State == ScopeViewControlStates.REPLY){    scopeViewControl1.Operating.DisConnect(false);}else{    scopeViewControl1.DeleteChart(scopeViewControl1.Charts        [scopeViewControl1.Charts.Count - 1]);}}

When the Delete Chart button is pressed, the system first checks whether a chart is open. It then checkswhether recording is active. If this is the case, the current recording is stopped. The DisConnect method canbe used to remove the chart from the display. The method DeleteChart can be used to delete a chart fromScopeViewControl.

5.1.5.7 Show minimum / maximum

In the Array bar chart example shown above, lines for minimum and maximum can be seen. The display ofthese lines can be toggled with the buttons Show Min / Hide Min and Show Max / Hide Max. This is doneusing the following methods.private void toggle_ShowMin_CheckedChanged(object sender, EventArgs e){if(toggleShowMin.Checked){    toggleShowMin.ImageIndex = 1;    toggleShowMin.Text = "Hide Min";    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.ShowMin = true;

Page 105: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 105Version: 1.5

}else{    toggleShowMin.ImageIndex = 2;    toggleShowMin.Text = "Show Min";    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.ShowMin = false;}}

private void toggle_ShowMax_CheckedChanged(object sender, EventArgs e){if(toggleShowMax.Checked){    toggleShowMax.ImageIndex = 1;    toggleShowMax.Text = "Hide Max";    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.ShowMax = true;}else{    toggleShowMax.ImageIndex = 2;    toggleShowMax.Text = "Show Max";    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.ShowMax = false;}}

The properties “ShowMin” and “ShowMax” can be found in the channel style, where they can be switched onor off with “true” or “false”. The properties “ImageIndex” and “Text” can be used to adjust the appearance ofthe buttons.

5.1.5.8 Scaling the X-axis

In this example the user can scale the X-axis via the user interface, so that a different value range isdisplayed. The two text boxes next to the labels “X Scale” and “X Offset” can be used for this purpose. For“X-Scale”, a factor can be entered with which the standard value range, which ranges from 0 to 10, ismultiplied. If the user enters 5, for example, the resulting range is 0 to 50. X-offset can be used to shift therange. X offset represents the initial value of the range. If -5 is entered, for example, the resulting range is -5to 5. These two values can therefore be used to set any scaling that may be required.private void txtboxXScale_TextChanged(object sender, EventArgs e){double result;if (Double.TryParse(txtboxXScale.Text, out result)){    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.XScaleFactor = result;}else if (Double.TryParse(txtboxXScale.Text, out result) == false && txtboxXScale.Text.Equals("")){    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.XScaleFactor = 1;    if(Double.TryParse(txtboxXScale.Text, out result))    {        scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.XScaleFactor = result;    }}else{    MessageBox.Show(this, "Please enter a number.", "Invalid entry! ", MessageBoxButtons.OK, Mes-sageBoxIcon.Exclamation);}}

private void txtboxXOffset_TextChanged(object sender, EventArgs e){double result;if (Double.TryParse(txtboxXOffset.Text, out result)){    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.XOffset = result;}else if (Double.TryParse(txtboxXOffset.Text, out result) == false && txtboxXOffset.Text.Equals("")){    scopeViewControl1.Charts[0].Axes[0].Channels[0].Style.XOffset = 0;}else{    MessageBox.Show(this, "Please enter a number.", "Invalid entry! ", MessageBoxButtons.OK, Mes-

Page 106: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View106 Version: 1.5

sageBoxIcon.Exclamation);}}

This functionality is implemented using the TextChanged events for the two text boxes. If the user makes anentry, the input string is checked for input errors, converted to a double value, and assigned to“XScaleFactor” or “XOffset”. If the input is invalid, for example, if characters have been entered, an errormessage is issued and the user is prompted to make a new entry.

5.2 Integration in a WPF (Windows PresentationFoundation) project

In order to use the ScopeViewControl within WPF applications as well, you require a WindowsFormsHost asa the basis, since the ScopeViewControl is a Windows Forms UserControl.

1. Position a WindowsFormsHost control from the toolbar in the user interface of the WPF application youcreated.

2. Initialize the ScopeViewControl as described in the Windows Forms examples, and add the createdScopeViewControl to the WindowsFormsHost. When using the ScopeViewControl within the WPFapplication, only the “ScopeViewControl.Operating.SupportWpfRefresh” property needs to be set.

A sample implementation is shown below:namespace WpfApplication{ ///  /// Interaction logic for MainWindow.xaml ///  public partial class MainWindow : Window {    public MainWindow()    {     InitializeComponent();     ScopeViewControl scopeViewControl = new ScopeViewControl();     scopeViewControl.Operating.SupportWpfRefresh = true;     // Initialisierung des ScopeViewControl     windowsFormsHost1.Child = scopeViewControl;    } }}

5.3 API DocumentationThe attached class library offers an extensive source of information for developers who work with thetechnologies and services of TwinCAT Scope. Amongst other things, the library contains instructions andreference documents as well as example codes.

Page 107: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

.NET API

TC3 Scope View 107Version: 1.5

In order to find the desired contents, navigate through the table of contents, use the search function or switchto one of the sections of the library with the aid of a quick link.

For example codes, switch in the left-hand area of the user interface to the Search tab and search for thekeyword “examples”.

In the search results you will find example codes for the trigger modules, cursor and many more.

See also:

Class library documentation

Page 108: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View108 Version: 1.5

6 Samples

6.1 TwinCAT 3 Scope View – first stepsIn order to allow a fast startup and to simplify work with the TwinCAT 3 Scope software oscilloscope, the firststeps are briefly described on this page. We have consciously avoided dealing with every detail. Forexample, trigger-controlled recordings and the creation of reports are not subjects of this documentation.

1. Installation:For basic understanding is important to know that a Scope Server is always installed with a Scope View,since otherwise no saved data can be displayed locally in the View. In contrast, the Scope componentinstallation can install the Scope server without Scope View on a target device.

2. Licensing:Regardless of whether the Scope View was installed through its own setup or via the TwinCAT 3 XAE, the“Base” license is initially activated for Scope View and the server. The license keys for enabling the fullfunctionality can be found in the Overview [} 7].

3. New project:In the Windows Start menu, Scope View can be selected under Beckhoff.

The Visual Studio opens in its shell or in a full version if installed. You can choose between varioustemplates.

Page 109: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View 109Version: 1.5

In the Solution Explorer the starting point for the new Scope configuration assembles itself automatically.

4. Selection of channels:Variables or channels have be added to the configuration that was generated. They can be selected via theTarget Browser. On first use, this may not be visible directly as a view in Visual Studio. The target browsercan be selected in the context menu with a right-click on the Scope-node.

Page 110: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View110 Version: 1.5

Alternatively the target browser can also be selected via the Scope menu in Visual Studio. The TargetBrowser can be docked at any point in the interface. It is possible to select the desired variables by browsinginto the respective target system.

The variables can be selected via Multiselect and added to the configuration via the context menu commandAdd Symbol or via drag-and-drop.

Page 111: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View 111Version: 1.5

The selected channels are assigned to the last-selected axis. In this case only one axis is present.

5. Before the recording:Before a recording, the basic settings must be implemented in the Scope properties. Standard is a ten-minute recording which is started manually and automatically stopped after the respective time. The settingsfor all hierarchy levels (Scope, Chart, Axis and Channel) and for Trigger and Cursor can be implemented inthe standard Properties view. The corresponding element must be selected in the Solution Explorer. If theProperties window is not yet open, it can be opened via the View menu.

Page 112: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View112 Version: 1.5

If the default settings are not changed, the recording can be started. When the system is used for the firsttime, the TwinCAT Measurement toolbar must be enabled under View > Toolbars.

Click on the icon with the red recording symbol to start the recording.

Page 113: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View 113Version: 1.5

6. During the recording:In order to improve the display of the channels in the View, charts and axes can be added even during therecording in TwinCAT 3 Scope View and channels can be shifted within the Scope.

X and Y cursors can also be added and deleted at runtime.

Page 114: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View114 Version: 1.5

An important feature is the option to pause the display of the current recording while data logging continuesin the background. When the display is stopped, one can zoom into the data and use the cursors to analyzethe signal profile.

7. Stopping the recording and saving the data:In this case the started recording is stopped automatically on expiry of the recording time of ten minutes.Alternatively, the recording can be stopped manually at any time via the Stop button in the Scope toolbar.The recorded data are not consistent until they were saved as a .svd file via the command Save Data in theScope menu.

Page 115: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Samples

TC3 Scope View 115Version: 1.5

Page 116: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View116 Version: 1.5

7 Appendix

7.1 FAQ - frequently asked questions and answersIn this section frequently asked questions are answered in order to make your work with TwinCAT 3 Scopeeasier. If you have further questions, please contact our support (-157)

1. Is it true that "TC3 Scope" in the TwinCAT 3 world is not a product, but a generic term for variousproducts? [} 116]

2. Why are there different product levels for the TC3 Scope? [} 116]3. Can the Scope View Professional be operated with the Scope Server Base? What are the restrictions?

[} 116]4. What do you need a TF3300 Scope Server for, when you can also switch on the “Use local server” op-

tion? [} 116]5. Can the TwinCAT Scope View be integrated into its own visualization? [} 116]6. Is it possible to print out recorded Scope Charts? [} 116]7. Is multimedia documentation available for TwinCAT 3 Scope? [} 116]8. My Scope .svd files are on a network drive. Why can't I open them? [} 117]

?Is it true that "TC3 Scope" in the TwinCAT 3 world is not a product, but a generic term for variousproducts?! Yes, “TC3 Scope” is a generic term. The TC3 Scope is subdivided into the Scope View and Scope Serverproducts. This means that a TC3 Scope always consists of the View and Server products. Beyond that thereare also different product levels.

?Why are there different product levels for the TC3 Scope?!The Scope is a constantly growing tool for data logging and analysis; however, not every Scope userrequires the full range of functions for his purposes. Therefore we offer product levels tailored as far aspossible to the application. The currently available product levels are Base and Professional. Base is free oflicense costs and is an outstanding tool for machine commissioning. Professional is very well suited forprocess monitoring in addition to machine commissioning.

? Can the Scope View Professional be operated with the Scope Server Base? What are therestrictions?! Yes, Professional View can also be operated with the Base Server. Only the limitations of the Base Serverversion need to be observed. It is also possible, for example, to scope a remote device with the local BaseServer. To do this the Use local server option must be set in the channel settings.

? What do you need a TF3300 Scope Server for, when you can also switch on the “Use local server”option?! The TwinCAT TF3300 Scope Server function is required as soon as a Scope Server has to runautonomously on a remote device. The server can thus be controlled, for example from the PLC, without aView being connected.

? Can the TwinCAT Scope View be integrated into its own visualization?! Yes, you can integrate Scope Control into your own .NET-based visualization application. The licensemodel remains identical.

? Is it possible to print out recorded Scope Charts?! The currently displayed chart can be printed out by inserting a report in a Scope project. Beyond that, fringedata shown by the cursor, such as channel name, axis name or values, are displayed and added to theprintout.

? Is multimedia documentation available for TwinCAT 3 Scope?! Yes, there is a recording of a TwinCAT 3 Scope Webinar on the Beckhoff-Homepage.

Page 117: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View 117Version: 1.5

? My Scope .svd files are on a network drive. Why can't I open them?! That is probably because the TwinCAT 3 Scope server service has no rights of access to the networkdirectory. In order to be able to open .svd files, you either need to copy them to the local system or grant theScope server service the appropriate rights. (See section Opening .svd files from a network directory [} 120])

7.2 How To's

7.2.1 Oversampling recordings with the TwinCAT 3 ScopeWith the TwinCAT 3 Scope it is possible to represent oversampling values in a single variable. Since nvalues (n = oversampling factor) are recorded for each cycle when oversampling, theTwinCAT System Manager generates an ADS symbol containing a time stamp for each individual value. If aconnection is made between the ADS symbol and the Scope, the Scope will accept all other settings todisplay the n values in the correct sequence.

So that the ADS symbol is created and can be directly scoped by an EtherCAT terminal (e.g. EL3702 orEL3632), some settings need to be made in the TwinCAT System Manager configuration:

In the EtherCAT process image the ADS tab of the ADS servers must be enabled, and the option Createsymbols must be switched on. The assigned ADS port has to be specified later in the Scope in order to findthe ADS symbols.

The desired oversampling factor should be set in the TwinCAT System Manager for the respectiveoversampling terminal before the configuration is activated.

Page 118: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View118 Version: 1.5

If the configuration was loaded successfully and TwinCAT is in Run mode, the TwinCAT 3 Scope can becalled. The server settings must be defined in the Target Browser of the Scope. The ADS port numberassigned by the TwinCAT System Manager must be entered in the corresponding dialog and added with theAdd, provided the port has not already been entered.

Page 119: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View 119Version: 1.5

AdsPort of Image X (27905) appears in the Scope Target Browser. With this new entry, it is possible tobrowse the EtherCAT Terminals including the desired oversampling terminal. In the oversampling terminal,the variable shown in red with the supplement [T20] should be selected for the Scope recording. In this case20 stands for 20 times oversampling. This number may vary according to the oversampling factor.

Page 120: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View120 Version: 1.5

The INT16 variable can be recorded directly in TwinCAT Scope. In the following screenshot 20-foldoversampling with a cycle time of 1 ms.

7.2.2 Opening .svd files from a network directoryIf a .svd file from the network is to be merged into the solution, the following error message will probablyappear if appropriate preparations are not made.

An unknown Error occured. Error handling .svd file within scope server. Enable and check scope servertracing.

One of the following entries usually appears in the Server Tracing log:

• "ScopeServerTraceSource",Error,8442,"Access to the path '\\remote-PC\SVDs\test.svd' isdenied.",,368,,"16","2014-04-28T07:26:59.9720667Z",,

or

• "ScopeServerTraceSource",Error,8442," Could not find file '\\remote-PC\SVDs\test.svd'.",,3376,,"16","2014-04-28T07:26:59.9720667Z",,

Both errors indicate that the TwinCAT Scope server service has no rights of access to the network directory.

Proceed as follows to assign the required rights to the TwinCAT Scope server (example for Windows 7):1. Right-click on the directory to be enabled, in order to open the context menu. Select the command

Properties, and in the dialog that opens select the command Share in the Sharing tab.

Page 121: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View 121Version: 1.5

ð The dialog File Sharing opens,2. Enter the users who are to gain access to the directory. Permission level “Read” is sufficient for Scope

server access and for displaying the .svd file.

3. Press [Windows] + [R] and enter “services.msc”. In the TwinCAT3 Scope Server Properties dialogselect the Log On tab.

Page 122: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View122 Version: 1.5

4. Enter the account with which you have rights of access to the network directory.

Pay attention to the correct use of your server domain.5. After confirming, restart the service in order to accept the new user data.ð Subsequently, .svd files from the configured network directory can be opened in the measurement

project on this system.

7.3 Support and ServiceBeckhoff and their partners around the world offer comprehensive support and service, making available fastand competent assistance with all questions related to Beckhoff products and system solutions.

Beckhoff's branch offices and representatives

Please contact your Beckhoff branch office or representative for local support and service on Beckhoffproducts!

The addresses of Beckhoff's branch offices and representatives round the world can be found on her internetpages:http://www.beckhoff.com

You will also find further documentation for Beckhoff components there.

Beckhoff Headquarters

Beckhoff Automation GmbH & Co. KG

Huelshorstweg 2033415 VerlGermany

Page 123: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Appendix

TC3 Scope View 123Version: 1.5

Phone: +49(0)5246/963-0Fax: +49(0)5246/963-198e-mail: [email protected]

Beckhoff Support

Support offers you comprehensive technical assistance, helping you not only with the application ofindividual Beckhoff products, but also with other, wide-ranging services:

• support• design, programming and commissioning of complex automation systems• and extensive training program for Beckhoff system components

Hotline: +49(0)5246/963-157Fax: +49(0)5246/963-9157e-mail: [email protected]

Beckhoff Service

The Beckhoff Service Center supports you in all matters of after-sales service:

• on-site service• repair service• spare parts service• hotline service

Hotline: +49(0)5246/963-460Fax: +49(0)5246/963-479e-mail: [email protected]

Page 124: Manual TwinCAT 3 Scope View ... The TwinCAT Scope View ...

Glossary

TC3 Scope View124 Version: 1.5

GlossaryArray Bar Chart

The chart provides the drawing interface for anarray data type, the elements of which are as-signed to a bar line or a bar.

AxisA (Y-) axis represents the value scaling forconnected channels.

ChannelThe channel forms the connection of systemvariable and graph. Therefore, there is one set-ting window for the acquisition and another onefor the general settings (colors, marks etc.).

CursorThe cursor module serves to display graph andaxis values and their differences.

Data PickerMouse pointer tool that is automatically acti-vated in the chart when the cursor moves overa data point. Clicking brings up a tool tip show-ing the values of the X- and Y-axes, the chan-nel name and the absolute time for the se-lected data point.

MarksMarks are the actual data points of recordedvariables. They can be adjusted via the chan-nel properties.

Measurement projectThe Measurement project may contain severalScope projects, in which the actual recordingconfigurations are created.

Overview ChartAn Overview chart can be displayed within aYT chart. It provides an overview of the wholerecording period with absolute times.

Quick View ChartThe Quick View chart is available in the TargetBrowser. It quickly and clearly indicateswhether values are currently supplied.

ScopeThe Scope forms the highest hierarchical ele-ment in a Scope configuration and manages allrecording settings.

Scope ServerThe Scope Server is the logger program of theTwinCAT Scope. A Scope connects itself to aserver in order to record new data or to read anexisting file (.svd).

Scope ViewThe Scope View is the front end of the Twin-CAT Scope. From here configurations are cre-ated or loaded, the display adjusted andrecordings controlled.

Solution ExplorerThe Solution Explorer is a kind of project man-ager, which can also be used for the measure-ment projects that are required for a Scoperecording.

Target BrowserAll connected systems and their devices canbe simply scanned for system variables withthe target browser.

TriggerVarious actions can be triggered with freelyconfigurable trigger groups.

XY ChartThe chart provides a drawing area for a chan-nel that is calculated from two variables. Onevariable is shown on the X-axis, the other oneon the Y-axis.

YT ChartThe chart provides a graphic area with timeaxis. All connected channels are scaled to thesame time segment.