Skip to main content
Open topic with navigation CAPL Functions » MOST » mostParamGet

mostParamGet

Valid for: CANoe DE

Function Syntax

double mostParamGet (mostAmsMessage msg, char paramAdr[]); // form 1
double mostParamGet (mostAmsMessage msg, char paramAdr[], long arrayIndex); // form 2

Description

Query of a parameter value from an AMS message using the parameter name from the XML function catalog. Suitable for parameter types ‘Number’, ‘Enum’, ‘BitField’ and ‘Bool’. Note: For parameters of type ‘Array’ or ‘Sequence’ the size (number of elements) of the parameter is retrieved. The array size cannot be determined, if the parameter ‘Pos’ selects only one array element. Example:
mostAmsMessage AudioDiskPlayer.MediaInfo.Status msg;
int arraySize;
mostParamSet(msg, "Pos", 0x0200); // second array element selected
arraySize = mostParamGet(msg, "Data"); // Return value '0'
Note: The message data must contain a parameter with the given parameter address. Since the compiler is not able to validate this, errors are detected at runtime of the CAPL program only. If the parameter is not part of the message or not the expected type, an error text is displayed in the Write Window and the measurement stops. The function mostParamIsAvailable can be applied to assure parameter availability.

Parameters

  • msg: Message from which the parameter value should be read.
  • paramAdr: Identification of parameters (see symbolic identification of parameters).
  • arrayIndex: Parameter index in arrays or sequences. This declaration overwrites the indexing in the brackets of <paramAdr>.

Return Values

Raw value of the parameter. No conversion formula is applied.

Example

mostParamIsAvailablemostParamGetDatamostParamGetStringmostParamSetmostParamSetDatamostParamSetStringGeneral Tips on XML Function Catalog Support in CAPLSymbolic Identification of Parameters