Documentation

xPCScope Class

Access Simulink Real-Time scopes

Syntax

public abstract class xPCScope : xPCApplicationNotficationObject

Description

Namespace: MathWorks.xPCTarget.FrameWork

Syntax Language: C#

public abstract class xPCScope : xPCApplicationNotficationObject initializes a new instance of the xPCScope class.

Methods

MethodDescription
xPCScope.StartStart scope
xPCScope.StopStop scope
xPCScope.TriggerSoftware-trigger start of data acquisition for scopes

Events

EventDescription
xPCScope.ScopeStartedEvent after xPCScope.Start is complete
xPCScope.ScopeStartingEvent before xPCScope.Start executes
xPCScope.ScopeStoppedEvent after xPCScope.Stop is complete
xPCScope.ScopeStoppingEvent before xPCScope.Stop executes

Properties

PropertyC# Declaration SyntaxDescriptionException

Decimation

public int Decimation {get; set;}

Get or set a number n, where every nth sample is acquired in a scope window.

xPCException — When problem occurs, query xPCException object Reason property.

NumPrePostSamples

public int NumPrePostSamples {get; set;}

Get or set number of samples collected before or after a trigger event. The default value is 0. Entering a negative value collects samples before the trigger event. Entering a positive value collects samples after the trigger event. If you set TriggerMode to 'FreeRun', changing this property does not change data acquisition.

xPCException — When problem occurs, query xPCException object Reason property.

NumSamples

public int NumSamples {get; set;}

Get or set number of contiguous samples captured during the acquisition of a data package. The scope writes data samples into a memory buffer of size NumSamples.

If the scope stops before capturing this number of samples, the scope has the collected data up to the end of data collection. It then has zeroes for the remaining uncollected data. Note what type of data you are collecting, it is possible that your data contains zeroes.

xPCException — When problem occurs, query xPCException object Reason property.

ScopeId

public int ScopeId {get;}

A numeric index, unique for each scope.

 

Status

public SCSTATUS Status {get;}

Indicate whether data is being acquired, the scope is waiting for a trigger, the scope has been stopped (interrupted), or acquisition is finished. Values are 'Acquiring', 'Ready for being Triggered', 'Interrupted', and 'Finished'.

xPCException — When problem occurs, query xPCException object Reason property.

TriggerAnySignal

public int TriggerAnySignal {get; set;}

Get or set xPCSignal Class object for trigger signal. If TriggerMode is 'Signal', this signal triggers the scope even if it was not added to the scope.

xPCException — When problem occurs, query xPCException object Reason property.

TriggerLevel

public double TriggerLevel {get; set;}

Get or set trigger level. If TriggerMode is 'Signal', TriggerLevelindicates the value the signal has to cross to trigger the scope and start acquiring data. You can cross the trigger level with either a rising or falling signal.

xPCException — When problem occurs, query xPCException object Reason property.

TriggerMode

public SCTRIGGERMODE TriggerMode {get; set;}

Get or set trigger mode for a scope. Valid values are 'FreeRun' (default), 'Software', 'Signal', and 'Scope'.

xPCException — When problem occurs, query xPCException object Reason property.

TriggerScope

public int TriggerScope {get; set;}

If TriggerMode is 'Scope', TriggerScope identifies the scope to use for a trigger. You can set a scope to trigger when another scope is triggered. You do this operation by setting the slave scope property TriggerScope to the scope index of the master scope.

xPCException — When problem occurs, query xPCException object Reason property.

TriggerScopeSample

public int TriggerScopeSample {get; set;}

If TriggerMode is 'Scope', TriggerScopeSample specifies the number of samples the triggering scope is to acquire before triggering a second scope. This value must be nonnegative.

xPCException — When problem occurs, query xPCException object Reason property.

TriggerSlope

public TRIGGERSLOPE {get; set;}

If TriggerMode is 'Signal', indicates whether the trigger is on a rising or falling signal. Values are of type SLTRIGGERSLOPE: SLTRIGGERSLOPE.EITHER (default), SLTRIGGERSLOPE.RISING, and SLTRIGGERSLOPE.FALLING.

This property returns the value SCTRIGGERSLOPE.

xPCException — When problem occurs, query xPCException object Reason property.

Type

public string Type {get;}

Get scope type as a character string.

 

For file scopes, the NumSamples parameter works with the autorestart parameter.

  • Autorestart is on — When the scope triggers, the scope starts collecting data into a memory buffer. A background task examines the buffer and writes data to the disk continuously, appending new data to the end of the file. When the scope reaches the number of samples that you specified, it starts collecting data again, overwriting the memory buffer. If the background task cannot keep pace with data collection, data can be lost.

  • Autorestart is off — When the scope triggers, the scope starts collecting data into a memory buffer. It stops when it has collected the number of samples that you specified. A background task examines the buffer and writes data to the disk continuously, appending the new data to the end of the file.

Introduced in R2011b

Was this topic helpful?