Sie sind auf Seite 1von 118

Manual

TwinCAT 3 Scope View

TwinCAT 3

Version:
Date:
Order No.:

1.2
2016-03-30
TE13xx

Table of Contents

Table of Contents
1 Foreword ....................................................................................................................................................4
1.1

Notes on the documentation............................................................................................................. 4

1.2

Safety instructions ............................................................................................................................ 5

2 Overview.....................................................................................................................................................6
2.1

Product description ........................................................................................................................... 6

3 Installation..................................................................................................................................................9
3.1

System requirements........................................................................................................................ 9

3.2

Downloading the setup file................................................................................................................ 9

3.3

Installation......................................................................................................................................... 9

3.4

After the Installation ........................................................................................................................ 12

3.5

Licensing......................................................................................................................................... 13

4 Configuration ...........................................................................................................................................18
4.1

Scope View..................................................................................................................................... 18
4.1.1 Scope View - Architecture...................................................................................................18
4.1.2 Scope View - Scope Menu..................................................................................................23
4.1.3 Scope View - Toolbar..........................................................................................................25
4.1.4 Scope View Scope Properties ............................................................................................27
4.1.5 Scope View YT Graph ........................................................................................................29
4.1.6 Scope View XY Graph ........................................................................................................37
4.1.7 Scope View Bar Graph .......................................................................................................47
4.1.8 Recording............................................................................................................................54
4.1.9 Cursor .................................................................................................................................57
4.1.10 Trigger.................................................................................................................................61
4.1.11 Saving and exporting data ..................................................................................................65
4.1.12 Reporting ............................................................................................................................69
4.1.13 Scope Options ....................................................................................................................76

5 .NET API ...................................................................................................................................................79


5.1

Integration of the ScopeViewControl .............................................................................................. 79


5.1.1 Sample YT Chart ................................................................................................................80
5.1.2 Sample XY Chart ................................................................................................................84
5.1.3 Sample YT Cursor ..............................................................................................................90
5.1.4 Sample Scope Export .........................................................................................................97

5.2

Integration in a WPF (Windows Presentation Foundation) project ................................................. 99

5.3

API Documentation......................................................................................................................... 99

6 Samples..................................................................................................................................................101
6.1

TwinCAT 3 Scope View first steps............................................................................................. 101

7 Appendix ................................................................................................................................................110
7.1

FAQ - frequently asked questions and answers ........................................................................... 110

7.2

TwinCAT Scope Glossary............................................................................................................. 112

7.3

How To's ....................................................................................................................................... 113


7.3.1 Oversampling recordings with the TwinCAT 3 Scope.......................................................113
7.3.2 Opening .svd files from a network directory......................................................................116

TwinCAT 3 Scope View

Version: 1.2

Foreword

Foreword

1.1

Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who
are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning
these components.
The responsible staff must ensure that the application or use of the products described satisfy all the
requirements 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 under
development.
For that reason the documentation is not in every case checked for consistency with performance data,
standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time
and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the
data, diagrams and descriptions in this documentation.

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

Patent Pending
The EtherCAT Technology is covered, including but not limited to the following patent applications and
patents:
EP1590927, EP1789857, DE102004044764, DE102007017835
with corresponding applications or registrations in various other countries.
The TwinCAT Technology is covered, including but not limited to the following patent applications and
patents:
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 to
others 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 a
patent, utility model or design.

Version: 1.2

TwinCAT 3 Scope View

Foreword

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 the
application. Modifications to hardware or software configurations other than those described in the
documentation 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 are
familiar with the applicable national standards.

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

Serious risk of injury!


Failure to follow the safety instructions associated with this symbol directly endangers the
life and health of persons.
DANGER

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

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

Damage to the environment or devices


Failure to follow the instructions associated with this symbol can lead to damage to the environment or equipment.
Attention

Tip or pointer
This symbol indicates information that contributes to better understanding.
Note

TwinCAT 3 Scope View

Version: 1.2

Overview

Overview

2.1

Product description

TwinCAT 3 Scope is the charting and analysis tool for TwinCAT. Variables in TwinCAT can be recorded and
displayed graphically. Sampling rates can be adjusted individually for each channel. Recordings in the s
range and long-term recordings over several days are equally possible. Due to division into a Scope View
with multi-core support for the display of the signals and a Scope Server for the recording of the values, it is
possible it to connect to servers distributed in the field from a central View. A tool is thus available not only
for machine commissioning, but also for process monitoring. The TC3 Scope functionality includes a cursor
tool and trigger functions.
The TC3 Scope also sets new standards in the field of engineering. Like TwinCAT 3 itself, it is integrated in
Microsoft Visual Studio. It is thus possible to use TwinCAT 3 projects and Scope projects in parallel in a
single solution. Variables can be shifted very simply from the TwinCAT 3 project to a Scope configuration. Of
course 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 is
subdivided into product levels with different ranges of features. The TwinCAT 3 Scope Base contains a
license-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 the
configuration of recordings and the display of signal curves. The View is available in different product
levels and is licensed for the device on which it is displayed. This document contains the technical
product description.
TwinCAT 3 Scope Server is a TwinCAT 3 function and provides the software for data logging. The
server sends the recorded data to the View. The software is installed on distributed devices or on the
local target device. The server license is issued for the device on which the server runs. In most cases
the Base version, which is installed together with TwinCAT XAE or the Scope View, is sufficient. The
server license is only required if it is used independently, i.e. without View, e.g. for control via a PLC
function block. The TwinCAT 3 Scope Server is documented separately as part of the TC3 functions.
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. The
local 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 the
signal curves and is used for the configuration of recordings.
Product level / feature list
This table shows which functions are available with which TwinCAT Scope level with the corresponding
licensing.

Version: 1.2

TwinCAT 3 Scope View

Overview
Features

Scope Base
Server

General:
Free of
charge
Local
record
Remote
Record
using
Target
Server
Remote
Record
using
Local
Server
Scope
Control
Integration
Long Time
Records >
1h
Applicatio
n Settings
(TC 3.0)
Ring
Buffer
Auto Save
Restart
Record
View
Multicore
Support

Base:
Create
Configurati
on
Target
Browser
Filter
Individual
Sample
Rate
Drag and
Drop for
Configurati
on
Docking
Windows

View

Scope Server
Full License
Server
Full
7 days trial
version

TwinCAT 3 Scope View

Version: 1.2

Scope View Professional


View
Full
7 days trial
version

Overview
Features

Scope Base

YT Charts

Scope Server
Full License
-

YT
Overview
Chart
Stacked Yaxes
Time
Based
Charts
XY Charts

Array Bar
Charts
Logarithmi
c Y-axes
Channel
Marks
Channel
Offset
Channel
Scaling
Panning

Zoom

Cursor

Print
Report
Extended
data
export with
Export
Tool

Trigger:
Start
Record
Stop
Record
Stop
Display
Restart
Display
Start
Subsave
Stop
Subsave

Version: 1.2

Scope View Professional

TwinCAT 3 Scope View

Installation

Installation

3.1

System requirements

The 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
The .NET Framework 4.0 is required.
The TwinCAT 3 Scope Base is installed together with TwinCAT 3 XAE. The further product level and
features are activated per licensing. If you want to use a new Scope version without a TwinCAT 3 XAE
Update or install the Scope standalone on a PC without TwinCAT 3 Engineering, you can download this
setup in the internet.
The Scope View can be licensed as full version and as a 7-day-trial-version. Limitations of the 7-day-trialversion you can see on the product overview.

3.2

Downloading the setup file

Like many other TwinCAT 3 engineering tools, the TwinCAT Scope View is available for download on the
Beckhoff website. It is always the most current version of the product, which can be licensed for each
product level. Please perform the following steps to download the setup file:
1. Start a web browser of your choice and go to the Beckhoff website at www.beckhoff.de
2. Navigate in the tree to the nodes Automation/TwinCAT3/TE1xxx | TC3 Engineering/TE13xx | TC3
Scope View
3. There you can choose between Download Full and Download Update. If you select Full, the setup also
brings along the Microsoft Visual Studio Shell, in which the TwinCAT Scope View integrates itself. If the
shell or another full version of Microsoft Visual Studio is already installed on the target system, the
Update setup is sufficient.
4. Click on the Download link in order to place the software in the shopping cart. Then click on Start
download
(Optional) Transfer the downloaded file to the TwinCAT runtime system on which you wish to install the
product

3.3

Installation

Description 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" by
right-clicking the setup file and selecting the corresponding option in the context menu.

TwinCAT 3 Scope View

Version: 1.2

Installation
2. Click on "Next" and accept the license Agreement.

3. Enter your user information in the specified area.

10

Version: 1.2

TwinCAT 3 Scope View

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

5. Click on "Install"after pressing the "Next" to start the Installation.

The TwinCAT system has to be stopped before proceeding with installation

TwinCAT 3 Scope View

Version: 1.2

11

Installation
6. Confirm the Dialog with "Yes".

7. Select "Finish" to end the installation process.

The installation is complete now.


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

3.4

After the Installation

The next step after a successful installation is the licensing of the products "TE130x Scope View" and/or
"TF3300 Scope Server". By default the Base product level is active and is available without a licence. The
extended range of functions can be enabled by appropriate licensing, e.g. up to the Professional product
level. Further possible steps are then:
First steps with TwinCAT 3 Scope [}101]
Detailed documentation of the individual functions [}18]
The integration of TwinCAT 3 Scope View Control into your own .NET-based visualisation [}79]

12

Version: 1.2

TwinCAT 3 Scope View

Installation

3.5

Licensing

The TwinCAT 3 functions are available both as a full and as a 7-Day trial version. Both license types can be
activated via TwinCAT XAE.For more information about TwinCAT 3 licensing, please consult the TwinCAT 3
Help System.The following document describes both licensing scenarios for a TwinCAT 3 function on
TwinCAT 3 and is divided into the following sections:
Licensing a 7-Day trial version [}13]
Licensing a full version [}14]

Licensing a 7-Day trial version


1. Start TwinCAT XAE
2. Open an existing TwinCAT 3 project or create a new project
3. 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 screenshot
TE1300: 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 remote
device via TwinCAT XAE toolbar

TwinCAT 3 Scope View

Version: 1.2

13

Installation
6. Switch to the tab "Order Information" and click the button "Activate 7 Days Trial License..."to
activate a test version

7. Please restart TwinCAT 3 afterwards.

Licensing a full version


8. Start TwinCAT XAE
9. 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 screenshot "
TE1300: TC3 Scope View Professional).

14

Version: 1.2

TwinCAT 3 Scope View

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

13. Navigate to the "Order Information" tab


The fields "System-ID" and "HW Platform" cannot be changed and just describe the platform for the
licensing 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
of your "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 the
Beckhoff Activation Server

17. After clicking "Yes", the standard E-Mail client opens and creates a new E-Mail message to
"tclicense@beckhoff.com" which contains the "License Request File"
18. Send this Activation Request to Beckhoff
NOTE!The License Response File will be sent to the same E-Mail address used for sending
out the License Request File

TwinCAT 3 Scope View

Version: 1.2

15

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

20. Select the received "Licnse response file" and click on "Open"

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

16

Version: 1.2

TwinCAT 3 Scope View

Installation
22. Please restart TwinCAT to activate licenses..

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


local device.

TwinCAT 3 Scope View

Version: 1.2

17

Configuration

Configuration

4.1

Scope View

4.1.1

Scope View - Architecture

Not only are signal curves represented in the TwinCAT Scope View; recording configurations are also
created. For the creation of these configurations it is important to be familiar with the architecture of the
Scope View. The architecture is reflected in the tree structure within the Measurement Project in the Solution
Explorer.
The Scope architecture:

18

Version: 1.2

TwinCAT 3 Scope View

Configuration

Measurement Scope Project:


