NI-DMM C Function Reference Help

niDMM_GetErrorMessage

  • Updated2023-02-21
  • 1 minute(s) read

ViStatus = niDMM_GetErrorMessage (ViSession Instrument_Handle, ViStatus Error_Code, ViInt32 Buffer_Size, ViChar Error_Message[])

Purpose

Returns the Error_Message as a user-readable string for the provided Error_Code. Calling this function with a Buffer_Size of 0 returns the size needed for the Error_Message.

Parameters

Input
Name Type Description
Instrument_Handle ViSession Identifies a particular instrument session. You obtain the Instrument_Handle parameter from niDMM_init or niDMM_InitWithOptions. You can also use VI_NULL if you do not have a valid Instrument_Handle.
Error_Code ViStatus The error code returned from the instrument for which you want to get a user-readable string.
Buffer_Size ViInt32 Specifies the number of bytes allocated for the Error_Message ViChar array. If the error description that this function returns (including terminating NULL byte) is larger than you indicated in Buffer_Size, the error description will be truncated to fit. If you pass 0 for Buffer_Size, the function returns the buffer size needed for Error_Message.
Output
Name Type Description
Error_Message ViChar[] Contains the error information formatted into a user-readable string. The buffer must contain at least as many elements as the value you specify with the Buffer_Size parameter. If you pass 0 for Buffer_Size, you can pass VI_NULL for this parameter.

Return Value

Name Type Description
Status ViStatus Reports the Status of this operation. If the Buffer_Size parameter is 0, the buffer size needed for Error_Message is returned.

Log in to get a better experience