Documentation

xPCGetStateLog

Copy state log values to array

Prototype

void xPCGetStateLog(int port, int first_sample, int num_samples,
int decimation, int state_id, double *state_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

Select whether to copy all the sample values or every Nth value.

state_id

Enter a state identification number.

state_data

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

Description

The xPCGetStateLog function gets the state log. It then copies the log into state_data. You get the data for each state signal in turn by specifying the state_id. State IDs range from 1 to (N-1), where N is the return value of xPCGetNumStates. 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. Use the xPCNumLogSamples function to get the maximum number of samples.

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

Introduced before R2006a

Was this topic helpful?