Main level, at which several Scopes can be added. The Scopes within a project can be controlled
independently of one another.
Standard Scope Project:
A Scope always stands for a recording configuration. This means that all elements inserted below it are
subject to the same recording settings. If a Scope is selected, the setting options such as recording time and
ring buffer are displayed in the Visual Studio Property window.
See also: Scope properties [}27]
YT Chart:
Several YT charts can exist in parallel in a Scope. They are the actual display area in the view and provide
the timebase. Each chart has its own toolbar for changing the display. The color and axis settings can be
made in the Property window. Clicking on the signal curve in the chart highlights the respective channel in
the Solution Explorer.
See also: YT chart properties [}29]
Axis:
An (YT or XY) chart can feature several axes. An axis provides the range of values for the connected
channels. Amongst others, the automatic or free scaling can be set in the Property window.
See also: Axis properties [}32]
Channel:
A channel represents the style characteristics of a selected variable. In the Property window the color,
marks and other parameters can be set. Double-clicking on the channel highlights the respective signal in
the 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 Cursor
Tool window shows the current values of the signal/cursor interface and the differences compared with other
cursors. Any desired number of X and Y cursors can be set.
See also: Cursor properties [}57]
XY Chart:
Several XY charts can exist in parallel in a Scope. They represent the actual display area in the view. Each
chart has its own toolbar for changing the display. The color and scaling settings can be made in the
Property window. Clicking on the signal curve in the chart highlights the respective channel in the Solution
Explorer.
See also: XY chart properties [}38]
Array Bar Chart:
An array bar chart can connect to an array in the controller and display each array element as a bar. Several
array bar charts can exist in parallel in a Scope. The settings for the chart can be entered in the Property
window.
Trigger:
Triggers are assigned to the Scopes in the tree structure of the Scope View. The trigger action, e.g. Stop
Record, can be set in the Property window of the trigger group. The underlying triggers can be logically
linked to a trigger condition. The variable selection also takes place here in the Property window.
See also: Trigger properties [}61]

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.

TwinCAT 3 Scope View

Version: 1.2

19

Configuration

Overview of the individual windows:


Solution Explorer
Cursor [}57]
Error List

Target Browser [}54]


Properties

Scope View Control

20

Display of the project structure within a solution.


Display of the values present at the X/Y-cursor.
List of errors, warnings and messages. Each scope
project lists the generated messages independently
here. The messages for the respectively selected
Scope can be deleted via the context menu item
"Clear Error List".
With the target browser you can be add Scope
configuration channels via their symbol names.
Under Properties, the settings for the respective
element selected in the Solution Explorer can be
modified.
Display of the individual charts. The charts can be
displayed next to each other or in overlapping tabs
within the control, exactly like all other windows.

Version: 1.2

TwinCAT 3 Scope View

Configuration

Configuration
The options for creating or editing a Scope configuration are explained below. The way in which the
properties of the respective elements can be changed is described in the description of the associated
window.

To create a Measurement Project:


File -> New -> Project -> TwinCAT Measurement -> Selection of the desired template.

List of the available templates:


Empty Measurement Project

Scope YT Project
Scope YT Project with Reporting
Scope YT NC Project

Scope XY Project
Scope XY Project with Reporting
Scope Array Bar Project

Empty Measurement Project. Scope configurations


(.sv2 can | .tcscope) or scope data (.svd) can
subsequently be inserted here.
Contains a Scope instance and a preconfigured YT
chart with a corresponding axis.
See "Scope YT Project" for a ready-made printing
template for printing charts.
Contains a Scope instance, which was specially
preconfigured for working with drive axes. The
template can easily be extended to the number of
actually configured drive axes.
Contains a Scope instance and a preconfigured XY
chart with a corresponding axis.
See Scope XY Project for a ready-made printing
template for printing charts.
Contains a Scope instance and a preconfigured array
bar chart with a corresponding axis.

Addition of a Scope/report to a Measurement Project:


Context menu of the Measurement Project -> Add -> New Item -> selection of the desired template.

TwinCAT 3 Scope View

Version: 1.2

21

Configuration

List of the available templates:


Scope Project

Scope instance with a pre-configured chart and an


axis.
Scope instance that has been specially preconfigured for working with axes.
Printing template for printing charts.

Scope NC Project
Standard Report

Context menu of the measurement project -> Add -> Existing Item -> select the desired file (.tcscope
| .sv2 | .svd |.rdlc)
Drag & drop the desired file (.tcscope | .sv2 | .svd |.rdlc) on to the Measurement Project in the Solution
Explorer.
Table1: Addition of individual elements:
New Chart

Context menu of the Scope instance


-> New YT Chart
-> New XY Chart
Context menu of the Scope / Chart instance -> New
Axis
Context menu of the Scope / Chart / Axis instance ->
New Empty Channel
Drag & drop symbol data from the target browser to
an existing Scope / Chart / Axis instance.
PLC editor -> context menu of variables -> Add to
Scope

New axis
New channel

Deletion of elements
Select the element in the Solution Explorer - > <Del> key.
Context menu of the element -> Delete

Moving / copying individual elements:


Every element can be moved in the Solution Explorer with drag & drop. In doing so it must always be
added to an element that is one level higher in the hierarchy. If an element is moved to another Scope,
then it is only 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 the <Ctrl> key is pressed and held during the drag & drop, the selected element is always copied
instead of being moved.
22

Version: 1.2

TwinCAT 3 Scope View

Configuration

Saving a Scope configuration:


File -> Save (shortcut assigned by default: Ctrl + S)

Loading a Scope configuration:


File -> Open -> Project/Solution - > select the Solution / Measurement Project via the file selection
dialog.
All Scope files (.tcscope | .sv2 | .svd) can be opened directly by a double click. However, since a
Measurement Project is lacking as the basis, a selection dialog appears in which a new project is
created. Subsequently the newly created project is added to the Scope, which is called by a double
click (a copy of the file is placed in the new project directory). The "Empty Measurement Project"
template lends itself to this.
Measurement Project files (.tcmproj) as well as Solutions (.sln) can opened directly by a double click.

Sending projects by email:


Context menu of the Scope instance to be sent - > Send Project By Email
If the Scope is to contain data (Scope State: Reply), then you can select whether the data
should also be sent.

Deactivating / activating a channel


A channel can be deactivated in the configuration in order to prevent it being recorded. However, it is
retained when saving the configuration.
Select the channel in the Solution Explorer -> Properties -> Disabled -> true

4.1.2

Scope View - Scope Menu

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

TwinCAT 3 Scope View

Version: 1.2

23

Configuration

24

Version: 1.2

TwinCAT 3 Scope View

Configuration
Target Browser
Cursor Window
Send Project By E-Mail...

Clear Error List


Change Ads Symbol...

Change Index Group...

New YT Chart
New XY Chart
New Array Bar Chart
New Axis

New Empty Channel


Delete
Export to CSV
Export to Binary
Export to DAT
Export to TDMS
Extract Scope Configuration
Upload Configuration To Target
Save Data

Scope Messages

Local Scope Server...


Options...

4.1.3

Opens the target browser.


Opens the cursor window.
Context menu of the Scope instance to be sent - >
Send Project By Email
If the Scope is to contain data (Scope State: Reply),
then you can select whether the data should also be
sent.
Deletes all entries (Error | Warning | Message) of the
currently active Scope from the error list.
Dialog for the replacement of character strings. The
symbol names of all channels located below the
selected element are edited.
Dialog for incrementing / decrementing the Index
Group / Index Offset. The acquisitions of all channels
located below the selected element are edited.
Creates a new YT chart within the Scope.
Creates a new XY chart within the Scope.
Creates a new array bar chart within the Scope.
Creates a new axis within the chart. If the selected
element is not a chart, then a new chart is
additionally created.
Creates a new channel within the axis. If no axis is
selected, then a new axis is additionally created.
Deletes the element currently selected in the Solution
Explorer.
Export to a CSV or TXT file
Export to a binary file
Export to a DAT file
Export to a TDMS file
Extracts the Scope Configuration from the
selected .svd file.
Downloads the current configuration as a .tcscope file
to a user-selected target system.
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 added
directly to the Measurement Project or saved in a
directory of your choice via the directory selection
dialog.
Some frequently occurring message boxes in the
scope are equipped with a checkbox "Remember
my answer and don't ask again!" so that the
question is not repeated the next time. This makes
the handling of the program individually adjustable for
each user. If a message box has been deactivated, it
can be activated again here.
Opens the configuration interface of the Scope
Server.
Opens the Visual Studio Options window and selects
the Scope entry.

Scope View - Toolbar

The Scope recording is started and stopped with the toolbar.

TwinCAT 3 Scope View

Version: 1.2

25

Configuration
If the toolbar is not visible by default or has been closed, it can be reactivated under View -> Toolbars ->
TwinCAT Measurement.

The following elements are available by default in the toolbar:

26

Version: 1.2

TwinCAT 3 Scope View

Configuration
Start Record: All required servers are called and the recording settings and connected channels
are entered. If data are already present from a preceding session, then a query appears asking
whether the current data should be saved. Afterwards the recording is started in accordance with
the above settings. After the start it is no longer possible to change the Scope settings or acquisition
or to add or remove channels.
Stop Record: The recording is stopped. However, the recorded data remain on the connected
servers and can be viewed.
After stopping the recording it is possible to change the Scope configuration. The current data will
then be lost, however, if they are not saved.
The toolbar can be extended as desired via the context menu (can be displayed on the right-hand side of the
toolbar) -> Add or Remove Buttons -> Customize .

The commands belonging to the Scope can subsequently be found under Add Command -> Categories:
Scope

4.1.4

Scope View Scope Properties

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

TwinCAT 3 Scope View

Version: 1.2

27

Configuration

Auto Save
Auto Save Path: here you can choose the path for the recorded data to be saved.
Filename Mask: here you can edit the filename of the recorded data. For instance you can create
increasing time stamps.
Use Auto Save: turns on the automatic saving of a stopped recording.

Common
Comment: A free comment can be stored here.
File Name: File name 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 therefore
only available for XY plots at present. The options Default and Extended are available for all chart
types.

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.

28

Version: 1.2

TwinCAT 3 Scope View

Configuration
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 by pressing 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 recording
equipment. The access time is faster, if only the RAM is used. For larger data quantities it is usually
necessary to activate the File Store option.
Record Time: Here you can specify the total recording time. It is entered in the format
Days:Hours:Minutes:Seconds.

Changes by group
To change the settings of several Scopes at once, please observe the section Multiple selection [}77].

4.1.5

Scope View YT Graph

The properties of the individual hierarchy levels of YT 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 at channel
level through an additional hierarchy level. Channel Style and Channel Acquisition are described separately
below.

4.1.5.1

YT chart properties

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

TwinCAT 3 Scope View

Version: 1.2

29

Configuration

Behavior
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 tooltip with the
exact values of the data point on the X- and Y-axis, plus the timestamp and name of the corresponding
channel.
Default Display Time: This time specifies the standard width of the associated chart. This value is set,
for example, when the rescale button is selected in the chart toolbar.
Inverse X-Axis: Switches the signal sequence from the default (left to right) to right to left.
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.
30

Version: 1.2

TwinCAT 3 Scope View

Configuration

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 the
performance.
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: The 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: The number of subdivisions.
X-Axis Color: The colour 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 autoscaling
after a zoom or panning action. This can be used to expand the selected area.
Stacked Y-axes: 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 whether
the 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 in
the data of a chart in the Y-direction as well. This includes both zooming and panning (shifting the
display with the mouse).

Changes by group
To change the settings of several charts at once, please observe the section Multiple selection [}77].
The chart display is operated with the toolbar. The overview shows all buttons and their explanation (from
left):

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". The zoom function works down to the s range. Alternatively, the display width can be
changed by turning 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 the
display width. The inner scroll keys move the display only by a tenth of the display width and can be
kept 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 as
separators. If not all units are edited the format is sorted in ascending order, starting with seconds.

TwinCAT 3 Scope View

Version: 1.2

31

