Documentation

xPCScGetData

Copy scope data to array

Prototype

void xPCScGetData(int port, int scNum, int signal_id, int start,  
int numsamples, int decimation, double *data);

Arguments

port

Enter the value returned by the function xPCOpenTcpIpPort.

scNum

Enter the scope number.

signal_id

Enter a signal number. Enter -1 to get timestamped data.

start

Enter the first sample from which data retrieval is to start.

numsamples

Enter the number of samples retrieved with a decimation of decimation, starting from the start value.

decimation

Enter a value such that every decimation sample is retrieved in a scope window.

data

The data is available in the array data, starting from sample start.

Description

The xPCScGetData function gets the data used in a scope. Use this function for scopes of type SCTYPE_HOST. The scope must be either in state "Finished" or in state "Interrupted" for the data to be retrievable. (Use the xPCScGetState function to check the state of the scope.) The data must be retrieved one signal at a time. The calling function must allocate the space ahead of time to store the scope data. data must be an array of doubles, regardless of the data type of the signal to be retrieved. Use the function xPCScGetSignals to get the list of signals in the scope for signal_id. Use the function xPCGetScope to get the scope number for scNum.

To get timestamped data, specify -1 for signal_id. From the output, you can then get the number of nonzero elements.

Introduced before R2006a

Was this topic helpful?