Documentation

scopedata

Type definition for scope data structure

Syntax

typedef struct {
   int    number;
   int    type;
   int    state;
   int    signals[20];
   int    numsamples;
   int    decimation;
   int    triggermode;
   int    numprepostsamples;
   int    triggersignal
   int    triggerscope;
   int    triggerscopesample;
   double triggerlevel;
   int    triggerslope;
} scopedata; 

Fields

number

The scope number.

type

Determines whether the scope is displayed on the development computer or on the target computer. Values are one of the following:

 

1

Host

 

2

Target

state

Indicates the scope state. Values are one of the following:

 

0

Waiting to start

 

1

Scope is waiting for a trigger

 

2

Data is being acquired

 

3

Acquisition is finished

 

4

Scope is stopped (interrupted)

 

5

Scope is preacquiring data

signals

List of signal indices from the target object to display on the scope.

Target scopes are restricted to 10 signals.

numsamples

Number of contiguous samples captured during the acquisition of a data package.

decimation

If 1, acquire every sample in a scope window. Otherwise, acquire every nth sample in a scope window.

triggermode

Trigger mode for a scope. Values are one of the following:

 

0

FreeRun (default)

 

1

Software

 

2

Signal

 

3

Scope

numprepostsamples

If this value is less than 0, numprepostsamples is the number of samples to be saved before a trigger event. If this value is greater than 0, numprepostsamples is the number of samples to skip after the trigger event before data acquisition begins.

triggersignal

If triggermode is 2 (Signal), triggersignal identifies the block output signal to use for triggering the scope. Identify the signal with a signal index.

triggerscope

If triggermode is 3 (Scope), triggerscope identifies the scope to use for a trigger. A scope can be set to trigger when another scope is triggered.

triggerscopesample

If triggermode is 3 (Scope), triggerscopesample specifies the number of samples to be acquired by the triggering scope before triggering a second scope. This value must be nonnegative.

triggerlevel

If triggermode is 2 (Signal), triggerlevel indicates the value the signal has to cross to trigger the scope to start acquiring data. The trigger level can be crossed with either a rising or falling signal.

triggerslope

If triggermode is 2 (Signal), indicates whether the trigger is on a rising or falling signal. Values are:

 

0

Either rising or falling (default)

 

1

Rising

 

2

Falling

Description

The scopedata structure holds the data about a scope used in the functions xPCGetScope and xPCSetScope. In the structure, the fields are as in the various xPCGetSc* functions. For example, state is as in xPCScGetState, signals is as in xPCScGetSignals. The signal vector is an array of the signal identifiers, terminated by -1.

Introduced before R2006a

Was this topic helpful?