Configuration
Undo/Redo Time/Position: This option can be used to undo step changes in the display width or the
current position, irrespective of how they were made (e.g. zoom, scroll, etc.). The right mouse button is
likewise 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 xaxis 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 by
clicking and dragging with the mouse.
Zoom Horizontal: A new time range for the display can be selected by stretching a rectangle over the
x-axis.
Zoom Free: You can zoom into the current display by stretching a rectangle over the graphic area.
Rescale All: 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 Chart: The Overview Chart option activates a chart display. The signal range currently
shown in the main chart is highlighted in the Overview Chart. The Overview Chart also offers an
absolute 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 the
mouse 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 time
defines the zero point of the recording.
End-Time: The largest common time of all connected channels. The end time thus marks the final
value of the recording. The difference between the end time and start time is maximally as large as the
defined record time (see Scope properties [}27]).
Position: The position time represents the zero point of the current chart, i.e. the time from the start
time to the beginning of the display.
Time : The absolute time at the origin of the chart.
Date: The absolute date at the origin of the chart.

4.1.5.2

YT axes properties

Settings can be made separately for each available YT axis here.

32

Version: 1.2

TwinCAT 3 Scope View

Configuration

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: The colour 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 if
the range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows the
decades 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 labelling.

TwinCAT 3 Scope View

Version: 1.2

33

Configuration

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 enter the number of significant digits for the axis labels. It corresponds to the
number of visible digits on the axis.
Scale Mode: There is a choice between two auto-scale modes. The default mode is AutoGrowOnly.
This means the y-axis always scales to the historic maximum, until a rescale is carried out for the
current view. Alternatively, AutoGrowNShrink can be selected. This mode always automatically adjusts
the maximum of the y-axis to the maximum in the current view (display width).

Axis Style
Color: The colour of the axis.
Line Width: The 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 and
can thus deviate from the settings.
Visible: Specifies whether the axis is shown or hidden in the chart.

Changes by group
To change the settings of several axes at once, please observe the section Multiple selection [}77].

4.1.5.3

YT channel style

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

34

Version: 1.2

TwinCAT 3 Scope View

Configuration

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. Other 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: The color of the graph.
Line Width: The line width of the graph. 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: The colour of the base markings.
TwinCAT 3 Scope View

Version: 1.2

35

Configuration
Marks: Selection of the visibility of markings -> On (permanently visible) | Auto (dependent on the
zoom level) | Off (markings switched off).
Mark Size: The size of the base markings.

Modify
Bit Mask: In the Bit Mask 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 of the 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 factor
of 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 to
compensate a known bus runtime, for example.

Changes by group
To change the settings of several channels at once, please observe the section Multiple selection [}77].

4.1.5.4

YT channel acquisition

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

36

Version: 1.2

TwinCAT 3 Scope View

Configuration

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.
Note
Example: The Array Length setting is only visible in the case of array symbols.

Acquisition
Array Length: Shows the number of array elements.
Data-Type: Indicates the data type of the selected variable.
Disabled: Here you can decide whether the configured channel should be recorded or not.
Force Oversampling: This option is only shown for arrays. If the option is set, the array is interpreted
as a variable and shows the values of the individual array elements contiguously. This corresponds to
the behavior of EtherCAT oversampling terminals. Comparisons: Oversampling recordings [}113].
Sample State: Here you can specify whether the data for the selected variables is to be sampled with
the TaskSampleTime or the FreeSampleTime.
Sample Time: If the sample state FreeSampleTime was selected, you can set the sampling rate
here. It is always greater than the TaskSampleTime.
Symbol based: If this option is set, the variables are communicated via the symbol name. If this option
is not set, the variables are communicated via the Group and Offset indices, and the input fields for
Group 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.
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 phase differences of different target systems. The phase
differences 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 used
for the recording. If the option is not set, a connection with the remote server of the target system is
established.

Changes by group
To change the settings of several channels at once, please observe the section Multiple selection [}77].

4.1.6

Scope View XY Graph

The 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 at
channel level through an additional hierarchy level. Channel Style and Channel Acquisition are described
separately below.

TwinCAT 3 Scope View

Version: 1.2

37

Configuration

4.1.6.1

XY chart properties

All settings assigned to the XY chart can be made here.

38

Version: 1.2

TwinCAT 3 Scope View

Configuration

Behavior
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 tooltip with the
exact values of the data point on the X- and Y-axis, plus the timestamp and name of the corresponding
channel.
Default Display Time: This time indicates the display time for the signal or the signal length in the XY
chart. This value is set, for example, when the rescale button is selected in the chart toolbar.
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 the
performance.
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 within
the same area. If they are shown above each other, the channels are displayed in their own areas.

Changes by group
To change the settings of several charts at once, please observe the section Multiple selection [}77].
The chart display is operated with the toolbar. The overview shows all buttons and their explanation (from
left):

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 chart window. The changed value is adopted automatically.
Scroll buttons: The outer scroll buttons move the current display in steps that correspond to the
display width. The inner scroll keys move the display only by a tenth of the display width and can be
kept 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 as
separators. 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 by
clicking and dragging with the mouse.
Zoom Free: You can zoom into the current display by stretching a rectangle over the graphic area.
Rescale All: 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 is
60,000 data points.

TwinCAT 3 Scope View

Version: 1.2

39

Configuration
By turning the mouse wheel you can also zoom in or out on the current display. The cursor position defines
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 time
defines thus the zero point of the recording.
End-Time: The largest common time of all connected channels. The end time marks the final value of
the recording. The difference between the end time and start time is maximally as large as the defined
record time (see Scope properties [}27]).
Position: The position time represents the zero point of the current chart, i.e. the time from the start
time to the beginning of the display.
Time : The absolute time at the origin of the chart.
Date: The absolute date at the origin of the chart.

4.1.6.2

XY axes properties

Settings can be made separately for each available xy axis here.

40

Version: 1.2

TwinCAT 3 Scope View

Configuration

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.

TwinCAT 3 Scope View

Version: 1.2

41

Configuration

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 labelling.
X Grid Color: The 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 if
the range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows the
decades 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 enter the number of significant digits for the axis labels. It corresponds to
the number of visible digits on the axis.
X Scale Mode: There is a choice between two auto-scale modes. The default mode is AutoGrowOnly.
This means the x-axis always scales to the historic maximum, until a rescale is carried out for the
current view. Alternatively, AutoGrowNShrink can be selected. This mode always automatically adjusts
the maximum of the x-axis to the maximum in the current view (display width).

X Style
X Color: The colour of the axis.
X Line Width: The 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 and
can 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 labelling.
Y Grid Color: The 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 if
the range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows the
decades 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 enter the number of significant digits for the axis labels. It corresponds to
the number of visible digits on the axis.

42

Version: 1.2

TwinCAT 3 Scope View

Configuration
Y Scale Mode: There is a choice between two auto-scale modes. The default mode is AutoGrowOnly.
This means the y-axis always scales to the historic maximum, until a rescale is carried out for the
current view. Alternatively, AutoGrowNShrink can be selected. This mode always automatically adjusts
the maximum of the y-axis to the maximum in the current view (display width).
Y Style
Y Color: The colour of the axis.
Y Line Width: The 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 and
can 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 of several axes at once, please observe the section Multiple selection [}77].

4.1.6.3

XY channel style

All style settings belonging to a XY channel can be made here.

TwinCAT 3 Scope View

Version: 1.2

43

Configuration

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.

44

Version: 1.2

TwinCAT 3 Scope View

Configuration

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: The color of the graph.
Line Width: The line width of the graph. The line width 1 requires least computing.

Marks
Mark Color: The colour of the base markings.
Marks: Selection of the visibility of markings -> On (permanently visible) | Auto (dependent on the
zoom level) | Off (markings switched off).
Mark Size: The size of the base markings.

Modify
X Bit Mask: In the Bit Mask 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 of 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 the Bit Mask 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 of 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 of several channels at once, please observe the section Multiple selection [}77].

4.1.6.4

XY channel acquisition

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

TwinCAT 3 Scope View

Version: 1.2

45

Configuration

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.
Note
Example: The Array Length setting is only visible in the case of array symbols.

Acquisition
Data-Type: Indicates the data type of the selected variable.
Disabled: Here you can decide whether the configured channel should be recorded or not.
Force Oversampling: This option is only shown for arrays. If the option is set, the array is interpreted
as a variable and shows the values of the individual array elements contiguously. This corresponds to
the behavior of EtherCAT oversampling terminals. Comparisons: Oversampling recordings [}113].
Sample State: Here you can specify whether the data for the selected variables is to be sampled with
the TaskSampleTime or the FreeSampleTime.
Sample Time: If the sample state FreeSampleTime was selected, you can set the sampling rate
here. It is always greater than the TaskSampleTime.
Symbol based: If this option is set, the variables are communicated via the symbol name. If this option
is not set, the variables are communicated via the Group and Offset indices, and the input fields for
Group 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.

46

Version: 1.2

TwinCAT 3 Scope View

Configuration
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 phase differences of different target systems. The phase
differences 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 used
for the recording. If the option is not set, a connection with the remote server of the target system is
established.

Changes by group
To change the settings of several channels at once, please observe the section Multiple selection [}77].

4.1.7

Scope View Bar Graph

The properties of the individual hierarchy levels of array bar charts 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 at channel level through an additional hierarchy level. Channel Style and Channel Acquisition are
described separately below.

4.1.7.1

Bar chart properties

Here you can enter all the settings relating to a array bar chart.

TwinCAT 3 Scope View

Version: 1.2

47

Configuration

Behavior
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 tooltip with the
exact values of the data point on the X- and Y-axis, plus the timestamp and name of the corresponding
channel.
Default Display Time: This time refers to the display times of the minimum and maximum values in
the array bar chart. The values are recorded as a rule. A longer display time enables examination of
the history of the extreme values.
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 the
performance.
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 within
the same area. If they are shown above each other, the channels are displayed in their own areas.

48

Version: 1.2

TwinCAT 3 Scope View

Configuration

Changes by group
To change the settings of several charts at once, please observe the section Multiple selection [}77].
The chart display is operated with the toolbar. The overview shows all buttons and their explanation (from
left):

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 values are recorded as a rule. A longer display time enables examination of the history
of the extreme values.
Scroll buttons: The outer scroll buttons move the current display in steps that correspond to the
display width. The inner scroll keys move the display only by a tenth of the display width and can be
kept pressed to view the data set.
Position: The displayed position can be edited in the Position field in the format "hh:mm:ss,fff". The
colons serve here as separators. If not all units are edited the format is sorted in ascending order,
starting with seconds.
Undo/Redo Time/Position: Jumps in the display width or the current position can be undone here,
irrespective of their origin (e.g.: zoom, scroll, etc.). The right mouse button is likewise 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 xaxis 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 by
clicking and dragging with the mouse.
Zoom Horizontal: A new time range for the display can be selected by stretching a rectangle over the
x-axis.
Zoom Free: You can zoom into the current display by stretching a rectangle over the graphic area.
Rescale All: 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.1.7.2

Bar axes properties

All the settings for the axes of array bar charts are described here.

TwinCAT 3 Scope View

Version: 1.2

49

Configuration

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.

50

Version: 1.2

TwinCAT 3 Scope View

Configuration

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 labelling.
X Grid Color: The 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 if
the range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows the
decades 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 enter the number of significant digits for the axis labels. It corresponds to
the number of visible digits on the axis.

X Style
X Color: The color of the axis.
X Line Width: The 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 and
can 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 labelling.
Y Grid Color: The 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 if
the range of values per tick is precisely one decade. Otherwise the displayed auxiliary line shows the
decades 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 enter the number of significant digits for the axis labels. It corresponds to
the number of visible digits on the axis.
Y Style
Y Color: The color of the axis.
Y Line Width: The line width in pixels.

TwinCAT 3 Scope View

Version: 1.2

51

Configuration
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 and
can 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 of several axes at once, please observe the section Multiple selection [}77].

4.1.7.3

Bar Channel Style

All 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.
Line Color: The color of the graph.

52

Version: 1.2

TwinCAT 3 Scope View

Configuration
Line Width: The line width of the graph. 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.
Type: Here you can switch between different display types. The default value for an array bar chart is
Bar. Other options are: Line and Stair.

Marks
Mark Color: The color of the base markings.
Marks: Selecting the visibility of markings -> On (permanently visible) | Off (markings switched off).
Mark Size: The size of the base markings.

Modify
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 of several channels at once, please observe the section Multiple selection [}77].

4.1.7.4

