Documentation

xPCGetOutputLog

Copy output log data to array

Prototype

void xPCGetOutputLog(int port, int first_sample, int num_samples, 
int decimation, int output_id, double *output_data);

Arguments

port

Enter the value returned by the function xPCOpenTcpIpPort.

first_sample

Enter the index of the first sample to copy.

num_samples

Enter the number of samples that the function is to copy from the output log.

decimation

if 1, copy every sample value. Otherwise, copy every Nth sample value.

output_id

Enter an output identification number.

output_data

The log is stored in output_data, whose allocation is the responsibility of the caller.

Description

The xPCGetOutputLog function gets the output log and copies that log to an array. You get the data for each output signal in turn by specifying output_id. Output IDs range from 0 to (N-1), where N is the return value of xPCGetNumOutputs. Entering 1 for decimation copies all values. Entering N copies every Nth value.

For first_sample, the sample indices range from 0 to (N-1), where N is the return value of xPCNumLogSamples. Get the maximum number of samples by calling the function xPCNumLogSamples.

The real-time application must be stopped before you get the number.

Introduced before R2006a

Was this topic helpful?