Documentation

xPCGetSignalLabel

Copy label of signal to character array

Prototype

char * xPCGetSignalLabel(int port, int sigIdx, char *sigLabel);

Arguments

port

Enter the value returned by the function xPCOpenTcpIpPort.

sigIdx

Enter signal index.

sigLabel

Return signal label associated with signal index, sigIdx.

Return

Returns the label of the signal.

Description

The xPCGetSignalLabel function copies and returns the signal label, including the block path, of a signal with sigIdx. The result is stored in sigLabel. If sigIdx is invalid, xPCGetLastError returns a nonzero value, and sigLabel is unchanged. The function returns sigLabel, which makes it convenient to use in a printf or similar statement. This function assumes that you already know the signal index. Signal labels must be unique.

This function assumes that you have labeled the signal for which you request the index (see the Signal name parameter of the Signal Properties Controls (Simulink)). The Simulink® Real-Time™ software refers to Simulink signal names as signal labels. The creator of the custom program already knows the signal name/label.

Introduced in R2007a

Was this topic helpful?