Bar Channel Acquisition

This section explains all settings for the channel acquisition of array bar chart channels.

TwinCAT 3 Scope View

Version: 1.2

53

Configuration

Acquisition
Array Length: Indicates the length of selected arrays, which is also the maximum displayed on the xaxis.
Data-Type: Indicates the data type of the selected variable.
Disabled: 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 is 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 the human eye to
observe it.
Sample Time: If the sample state FreeSampleTime was selected, you can set the sampling rate
here. It is always greater than the TaskSampleTime. The default setting for array bar charts is 100
ms. 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 option
is not set, the variables are communicated via the Group and Offset indices, and the input fields for
Group 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.
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 phase differences of different target systems. The phase
differences 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 used
for the recording. If the option is not set, the system tries to connect to the remote server of the target
system.

Changes by group
To change the settings of several channels at once, please observe the section Multiple selection [}77].

4.1.8

Recording

4.1.8.1

TwinCAT Scope View - Target Browser

With the target browser you can be add Scope configuration channels via their symbol names. The target
browser is divided into two halves. The first shows a tree with the first entry: ROUTES. Below that all devices
registered in the System Manager are shown. The colour of the target indicates the system state: red = not
reachable (stop mode), blue = config. mode, green = system in run mode.

54

Version: 1.2

TwinCAT 3 Scope View

Configuration

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

With the Upper Folder button you can go one level upwards in the tree structure.

Add channel
In the list structure one or more channels can now be selected and added to the configuration with a double
click or by a right mouse click-> "Add symbol" ("Add subsymbols" ) or by one of the buttons in the toolbar.
In addition, selected elements can be inserted by drag & drop to any place within the configuration.
If a folder, an Ads Bigtype or an array is selected that contains sub-symbols, the "Add Subsymbols" option
adds a channel for each subsymbol. The "Add symbol" option inserts only one channel with the information
of the selected symbol.

TwinCAT 3 Scope View

Version: 1.2

55

Configuration

Task selection
If a target computer is selected in the tree or list structure, the connected tasks become visible. These are
marked in colour: green = PLC task, blue = NC task, red = other.
If a task is not displayed, then a selection menu can be called using the Enable Server Types option that
displays the limitation to certain tasks.

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

View symbol list


If a symbol list is available for the selected task, this can be called by means of selection. All symbols of a
task are transferred into a hierarchical view according to separators (e.g. '.'), allowing simple browsing.

Settings
The detail level of the channel name formed from the symbol name can be set with the 'Name Detail Level'
option in the settings. If the detail level is zero, then only the part of the symbol name after the final full stop
is transferred. Each further level then adds the term before the respective next full stop. For example, the
symbol "Main.Signals.Sinus" with a detail level of 0 becomes "Sinus", with a detail level of 1 it becomes
"Signals.Sinus" and with 2 or more it becomes "Main.Signals.Sinus".

56

Version: 1.2

TwinCAT 3 Scope View

Configuration

Record
After you have chosen all channels for the record, you can start the record with the "Start Record" button in
the Scope Toolbar.

4.1.9

Cursor

4.1.9.1

TwinCAT Scope View - Cursor

A chart cursor can be added and changed via the cursor module.

TwinCAT 3 Scope View

Version: 1.2

57

Configuration

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

58

Version: 1.2

TwinCAT 3 Scope View

Configuration

Delta Values: If several cursors are used in one direction the differences can be displayed if Delta
Types is activated.
Hex Valies: 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: Colour 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 (Scope context menu -> cursor window)

TwinCAT 3 Scope View

Version: 1.2

59

Configuration

Status Times
The times belonging to an added X-cursor are displayed here 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 Channel
field. The displayed average values are, like the display, compromised to pixel width. You can zoom into the
recording in order to indicate the intermediate values.

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

60

Version: 1.2

TwinCAT 3 Scope View

Configuration

4.1.10

Trigger

4.1.10.1

TwinCAT Scope View - Trigger

Different trigger functions can be added to the Scope configuration.


In order to enable the simplest possible and free combination of individual trigger conditions and actions,
these are combined into trigger groups.

TwinCAT 3 Scope View

Version: 1.2

61

Configuration

properties of the trigger group can differ


The properties of the trigger group can deviate from the illustration shown here.
Some setting options are visible / editable only for special trigger actions.
Note
Example: The trigger position setting is only visible in the case of the trigger action "Stop
Display".
Trigger groups and trigger sets can be added via the trigger context menu.

Trigger group
The trigger group offers the following setting options:

62

Version: 1.2

TwinCAT 3 Scope View

Configuration
StartRecord: If this option is selected, the start record condition in the Scope settings should be set to
trigger start. Otherwise the Scope would start recording as usual. With setting this action, therefore, a
question box appears that carries out this setting if necessary. If you actuate the record button in the
menu bar, the Scope connects itself as usual to the servers involved and starts to sift through the
connected channels, but without starting the actual recording. The recording begins with the trigger
time of the last trigger set condition.
StopRecord: If the stop action is selected, the Scope should be operated in the ring buffer mode. With
setting this action, therefore, a question box appears that carries out this setting if necessary. In the
field below you can specify whether a fixed time range should appear in the recording before and/or
after the trigger event. If pre-trigger is selected, trigger events before the expiry of this time are ignored.
If post-trigger is active, the recording runs for the specified time after receipt of the trigger event.
StopDisplay: The stop display action stops all Scope charts that are in live mode at the point of
triggering. With the trigger position you can select how many percent of the display shown (display
width) are to be located before or behind the trigger event (in the example: positive 0-crossing of the
green signal at 10% of 2.5 s = 0.25 s). If the trigger condition is fulfilled again, the display jumps to this
new event. Pause can be actuated in the chart in order to prevent this retriggering.
RestartDisplay: All charts paused due to a StopDispay trigger are resumed on fulfilment of the trigger
condition.
StartSubsave: On the occurrence of this trigger event a background recording is started with the
current configuration. This subsave always runs in the ring buffer mode (independent of the settings in
the Scope settings). It is possible to start up to 5 subsaves simultaneously (via one or more trigger
events). The maximum memory capacity of the subsave can be specified in the 'Record Time' field.
This recording duration may also be longer than the recording duration of the basic configuration (in
this case ring buffer operation should also be selected).
StopSubsave: Following the StopSubsave trigger event, the oldest subsave is stopped and
transferred to the View in the background. From here it is saved in a .svd file via the specified path.
The generated file name consists of the name of the Scope in the basic configuration and an ID
composed of the date and time, in alphanumeric order.

TwinCAT 3 Scope View

Version: 1.2

63

Configuration

Trigger set

Each trigger set can be regarded as an independent 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 trigger
condition
Combine: By selecting a logic operation these individual conditions can be placed in relation to one
another. Note here that AND operations are handled before OR operations.
Hit: indicates whether the trigger set has been triggered (
) or not (
).
Release: The release condition can be either a rising or falling edge.
Threshold: The associated limit value.

As soon as 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 triggered.

Manual triggering of trigger set


Triggers can be manually triggered for test purposes via the trigger set context menu item "Manual Trigger
Hit".
64

Version: 1.2

TwinCAT 3 Scope View

Configuration

4.1.11

Saving and exporting data

4.1.11.1

Save

Data that were logged with the TwinCAT 3 Scope can be saved in .svd format. A .svd file is a special,
proprietary Scope View data format.
Saving data
Use the option Save Data in the Scope menu
This creates a Scope data file (svd) that can be added directly to the measurement project or saved in
a directory via the directory selection dialog.
If several svd files are added to a measurement project, the name of the svd file is automatically
incremented with a number.
Loading data
Double-click on the required .svd file -> Visual Studio opens and offers a New Project dialog. The
most common choice is an Empty Measurement Project.
If a measurement project already exists, the svd file can be selected and opened via Add Existing Item.
Select the measurement project to which the previously created svd file was added
File -> Open -> Project/Solution.
Reloading of svd files
If previously saved data are no longer displayed by the Scope server as a result of a "disconnect" in
the internal Scope communication, the context menu automatically offers a reload option for the svd
file. In this way the data can be reloaded.

Extracting Scope configurations from an svd file


An svd file is visually identified as such. A corresponding yellow data icon is displayed in the Solution
Explorer. This enables exclusively data analysis within the file.
To use the configuration for other purposes, for example to record further data with the same configuration,
select the option Extract Scope Configuration in the Scope menu.

TwinCAT 3 Scope View

Version: 1.2

65

Configuration

4.1.11.2

Export CSV / Binary

Recorded Scope data can be saved in a Scope data file (.svd). Alternatively, once the current recording has
stopped, data can be exported in .csv, .txt or binary format for use in other programs.
Context menu of the Scope -> Export to CSV/Export to Binary

Export to CSV:
The generated file is held in the table format. The rows are separated by lines and the columns by
tabulators. The first rows contain 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.

66

Version: 1.2

TwinCAT 3 Scope View

Configuration

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

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

TwinCAT 3 Scope View

Version: 1.2

67

Configuration
Variable
MAIN-HEADER
HeaderSize
NameSize
Name
StartTime
EndTime
ChannelCount

Size (Bytes) or Number of character DataType


8
4
NameSize
8
8
4

Int64
Int32
Array of Char
Int64
Int64
Int32

Variable
Size (Bytes)
Channel - Header #1
ChannelHeaderSize
8
NameSize
4
Name
NameSize
NetIdSize
4
NetId
NetIdSize
Port
4
Sample Time
8
SymbolBased
1
SymoblNameSize
4
Symbol name:
SymbolNameSize
CommentSize
4
Comment
CommentSize
IndexGroup
8
IndexOffset
8
DataTypeSize
4
DataType
DataTypeSize
DataTypeId
4
VariableSize
4
Samples in File
8
Data in File
8
File-StartPosition
8
Scalefactor
8
Offset
8
Bitmask
8
Channel - Header #2
...
Channel-Header #MainHeader.ChannelCount

DataType

Variable
Size (Bytes)
Data Channel #1
DataPoint #1
Timestamp
4
Value
ChannelHeader1.VariableSize
DataPoint #2
...
DataPoint ChannelHeader #1.Samples In File
Data Channel #2
...

DataType

68

Version: 1.2

Int64
Int32
Array of Char
Int32
Array of Char
Int32
Int64
bool (as byte)
Int32
Array of Char
Int32
Array of Char
Int64
Int64
Int32
Array of Char
Int32
Int32
Int64
Int64
Int64
Real64
Real64
Int64

UInt32
ChannelHeader.DataType

TwinCAT 3 Scope View

Configuration
Data Channel #MainHeader.ChannelCount

4.1.11.3

Export tdms / dat

Recorded data can be saved in a scope data file (.svd). Alternatively data can be exported to .tdms or .dat
format, once the current recording is complete. Both data formats are widely used in measurement
applications and can be used with the TwinCAT 3 Scope View Professional version.
Context menu of the Scope -> Export to DAT/Export to TDMS

4.1.11.4

Automated export

From Scope version 3.2.3129 an additional TC3ScopeExport tool is installed in the TE130X Scope View
folder. This can be used to convert content from .svd files into the supported export formats. The tool comes
with integrated documentation and requires a Professional license.

The TC3ScopeExport tool can also be used for export via a command line call, based on specified
parameters. The interface shown here can be suppressed by entering the keyword "silent" in the command
line. 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 example
with 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.1.12

Reporting

4.1.12.1

TwinCAT Scope View - Reporting

With the help of the Microsoft Visual Studio Report Designer it is possible to generate complex printing
templates which are used by the TwinCAT Measurement, for example, to print Scope charts.

TwinCAT 3 Scope View

Version: 1.2

69

Configuration

The following report is generated from the recording shown here via the Visual Studio "Print" function (File ->
Print | <Ctrl> + P): http://infosys.beckhoff.com/content/1033/TE13xx_TC3_ScopeView/.

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 the
TwinCAT Measurement.
It can be added to every existing TwinCAT Measurement Project via the context menu -> Add -> New Item > Standard Report. This printing template is already contained in the project with the TwinCAT Measurement
Template "Measurement Scope Project with Reporting".

Editing a report
In order to edit a report the Microsoft Visual Studio Report Designer can be opened by double-clicking on the
printing template.

70

Version: 1.2

TwinCAT 3 Scope View

Configuration

For the editing of 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 relevant
data 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 of the document.
User ID: User ID of the user who commissioned the report.
Language: the 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.
TwinCAT 3 Scope View

Version: 1.2

71

Configuration
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: colour of the channel in hexadecimal notation.
ChannelComment: comment of the channel.
ChannelName: name of the channel.
Cursor_Status_Times
ColorHex: colour 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: colour 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: colour of the cursor in hexadecimal notation.
Column: name of the cursor column.
Row: name of the cursor row.
Value: displayed value.
Chart_Data
Channel: channel name.
Time : time stamp of the value.
Value: displayed value.

Chart_Data usage

Note

The Chart_Data are the raw data of the chart. They are only exported if the setting "Export
Raw Data to Report" has been selected (Menu Options [}76])
This setting significantly delays the creation of reports.
The raw data of the chart are for the creation of your own displays.

72

Version: 1.2

TwinCAT 3 Scope View

Configuration
4.1.12.2

reporting_sample.pdf

TwinCAT 3 Scope View

Version: 1.2

73

Configuration

Record Start: 12:38:17:450


Record End:

12:38:27:484

Axis Name

Channel Name

Channel Comment

Position absolute

ACTPOS

Actual Position

SETPOS

Set Position

ACTPOSMODULO

Actual Position Modulo

SETPOSMODULO

Set Position Modulo

ACTVELO

Actual Velocity

SETVELO

Set Velocity

ACTACC

Actual Acceleration

SETACC

Set Acceleration

POSDIFF

Position Difference

Position modulo
Velocity
Acceleration
Position Lag

Status Times

C 01

Absolute Position

12:38:18:461.000
16.05.2013

Record Position

01:011,961s

Chart Position

00:977,96s

C:\TwinCAT Measurement\Scope\Scope NC Project.tcscope


5/16/2013 12:47:55 PM

74

1/2

Version: 1.2

TwinCAT 3 Scope View

Configuration

X-Values

C 01

ACTACC

ACTPOS

258,672887

ACTPOSMODULO 258,672887
ACTVELO

237,736500

POSDIFF

SETACC

-553,50000

SETPOS

258,672887

SETPOSMODULO 258,672887
SETVELO

231,919499

Y-Values

C 02

Acceleration

-184,21053

Position absolute

122,368419

Position Lag

-1,8421053

Position modulo

122,368419

Velocity

-55,263161

C:\TwinCAT Measurement\Scope\Scope NC Project.tcscope


5/16/2013 12:47:55 PM

TwinCAT 3 Scope View

2/2

Version: 1.2

75

Configuration

4.1.13

Scope Options

4.1.13.1

TwinCAT Scope View - Scope Menu: Options

You can go directly to the TwinCAT measurement options in the Visual Studio Options window via the Scope
menu item "'Options...".

The standard or default settings can be made here.

76

Version: 1.2

TwinCAT 3 Scope View

Configuration

Reporting
General
Show Chart Timebar: specifies whether the time bar of the Scope chart should be visible in
the printing template.
Show Chart Toolbar: specifies whether the toolbar of the Scope chart should be visible in the
printing template.
Use Custom Color: If "Use Custom Color" is active, the following color settings are used before the chart is exported for the report (color combinations can be selected here that reduce
ink consumption for printing processes).
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 labelling of the X-axis.
X-Axis Color: color for the grid of the X-axis.
Y-Axis Color: color for the labelling 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
Root: 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 [}36].
Axis: Defines the standard axis settings (used if new axes are inserted); for a detailed description see
Axis properties [}32].
Channel: Defines the standard channel settings (used if empty channels are inserted); for a detailed
description see Channel properties [}34].
Chart: Defines the standard chart settings (used if new charts are inserted); for a detailed description
see Chart properties [}29].
Scope: Defines the standard Scope settings (used if new Scope instances are inserted); for a detailed
description see Scope properties [}27].
Error List
Clear on Record: Deletes the respective error messages for the Scope instance from the error list as soon as a Scope changes to the record mode.
Show Clear List Command: Shows the context menu item "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.

4.1.13.2

TwinCAT Scope View Multiple Selection

Changes by group
Some parameters are often modified for several or all elements. To do this you can mark several elements
via the Solution Explorer and edit the settings of all marked elements at the same time. Data that differ
between the selected elements are represented as empty fields.
To make multiple selections, keep the <Ctrl> key pressed during the selection. In the case of successive
elements you can select the first element, keep the <Shift> key pressed and then select the last element in
order to mark all elements in between. Further you can select all channels of the scope easily independent of
the configuration. Keep the <Alt>-key pressed and double click on the first channel in the Scope
configuration.

TwinCAT 3 Scope View

Version: 1.2

77

Configuration

All elements of the same type can be selected.


Multiple selection is implemented for:
Scopes
Charts
Axes
Channels
Cursor
Trigger Groups
Trigger Sets

78

Version: 1.2

TwinCAT 3 Scope View

.NET API

.NET API

5.1

Integration of the ScopeViewControl

Integration of the ScopeViewControl in your own applications


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

Required software
The ScopeViewControl requires .NET Framework 4.0. The ".NET Framework 4 Client Profile" is not supported.
Note

Installation of the .NET Framework 4.0


1. Right-click on the project and select Properties.
2. Under Application, select .NET Framework 4.0 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.
3. Select Browse.
TwinCAT 3 Scope View

Version: 1.2

79

.NET API
4. Find the installation path for the TE130X Scope View and open it.
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 the
'TcAdsScope2Communications' 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 Chart

The application shown in the example below is created to demonstrate the main aspects of
ScopeViewControl.
To do this, create a new Windows application and add a tool bar and the buttons shown to the form in the
designer. By double-clicking on each button you can generate a Click-Event handler, which is filled with the
example code in the following. Then add a ScopeViewControl to the form as described above and set the
'Dock' property to Full.

Required software
The ScopeViewControl requires .NET Framework 4.0. The ".NET Framework 4 Client Profile" is not supported.
Note

80

Version: 1.2

TwinCAT 3 Scope View

.NET API

Installation of the .NET Framework 4.0


1. Right-click on the project and select Properties.
2. Under Application, select .NET Framework 4.0 as the target framework.
The .NET Framework 4.0 is installed.
The example developed here is available as a VS2010 project: scopeviewcontrolintegration.zip
The example accesses variables of the example PLC program: ScopeSignals.zip

5.1.1.1

Loading the configuration

Loading the configuration


The project, which is now executable, shows a grey surface at the start, since no configuration has been
loaded or created. A configuration can either be created programmatically, or a file created with the TwinCAT
Scope can be loaded.
The C# code example shows the call from a 'ButtonClick EventHandler':
privatestringfilename=@"ScopeTest.sv2";
privatevoidbutton_Load_Click(objectsender,EventArgse)
{
FileInfofinfo=newFileInfo(filename);
if(!finfo.Exists)
{
MessageBox.Show(this,"Filenotfound!Pleaseusethe'New'buttonstocreateaconfig.\r\n
Onceaconfigiscreatedandsaveditcanbeloadusingthe'Load'-Button!","Filenotfound!",
MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
else
{
//alteKonfigurationlschen
while(scopeViewControl1.Charts.Count>0)
{
scopeViewControl1.DeleteChart(scopeViewControl1.Charts[0]);
}
//Konfigurationladen
scopeViewControl1.LoadScopeConfig(filename);
foreach(ScopeViewControlChannelchannelinscopeViewControl1.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. For
details, refer to the separate API documentation of the 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 method
in the respectively higher element:
Charts:
private void buttonChart_Click(object sender, EventArgs e) { ScopeViewControlChart chart =
scopeViewControl1.NewChart(); }

(Y-)axes:

TwinCAT 3 Scope View

Version: 1.2

81

.NET API
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 also visible
in the corresponding Visual Studio Properties window. For instance, colour and line width can be assigned to
a channel.
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; } }

5.1.1.4

Adaptation of the acquisition data

In addition to the 'Style', each channel also has the 'Acquisition' property. The connection to a system
variable is set here:
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 and AmsPort require the TwinCAT.Ads.dll channel.Acquisition.AmsNetId = AmsNetId.Local; channel.Acquisition.TargetPort = (int)AmsPort.PlcRuntime1; channel.Acquisition.IsSymbolBased = true;
channel.Acquisition.SymbolName = "SIGNALS.TREPPE"; 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 for controlling the ScopeViewControl are summarised in the 'Operating' property.
Here, all the properties can be found that are also visible in the Visual Studio Properties window with the
Scope selected. Beyond that, methods are available for starting and stopping the recording or for saving and
export.
private void button_StartRecord_Click(object sender, EventArgs e)
{
try
{
// Discard old data
if (scopeViewControl1.State == ScopeViewControlStates.REPLY)
scopeViewControl1.Operating.DisConnect(false);
// Start recording
if (scopeViewControl1.State == ScopeViewControlStates.CONFIG)

82

Version: 1.2

TwinCAT 3 Scope View

.NET API
scopeViewControl1.Operating.StartRecord();
// Start all charts
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);
}
}
private void button_Save_Click(object sender, EventArgs e)
{
try
{
// Save if data are there
if (scopeViewControl1.State == ScopeViewControlStates.REPLY)
{
File.Create("ExportData.svd").Close();
scopeViewControl1.Operating.SaveData("ExportData.svd");
}
// Otherwise save only the configuration
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. The options to hide/
show the toolbar and the time bar are also to be found there.
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);
}

TwinCAT 3 Scope View

Version: 1.2

83

.NET API
if (scopeViewControl1.State == ScopeViewControlStates.RECORD)
scopeViewControl1.Charts[0].ChartOperating.StopDisplay();
}
private void toolStripButtonDelChart_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]);
}
}

5.1.2

Sample XY Chart

The form shown above illustrates a Scope View control integration in C# with an XY chart. The procedure is
explained below.
First, create a Windows Forms application with a toolbar containing the buttons shown in the above form.
Then, add a ScopeViewControl to the form and set the Dock property to Full, so that the graph can utilize
the whole window.

84

Version: 1.2

TwinCAT 3 Scope View

.NET API

Required software
The ScopeViewControl requires .NET Framework 4.0. The ".NET Framework 4 Client Profile" is not supported.
Note

Installation of the .NET Framework 4.0


1. Right-click on the project and select Properties.
2. Under Application, select .NET Framework 4.0 as the target framework.
The .NET Framework 4.0 is installed.
The program can be found in the following file: http://infosys.beckhoff.com/content/1033/
TE13xx_TC3_ScopeView/Resources/zip/2282227083.zip
The variables refer to the TwinCAT program behind the following file: http://infosys.beckhoff.com/
content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282225419.zip

5.1.2.1

C# sample project

The form shown above illustrates a Scope View control integration in C# with an XY chart. The procedure is
explained below.
First, create a Windows Forms application with a toolbar containing the buttons shown in the above form.
Then, add a ScopeViewControl to the form and set the Dock property to Full, so that the graph can utilize
the whole window.

Required software
The ScopeViewControl requires .NET Framework 4.0. The ".NET Framework 4 Client Profile" is not supported.
Note

TwinCAT 3 Scope View

Version: 1.2

85

.NET API

Installation of the .NET Framework 4.0


1. Right-click on the project and select Properties.
2. Under Application, select .NET Framework 4.0 as the target framework.
The .NET Framework 4.0 is installed.
The program can be found in the following file: http://infosys.beckhoff.com/content/1033/
TE13xx_TC3_ScopeView/Resources/zip/2282227083.zip
The variables refer to the TwinCAT program behind the following file: http://infosys.beckhoff.com/
content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282225419.zip

5.1.2.2

Loading the configuration

privatevoidbutton_load_Click(objectsender,EventArgse)
{
FileInfofinfo=newFileInfo(filename);
if(!finfo.Exists)
{
MessageBox.Show(this,"Filenotfound!Pleaseusethe'AddChart'buttonstocreateaconfig.\r
\nOnceaconfigiscreatedandsaveditcanbeloadusingthe'Load'-Button!","Filenotfound!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
else
{
//alteKonfigurationlschen
while(scopeViewControl1.Charts.Count>0)
{
scopeViewControl1.DeleteChart(scopeViewControl1.Charts[0]);
}
//Konfigurationladen
scopeViewControl1.LoadScopeConfig(filename);
foreach(ScopeViewControlChannelchannelinscopeViewControl1.ConnectedChannels)
{
channel.Acquisition.AmsNetId=AmsNetId.Local;
}
}
}

The code specified above is executed by clicking the Load button in the interface. It is used to open a
configuration file (.tcscope), which is created with the TwinCAT Scope. This file only contains the information
about the axes and the channels, but not the graph (measured data) itself.
This method first checks the existence of the method. If this is the case, the configuration opened in the
program is 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 about this can be
found under Control recording.

5.1.2.3

Create configuration

In this example, a program configuration with three buttons is created, since a configuration consists of three
hierarchy levels, which build on each other.
In Scope, first use the Add Chart button to create a new chart. The chart is the environment, in which the
graph with the coordinate system appears. The chart represents the basic framework and must be created
first. Ensure that the property ChartType is set to XY.
privatevoidbutton_AddChart_Click(objectsender,EventArgse)
{
ScopeViewControlChartchart=scopeViewControl1.NewChart();
scopeViewControl1.Charts[scopeViewControl1.Charts.Count-1].ChartType=TwinCAT.Scope2.Communications.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 this
coordinate system is created in the chart, the presence of a chart must be verified. Without a chart, the
coordinate system cannot be created.
86

Version: 1.2

TwinCAT 3 Scope View

.NET API
privatevoidbutton_AddAxis_Click(objectsender,EventArgse)
{
if(scopeViewControl1.Charts.Count==0)
{
MessageBox.Show(this,"Pleasecreateachartfirst!","Nochartconnected!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
else
{
ScopeViewControlYAxisaxis=scopeViewControl1.Charts[0].NewAxis();
if(axisisScopeViewControlXYAxis)
{
ScopeViewControlXYAxisxyAxis=(ScopeViewControlXYAxis)axis;
}
}
}

Once the axes have been created, the Add Channel button can be used to add an XY-channel. This XYchannel is linked directly to the axes. First, check whether charts and axes were created. When creating the
XY-channel, ensure that casting takes place from the Y-objects to the XY-objects. This is easily possible,
since the XY-objects inherit from the Y-objects.
privatevoidbutton_AddChannel_Click(objectsender,EventArgse)
{
if(scopeViewControl1.Charts.Count==0)
{
MessageBox.Show(this,"Pleasecreateachartfirst!","Nochartconnected!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
elseif(scopeViewControl1.Charts[0].Axes.Count==0)
{
MessageBox.Show(this,"PleasecreatetheAxisfirst!","Noaxisconnected!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
elseif(scopeViewControl1.Charts[0].Axes[0].Channels.Count>0)
{
MessageBox.Show(this,"Thissamplecontainsonlyonechannel!","Channelstillconnected!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
else
{
ScopeViewControlYAxisaxis=scopeViewControl1.Charts[0].Axes[0];
if(axisisScopeViewControlXYAxis)
{
ScopeViewControlXYAxisxyAxis=(ScopeViewControlXYAxis)axis;
ScopeViewControlXYChannelchannel=xyAxis.NewChannelPair();
ChangeChannelSettings(channel);
SetAcquisition(channel);
}
}
}

Once the channel has been created, the graph style can be modified, and the acquisition can be set. These
methods are explained in more detail in the following sections.

5.1.2.4

Edit channel

Edit style:
Each channel has a Style property, in which values for the graphs are specified. This is where colors and
line thickness can be assigned, for example.
privatevoidChangeChannelSettings(ScopeViewControlXYChannelchannel)
{
channel.Style.LineColor=Color.Red;
channel.Style.MarkColor=Color.DarkRed;
channel.Style.LineWidth=2;
}

Edit acquisition data:

TwinCAT 3 Scope View

Version: 1.2

87

.NET API
The acquisition data of a channel describe the connection between the Scope and the respective value of
the machine control. During the acquisition the SymbolName is set. This is the hierarchical name of 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.
privatevoidSetAcquisition(ScopeViewControlXYChannelchannel)
{
channel.Acquisition.AmsNetId=AmsNetId.Local;
channel.Acquisition.TargetPort=851;
channel.Acquisition.IsSymbolBased=true;
channel.Acquisition.SymbolName="MAIN.Puls2";
channel.Acquisition.DataType=DataTypeConverter.AdsToScope2Datatype(AdsDatatypeId.ADST_REAL32);
channel.Acquisition.SampleTime=(uint)(10*TimeSpan.TicksPerMillisecond);
channel.XAcquisition.AmsNetId=AmsNetId.Local;
channel.XAcquisition.TargetPort=851;
channel.XAcquisition.IsSymbolBased=true;
channel.XAcquisition.SymbolName="MAIN.Puls1";
channel.XAcquisition.DataType=DataTypeConverter.AdsToScope2Datatype(AdsDatatypeId.ADST_REAL32);
channel.XAcquisition.SampleTime=(uint)(10*TimeSpan.TicksPerMillisecond);
}

5.1.2.5

Control recording

Use the Start and Stop buttons to start and stop the recording.
privatevoidbutton_Start_Click(objectsender,EventArgse)
{
try
{
//alteDatenverwerfen
if(scopeViewControl1.State==ScopeViewControlStates.REPLY)
scopeViewControl1.Operating.DisConnect(false);
//Aufnahmestarten
if(scopeViewControl1.State==ScopeViewControlStates.CONFIG)
scopeViewControl1.Operating.StartRecord();
//alleChartsstarten
if(scopeViewControl1.State==ScopeViewControlStates.CONNECTED)
scopeViewControl1.Operating.StartAllDisplays();
}
catch(Exceptionerr)
{
MessageBox.Show(this,err.Message,"Erroronstartrecord!",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
privatevoidbutton_Stop_Click(objectsender,EventArgse)
{
try
{
if(scopeViewControl1.State==ScopeViewControlStates.RECORD)
scopeViewControl1.Operating.StopRecord();
}
catch(Exceptionerr)
{
MessageBox.Show(this,err.Message,"Erroronstoprecord!",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}

The Operating properties are available in Scope View control for starting or stopping the recording and for
the settings of the Scope.
If a recording is currently displayed, it must be removed before a new recording. The recording is then
started. For display on the interface the display is then started.
To stop a recording, execute the method StopRecord. Press the Stop button.

88

Version: 1.2

TwinCAT 3 Scope View

.NET API

5.1.2.6

Save configuration/recording

privatevoidbutton_Save_Click(objectsender,EventArgse)
{
try
{
//wennDatendasindspeichern
if(scopeViewControl1.State==ScopeViewControlStates.REPLY)
{
File.Create("ExportData.svd").Close();
scopeViewControl1.Operating.SaveData("ExportData.svd");
}
//sonstnurdieKonfigurationspeichern
else
{
File.Create(filename).Close();
scopeViewControl1.SaveScopeConfig(filename);
}
}
catch(Exceptionerr)
{
MessageBox.Show(this,err.Message,"Erroronsave!",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 the data.
The .tcscope file, on the other hand, only contains the configuration without actual data. It can be used to
start new recordings.

5.1.2.7

Control chart

The Run and Pause buttons can be used to pause and resume the graph during recording. The
DelChart button is used to close the chart.
privatevoidbutton_Run_Click(objectsender,EventArgse)
{
if(scopeViewControl1.State!=ScopeViewControlStates.RECORD)
{
MessageBox.Show(this,"Onlypossibleifarecordisrunning!","Runnotpossible!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
if(scopeViewControl1.State==ScopeViewControlStates.RECORD)
scopeViewControl1.Charts[0].ChartOperating.StartDisplay();
}
privatevoidbutton_Pause_Click(objectsender,EventArgse)
{
if(scopeViewControl1.State!=ScopeViewControlStates.RECORD)
{
MessageBox.Show(this,"Onlypossibleifarecordisrunning!","Pausenotpossible!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
if(scopeViewControl1.State==ScopeViewControlStates.RECORD)
scopeViewControl1.Charts[0].ChartOperating.StopDisplay();
}
privatevoidbtn_DelChart_Click(objectsender,EventArgse)
{
if(scopeViewControl1.Charts.Count==0)
{
MessageBox.Show(this,"Nochartisconnected!","Nothingtodelete!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
elseif(scopeViewControl1.State==ScopeViewControlStates.RECORD)
{
scopeViewControl1.Operating.StopRecord();
scopeViewControl1.Operating.DisConnect(false);
}
elseif(scopeViewControl1.State==ScopeViewControlStates.REPLY)
{
scopeViewControl1.Operating.DisConnect(false);

TwinCAT 3 Scope View

Version: 1.2

89

.NET API
}
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 currently
being recorded.
The Run button and the method StartDisplay behind it can then be used to resume the chart. The
StopDisplay method can be used to pause the display via the Pause button. The recording continues in the
background. This is apparent if the Overview chart is active, for example.
Before the chart is deleted, the system checks whether a chart is open. It then checks whether recording is
active. If this is the case, the current recording is stopped. The method DisConnect under Operating can
be used to remove the graph from the chart. The method DeleteChart can be used to delete a chart from
ScopeViewControl.

5.1.3

Sample YT Cursor

The 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. A toolbar can be used to create the menu with the buttons
shown in the image above.
The code behind the Load and Create Configuration buttons can be found in the sample for the
ScopeViewControl YT chart.

90

Version: 1.2

TwinCAT 3 Scope View

.NET API

Required software
The ScopeViewControl requires .NET Framework 4.0. The ".NET Framework 4 Client Profile" is not supported.
Note

Installation of the .NET Framework 4.0


1. Right-click on the project and select Properties.
2. Under Application, select .NET Framework 4.0 as the target framework.
The .NET Framework 4.0 is installed.
The program can be found in the following file:http://infosys.beckhoff.com/content/1033/
TE13xx_TC3_ScopeView/Resources/zip/2282228747.zip
The variables refer to the TwinCAT program behind the following file: http://infosys.beckhoff.com/
content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282225419.zip

5.1.3.1

C# sample project

The 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. A toolbar can be used to create the menu with the buttons
shown in the image above.
The code behind the Load and Create Configuration buttons can be found in the sample for the
ScopeViewControl YT chart.

TwinCAT 3 Scope View

Version: 1.2

91

.NET API

Required software
The ScopeViewControl requires .NET Framework 4.0. The ".NET Framework 4 Client Profile" is not supported.
Note

Installation of the .NET Framework 4.0


1. Right-click on the project and select Properties.
2. Under Application, select .NET Framework 4.0 as the target framework.
The .NET Framework 4.0 is installed.
The program can be found in the following file:http://infosys.beckhoff.com/content/1033/
TE13xx_TC3_ScopeView/Resources/zip/2282228747.zip
The variables refer to the TwinCAT program behind the following file: http://infosys.beckhoff.com/
content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282225419.zip

5.1.3.2

Add cursors

The cursors for a chart are in the CursorModule. To add a further cursor, call the method
NewCursor(Boolean).
The Boolean value determines whether the cursor is an X- or Y-cursor. To create an X-cursor, set the value
to false. For a Y-cursor, set the value to true.
Once the cursors have been created, add method events, so that the tables on the interface are updated.
These methods are explained in more detail later.
The last event is triggered with a mouse click on the cursor. This method is also explained in more detail
later.
The new cursor, including its color, is then added in the table. In addition, the refreshX method is called to
enter the current values in the table right away, rather than later, when each individual cursor is assigned
new values.
Finally, the method is called which recreates the view of the delta values. These methods are described in
more detail later.
To ensure that the display of the delta values matches the new cursor, all old delta values are deleted first.
All new delta values are then calculated and added to the table.
Note that X-cursors have several values, if there are several channels. Therefore, all channel values should
be double-checked for this cursor. This is not necessary for Y-cursors, since they only have the position.
privatevoidbuttonXCursor_Click(objectsender,EventArgse)
{
try
{
ScopeViewControlCursornewCursor=scopeViewControl1.Charts[0].CursorModule.NewCursor(false);
newCursor.ChannelValuesChanged+=newSystem.EventHandler(this.resfreshX);
newCursor.StatusTimesChanged+=newSystem.EventHandler(this.timeRefreshX);
newCursor.Selected+=newSystem.EventHandler(this.actCursorRefresh);
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);
setXDeltaView();
}
catch(Exception){}
}
privatevoidbuttonYCursor_Click(objectsender,EventArgse)
{
try
{
ScopeViewControlCursornewCursor=scopeViewControl1.Charts[0].CursorModule.NewCursor(true);
newCursor.AxesValuesChanged+=newSystem.EventHandler(this.resfreshY);
newCursor.Selected+=newSystem.EventHandler(this.actCursorRefresh);

92

Version: 1.2

TwinCAT 3 Scope View

.NET API
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;
setYDeltaView();
}
catch(Exception){}
}

5.1.3.3

Delete cursor

The method CurserModule.DeleteCursor() deletes the cursor that was transferred to it from the list.
The cursor data in the table are then updated.
The table with the cursor data is then revised. First, the cursor is deleted from the table. Then, the method
for updating the delta values is called.
privatevoidbuttonDeleteXC_Click(objectsender,EventArgse)
{
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){}
}
privatevoidbutteonDeleteYC_Click(objectsender,EventArgse)
{
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.4

Delta values

To ensure that the display of the delta values matches the edited cursor, all old delta values are deleted first.
All new delta values are then calculated and added to the table.
Note that X-cursors have several values, if there are several channels. Therefore, all channel values should
be double-checked for this cursor. This is not necessary for Y-cursors, since they only have the position.
The values are updated under events. This procedure is created under Update values.
privatevoidsetXDeltaView()
{
//deleteoldvalues
while(scopeViewControl1.Charts[0].CursorModule.XCursor.Count!=dataGridView1.Rows.Count)
{
dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count-1);
}
//setnewvalues
for(inti=0;i<scopeViewControl1.Charts[0].CursorModule.XCursor.Count;i++)
{
for(intk=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(inth=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(dataGridView1[h,k].Value);
}
}
}

TwinCAT 3 Scope View

Version: 1.2

93

.NET API
}
}
privatevoidsetYDeltaView()
{
//deleteoldvalues
while(scopeViewControl1.Charts[0].CursorModule.YCursor.Count!=dataGridView2.Rows.Count)
{
dataGridView2.Rows.RemoveAt(dataGridView2.Rows.Count-1);
}
//addnewvalues
for(inti=0;i<scopeViewControl1.Charts[0].CursorModule.YCursor.Count;i++)
{
for(intk=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(dataGridView2[1,k].Value));
}
}
}

5.1.3.5

Update values

Since these methods are called through events, the cursors are included in the parameters.
This enables the 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.
Please note that the values in each cell should be edited individually, rather than deleting and regenerating
the row, since this would have a negative impact on the performance. The interface would start to flicker,
because the program is unable to update the values fast enough.
Here too, please note that the X-cursor can have several channels (unlike the Y-cursor).
Since the time may also change with the X-cursor, a further method is available for updating the time. This
method works like the functions described above; only the time rows are addressed.
privatevoidresfreshX(objectsender,EventArgse)
{
try
{
ScopeViewControlCursortmpCursor=(ScopeViewControlCursor)sender;
//setnewchannelvalue
for(intk=0;k<scopeViewControl1.Charts[0].CursorModule.XCursor.Count;k++)
{
if(scopeViewControl1.Charts[0].CursorModule.XCursor[k]==tmpCursor)
{
for(intj=0;j<tmpCursor.ChannelValues.Count;j++)
{
dataGridView1[j+2,k].Value=tmpCursor.ChannelValues[j];
}
break;
}
}
//refreshalldeltavalues
intm=scopeViewControl1.Charts[0].CursorModule.XCursor.Count;
for(inti=0;i<scopeViewControl1.Charts[0].CursorModule.XCursor.Count;i++)
{
for(intk=i+1;k<scopeViewControl1.Charts[0].CursorModule.XCursor.Count;k++)
{
for(inth=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){}
}

94

Version: 1.2

TwinCAT 3 Scope View

.NET API
privatevoidresfreshY(objectsender,EventArgse)
{
try
{
ScopeViewControlCursortmpCursor=(ScopeViewControlCursor)sender;
//setnewaxesvalue
for(inti=0;i<dataGridView2.Rows.Count;i++)
{
if(dataGridView2[0,i].Value.ToString()==tmpCursor.Style.Name)
{
dataGridView2[1,i].Value=tmpCursor.AxesValues[0].ToString();
break;
}
}
//refreshalldeltavalues
intm=scopeViewControl1.Charts[0].CursorModule.YCursor.Count;
for(inti=0;i<scopeViewControl1.Charts[0].CursorModule.YCursor.Count;i++)
{
for(intk=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){}
}
privatevoidtimeRefreshX(objectsender,EventArgse)
{
//refreshthecursortime
for(inti=0;i<scopeViewControl1.Charts[0].CursorModule.XCursor.Count;i++)
{
dataGridView1[0,i].Value=scopeViewControl1.Charts[0].CursorModule.XCursor[i].StatusTimes.ChartPositionTime.ToString();
}
//refreshthedeltatime
intm=scopeViewControl1.Charts[0].CursorModule.XCursor.Count;
for(inti=0;i<scopeViewControl1.Charts[0].CursorModule.XCursor.Count;i++)
{
for(intk=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.6

Control cursor via the keyboard

When the cursor is moved via the keyboard, only the cursor selected last is moved. This is always the cursor
that is selected in the interface.
The KeyDown event of the form is used for this. This event is always triggered when a key is pressed. The
value of the pressed key can be found in the parameter of type KeyEventArgs under the property KeyCode.
This value can then be compared with the expected values.
Use the method MoveCursor(int) to move the cursor. The parameter indicates how far the cursor moves. If a
positive number is entered, the cursor is moved to the positive part, with a negative number it is moved to
the negative part.
The method is called directly on a cursor. This can be found in the CursorModule, as described above. The
position of the cursor in the CursorModule is shown in the selected table cell.
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 method specified below. The cursor is
transferred in the first parameter.
TwinCAT 3 Scope View

Version: 1.2

95

.NET API
First, the Style.Orientation property of the cursor is checked to ascertain whether the cursor is an X-cursor
or Y-cursor. The cursor is then located in the cursor module. The system counts the cursor position in the
cursor module, so that the corresponding table row can be selected.
privatevoidForm1_KeyDown(objectsender,KeyEventArgse)
{
if(e.KeyCode==Keys.D)
{
try
{
scopeViewControl1.Charts[0].CursorModule.XCursor[dataGridView1.SelectedCells[0].RowIndex].MoveCursor(5);
}
catch(Exception)
{
MessageBox.Show("ThereisnoX-Axistomove!");
}
}
elseif(e.KeyCode==Keys.A)
{
try
{
scopeViewControl1.Charts[0].CursorModule.XCursor[dataGridView1.SelectedCells[0].RowIndex].MoveCursor(-5);
}
catch(Exception)
{
MessageBox.Show("ThereisnoX-Axistomove!");
}
}
elseif(e.KeyCode==Keys.W)
{
try
{
scopeViewControl1.Charts[0].CursorModule.YCursor[dataGridView2.SelectedCells[0].RowIndex].MoveCursor(5);
}
catch(Exception)
{
MessageBox.Show("ThereisnoY-Axistomove!");
}
}
elseif(e.KeyCode==Keys.S)
{
try
{
scopeViewControl1.Charts[0].CursorModule.YCursor[dataGridView2.SelectedCells[0].RowIndex].MoveCursor(-5);
}
catch(Exception)
{
MessageBox.Show("ThereisnoY-Axistomove!");
}
}
}
privatevoidactCursorRefresh(objectsender,EventArgse)
{
ScopeViewControlCursortmpCursor=(ScopeViewControlCursor)sender;
if(tmpCursor.Style.Orientation==TwinCAT.Scope2.Charting.ChartingBase.CursorDirection.Vertical)
{
for(inti=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(inti=0;i<scopeViewControl1.Charts[0].CursorModule.YCursor.Count;i++)
{
if(tmpCursor==scopeViewControl1.Charts[0].CursorModule.YCursor[i])
{
dataGridView2.ClearSelection();

96

Version: 1.2

TwinCAT 3 Scope View

.NET API
dataGridView2[0,i].Selected=true;
}
}
}
}

5.1.4

Sample Scope Export

The 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 the
export.
The ScopeViewControl requires .NET Framework 4.0.
The ".NET Framework 4 Client Profile" is not supported.
This application is 32-bit-based.
Note

Installation of the .NET Framework 4.0


1. 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: http://infosys.beckhoff.com/content/1033/
TE13xx_TC3_ScopeView/Resources/zip/2282223499.zip
The variables refer to the TwinCAT program behind the following file: http://infosys.beckhoff.com/
content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282225419.zip

5.1.4.1

C# Scope Export

The 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 the
export.

TwinCAT 3 Scope View

Version: 1.2

97

.NET API
The ScopeViewControl requires .NET Framework 4.0.
The ".NET Framework 4 Client Profile" is not supported.
This application is 32-bit-based.
Note

Installation of the .NET Framework 4.0


1. 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: http://infosys.beckhoff.com/content/1033/
TE13xx_TC3_ScopeView/Resources/zip/2282223499.zip
The variables refer to the TwinCAT program behind the following file: http://infosys.beckhoff.com/
content/1033/TE13xx_TC3_ScopeView/Resources/zip/2282225419.zip

5.1.4.2

Export

The system first checks whether both paths were specified correctly.
The configuration file (.svd file) is then loaded in a ScopeViewControl. Unlike in the other samples, this is not
used 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 string
containing the file format is formed. The file extension is first checked for all possible file formats available for
export. Once the required format has been found, the respective export method is called on the
ScopeViewControl instance. The target path for the new file is transferred to the method as a parameter.
The configuration should then be separated from the control with the method DisConnect(true), and the
chart should be deleted with the method DeleteChart().
staticStringsvdFile,destination;
ScopeViewControlcontrol=newScopeViewControl();
privatevoidexport_button_Click(objectsender,EventArgse)
{
svdFile=@textBox_SVD.Text;
destination=@textBox_Export.Text;
try
{
//Checkingtheexistensofthepath
if(destination==null)
destination=Environment.CurrentDirectory;
if(string.IsNullOrEmpty(svdFile)||!File.Exists(svdFile))
{
Console.Write("SVDFilecouldnotbefound.");
}
else
{
control.LoadScopeConfig(svdFile);
}
if(string.IsNullOrEmpty(destination))
{
Console.Write("Nodestinationfiledefined.");
}
else
{
//searchtheMethodwiththerightexport
FileInfofInfo=newFileInfo(destination);
stringformat=fInfo.Extension;
if(format.Equals(ScopeViewControl.socpeExportTdmsExtention))
{
control.Operating.ExportDataToTDMS(destination);
}
elseif(format.Equals(ScopeViewControl.ScopeExportCSVExtension)||format.Equals(ScopeViewControl.ScopeExportTXTExtension))

98

Version: 1.2

TwinCAT 3 Scope View

.NET API
{
control.Operating.ExportData(destination);
}
elseif(format.Equals(ScopeViewControl.ScopeExportBinaryExtention))
{
control.Operating.ExportDataBinary(destination);
}
elseif(format.Equals(ScopeViewControl.ScopeExportDatExtention))
{
control.Operating.ExportDataToDat(destination);
}
else
{
Console.Write("Unknownformat.");
}
}
//Disconnectthe.svdFile
control.Operating.DisConnect(true);
control.DeleteChart(control.Charts[0]);
}
catch(Exceptionex)
{
Console.Write(ex.ToString());
Console.ReadLine();
control.Operating.DisConnect(true);
}
}

5.2

Integration in a WPF (Windows Presentation


Foundation) project

In order to use the ScopeViewControl within WPF applications as well, you require a WindowsFormsHost as
a the basis, since the ScopeViewControl is a Windows Forms UserControl.
1. Position a WindowsFormsHost control from the toolbar in the interface of the WPF application you
created.
2. Initialize the ScopeViewControl as described in the Windows Forms examples, and add the created
ScopeViewControl to the WindowsFormsHost. When using the ScopeViewControl within the WPF
application, only the "ScopeViewControl.Operating.SupportWpfRefresh" property needs to be set.
An exemplary implementation would then look like the following:
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 Documentation

The attached class library offers an extensive source of information for developers who work with the
technologies and services of TwinCAT Scope. Amongst other things, the library contains instructions and
reference documents as well as example codes.

TwinCAT 3 Scope View

Version: 1.2

99

.NET API

Fig.1: ScopeViewControl_API
In order to find the desired contents, navigate through the table of contents, use the search function or switch
to 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 the
keyword "examples".
In the search results you will find example codes for the trigger modules, cursor and many more.
Class library documentation

100

Version: 1.2

TwinCAT 3 Scope View

Samples

Samples

6.1

TwinCAT 3 Scope View first steps

In order to allow a fast startup and to simplify work with the TwinCAT 3 Scope software oscilloscope, the first
steps are briefly described on this page. We have consciously avoided dealing with every detail. For
example, 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. Conversely, the Scope component
installation can also install the Server without View on a target device.
2. Licensing:
Regardless of whether the Scope View was installed by its own setup or by the TwinCAT 3 XAE setup, the
initially activated license is "Base" for View and Server. You can find out here [}6] which functions are
enabled with which licence key.
3. New project:
The Scope View can be selected under Beckhoff in the Windows Start Menu.

The Visual Studio opens in its shell or in a full version if installed. You can choose between various
templates.

TwinCAT 3 Scope View

Version: 1.2

101

Samples

In the Solution Explorer the starting point for the new Scope configuration assembles itself automatically.

4. Selection of channels:
Variables or channels now have to be added to the generated configuration. These can be selected via the
target browser. When using for the first time it is possible that this will not be directly visible as a window in
Visual Studio. The target browser can be selected in the context menu with a right-click on the Scope node.

102

Version: 1.2

TwinCAT 3 Scope View

Samples

Alternatively the target browser can also be selected via the Scope menu in Visual Studio. Once the target
browser has opened, the window can be docked in any position in the user interface. It is possible to select
the desired variables by browsing into the respective target system.

The variables can be selected by multi-select and added to the configuration by right-clicking on "Add
symbol" or by drag & drop.

TwinCAT 3 Scope View

Version: 1.2

103

Samples

The selected channels are assigned to the last-selected axis. In this case only one axis is present.

5. Recording:
Prior to a recording the basic recording settings must be made in the Scope Properties. Standard is a tenminute recording which is started manually and automatically stopped after the respective time. The settings
for all hierarchical levels Scope, Charts, Axis and Channel as well as for trigger and cursor can be made
in the standard Property window of Visual Studio. A simple click on the corresponding element in the
Solution Explorer is sufficient, provided that the Property window has already been opened first under View
in Visual Studio.

104

Version: 1.2

TwinCAT 3 Scope View

Samples

If the standard settings are left as they are, the recording can be started. To this end the Scope toolbar must
be opened when using for the first time.
In Visual Studio > View Toolbars > TwinCAT Measurement.

The recording is started by clicking on the icon with the red recording symbol.

TwinCAT 3 Scope View

Version: 1.2

105

Samples

6. During the recording:


In order to improve the display of the channels in the View, charts and axes can be added even during the
recording in TwinCAT 3 Scope View and channels can be shifted within the Scope.

106

Version: 1.2

TwinCAT 3 Scope View

Samples

X and Y cursors can also be added and deleted at runtime.

TwinCAT 3 Scope View

Version: 1.2

107

Samples
An important feature is the option to pause the display of the current recording while data logging continues
in the background. If the display is stopped, the user can take time to zoom into the data and analyse the
signal curve with the cursor.

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 of course be ended manually
at any time via the stop button in the Scope toolbar. The recorded data are only consistent if they are stored
as a .svd file. Click on the Scope menu in Visual Studio and select Save Data.

108

Version: 1.2

TwinCAT 3 Scope View

Samples

TwinCAT 3 Scope View

Version: 1.2

109

Appendix

Appendix

7.1

FAQ - frequently asked questions and answers

In this section frequently asked questions are answered in order to make your work with TwinCAT 3 Scope
easier.
If you have any further questions, contact please our Support (- 157)
1. Is it true that "TC3 Scope" in the TwinCAT 3 world is not a product, but a generic term for various
products?
2. Why are there different product levels for the TC3 Scope?
3. Can the Scope View Professional be operated with the Scope Server Base? What are the restrictions?
4. What do you need a TF3300 Scope Server for, when you can also switch on the Use local server
option?
5. Can the TwinCAT Scope View be integrated into its own visualization?
6. Is it possible to print out recorded Scope Charts?
7. Is multimedia documentation available for TwinCAT 3 Scope?
8. My Scope .svd files are on a network drive. Why can't I open them?
? Is it true that "TC3 Scope" in the TwinCAT 3 world is not a product, but a generic term for various
products?
! Yes, "TC3 Scope" is a generic term. The TC3 Scope is subdivided into the Scope View and Scope Server
products. This means that a TC3 Scope always consists of the View and Server products. Beyond that there
are also different product levels.
? Why are there different product levels for the TC3 Scope?
! The Scope is a constantly growing tool for data recording and analysis; however, not every Scope user
requires the full range of functions for his purposes. Therefore we offer product levels tailored as far as
possible to the application. The currently available product levels are Base and Professional. Base is free of
license costs and is an outstanding tool for machine commissioning. Professional is very well suited for
process monitoring in addition to machine commissioning.
? Can the Scope View Professional be operated with the Scope Server Base? What are the
restrictions?
! Yes, Professional View can also be operated with the Base Server. Only the limitations of the Base Server
version need to be observed. It is also possible, for example, to scope a remote device with the local Base
Server. 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 run
autonomously on a remote device. The server can thus be controlled, for example from the PLC, without a
View being connected.
? Can the TwinCAT Scope View be integrated into its own visualization?
! Yes, the Scope Control can be integrated into its own .NET-based visualization application. The license
model remains identical. Details and examples can be found here.
? 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, fringe
data shown by the cursor, such as channel name, axis name or values, are displayed and added to the
printout. You can find out more here.

110

Version: 1.2

TwinCAT 3 Scope View

Appendix
? Is multimedia documentation available for TwinCAT 3 Scope?
! Yes, there is a recording of a TwinCAT 3 Scope Webinar on the Beckhoff Homepage.
? 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 network
directory. In order to be able to open .svd files, you either need to copy them to the local system or grant the
Scope server service the appropriate rights [}116].

TwinCAT 3 Scope View

Version: 1.2

111

Appendix

7.2

TwinCAT Scope Glossary

Term
Scope

Scope Server

Scope View

YT Chart

Overview Chart

XY Chart

Array Bar Chart

Axis
Channel

Data Picker

Target Browser

Solution Explorer

Measurement Project

Cursor
Marks

Trigger
Quick View Chart

112

Description
The Scope forms the highest hierarchical element in
a Scope configuration and manages all recording
settings.
The Scope Server is the logger program of the
TwinCAT Scope. A Scope connects itself to a server
in order to record new data or to read an existing file
(.svd).
The Scope View is the front end of the TwinCAT
Scope. From here configurations are created or
loaded, the display adjusted and recordings
controlled.
The chart provides a graphic area with time axis. All
connected channels are scaled to the same time
segment.
An Overview chart can be displayed within a YT
chart. It provides an overview of the whole recording
period with absolute times.
The chart provides a drawing area for a channel that
is calculated from two variables. One variable is
shown on the X-axis, the other one on the Y-axis.
The chart provides the drawing interface for an array
data type, the elements of which are assigned to a
bar line or a bar.
A (Y-) axis represents the value scaling for connected
channels.
The channel forms the connection of system variable
and graph. Therefore, there is one setting window for
the acquisition and another one for the general
settings (colors, marks etc.).
This is a mouse pointer tool that is automatically
activated in the chart when the cursor runs over a
data point. Clicking brings up a tool tip showing the
values of the X- and Y-axes, the channel name and
the absolute time for the selected data point.
All connected systems and their devices can be
simply scanned for system variables with the target
browser.
The Solution Explorer is a kind of project manager,
among other things for the measurement projects,
which are necessary for a Scope recording.
The measurement project can contain several Scope
projects in which the actual recording configurations
are created.
The cursor module serves to display graph and axis
values and their differences.
Marks are the actual data points of recorded
variables. They can be adjusted via the channel
properties.
Various actions can be triggered with freely
configurable trigger groups.
The Quick View chart is available in the Target
Browser. It can be used to provide a quick overview
of the current value status before the configuration is
complete.

Version: 1.2

TwinCAT 3 Scope View

Appendix

7.3

How To's

7.3.1

Oversampling recordings with the TwinCAT 3 Scope

With the TwinCAT 3 Scope it is possible to represent oversampling values in a single variable. Since n
values (n = oversampling factor) are recorded for each cycle when oversampling, the TwinCAT System
Manager generates an ADS symbol containing a time stamp for each individual value. If you connect to this
ADS symbol with the Scope, then the Scope performs all further settings in order to represent the n values in
a chronologically correct order.
So that the ADS symbol is created and can be directly scoped by an EtherCAT terminal (e.g. EL3702 or
EL3632), some settings need to be made in the TwinCAT System Manager configuration:
The Create Symbols option must be switched on and the ADS server must be activated on the ADS tab in
the EtherCAT process image. The assigned ADS port has to be specified later in the Scope in order to find
the ADS symbols.

The desired oversampling factor should be set in the TwinCAT System Manager for the respective
oversampling terminal before the configuration is activated.

TwinCAT 3 Scope View

Version: 1.2

113

Appendix

If the configuration has been loaded successfully and TwinCAT is in Run mode, you can switch to the
TwinCAT 3 Scope. The server settings must be called in the target browser of the Scope. The ADS port
number assigned by the TwinCAT System Manager must be entered in the appropriate dialog and added
with the Add button, assuming that the port has not already been entered beforehand.

114

Version: 1.2

TwinCAT 3 Scope View

Appendix

Now AdsPort of Image X (27905) should appear in the Scopes target browser. Via this new entry you can
browse to the EtherCAT terminals and thus to the desired oversampling terminal. In the oversampling
terminal, the variable marked in red with the suffix [T20] should be selected for the scope recording (20
stands in this case for 20-fold oversampling; this number can vary according to the oversampling factor).

TwinCAT 3 Scope View

Version: 1.2

115

Appendix

The INT16 variable can now be recorded directly in the TwinCAT Scope. In the following screenshot 20-fold
oversampling with a cycle time of 1ms.

7.3.2

Opening .svd files from a network directory

If a .svd file from the network is to be merged into the solution, the following error message will probably
appear if appropriate preparations are not made.

116

Version: 1.2

TwinCAT 3 Scope View

Appendix

An unknown Error occured. Error handling .svd file within scope server. Enable and check scope server
tracing.
One of the following entries will then usually be found in the server tracing log:
"ScopeServerTraceSource",Error,8442,"Access to the path '\\remote-PC\SVDs\test.svd' is
denied.",,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 3 Scope server service has no rights of access to the network
directory.
In order to grant the TwinCAT Scope server the necessary rights, please proceed as follows (using
Windows 7 as an example):
1. Right-click on the directory to be shared -> Properties -> Sharing tab -> Share
2. Enter the users who are to gain access to the directory. The Read permission level is sufficient for the
Scope server access and for the display of the .svd file.

3. Click on the Windows button + R -> services.msc -> TwinCAT3 Scope Server -> Log on ->

TwinCAT 3 Scope View

Version: 1.2

117

Appendix
4. Enter the account with which you have rights of access to the network directory.

5. Pay attention if applicable to the correct use of your server domain.


6. 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.

118

Version: 1.2

TwinCAT 3 Scope View

Das könnte Ihnen auch gefallen