mv_system_status.h File Reference

API function definitions for querying the vision system's status. More...

Functions

MVLibExport MVCode_t MV_GetSystemStatus (MVPlugin_t handle, MVSystemStatus_t *pStatus)
 Gets the current status of the vision system. More...
 
MVLibExport MVCode_t MV_SystemStatus_GetParameter (MVSystemStatus_t status, uint32_t parameter, MVValue_t *pValue)
 Gets a parameter value from the current status. More...
 
MVLibExport void MV_SystemStatus_Clear (MVSystemStatus_t *pStatus)
 Destroys a status. More...
 

Detailed Description

API function definitions for querying the vision system's status.

Function Documentation

◆ MV_GetSystemStatus()

MVLibExport MVCode_t MV_GetSystemStatus ( MVPlugin_t  handle,
MVSystemStatus_t pStatus 
)

Gets the current status of the vision system.

This function initializes a variable of type MVSystemStatus_t which may subsequently be queried using the MV_SystemStatus_GetParameter() function to obtain values for several parameters characterizing the current status of the vision system. This may be used to synchronize the plug-in's internal state to the vision system's state when the plug-in is started. This internal state can then be updated through the appropriate events (e.g., StateChanged, RecipePrepared, or JobStarted).

Remarks
Each call to MV_GetSystemStatus() has to be balanced by a call to MV_SystemStatus_Clear().
Parameters
[in]handleis the Communicator handle for the plug-in instance.
[out]pStatuspoints to the uninitialized handle which is initialized with the current status.
Returns
  • MV_CODE_OK The system status has been successfully retrieved and pStatus has been initialized with it.
  • MV_CODE_INV_HANDLE The provided plug-in handle is not valid.
  • MV_CODE_INV_VALUE The provided pointer pStatus is NULL.
  • MV_CODE_TIMEOUT The retrieval of the status from the vision system timed out. The vision system may not be running at all.
  • MV_CODE_PLUGIN_NOT_REGISTERED The plug-in is not currently registered. This indicates that MV_GetSystemStatus has been called from a self-spawned thread and outside of its allowed plug-in lifetime.
  • MV_CODE_OUT_OF_MEM The recipe list could not be stored because the system is out of memory.
  • MV_CODE_FAILED An unknown problem has occurred.

◆ MV_SystemStatus_Clear()

MVLibExport void MV_SystemStatus_Clear ( MVSystemStatus_t pStatus)

Destroys a status.

Each copy of a status obtained through using MV_GetSystemStatus() must be balanced by a call to MV_SystemStatus_Clear().

Parameters
[in,out]pStatuspoints to the handle to the status that is destroyed.

◆ MV_SystemStatus_GetParameter()

MVLibExport MVCode_t MV_SystemStatus_GetParameter ( MVSystemStatus_t  status,
uint32_t  parameter,
MVValue_t pValue 
)

Gets a parameter value from the current status.

Initializes a new MVValue_t with a copy of the requested parameter. It is the caller's responsibility to destroy this copy by way of MV_Value_Clear().

The following parameters are available (followed by the type of the correspondingly retrieved MVValue_t):

The recipe ID of the currently prepared recipe is only applicable if a recipe is currently prepared, i.e., in the Ready state or either one of *Execution states. Likewise, the job ID of the currently running job is only applicable during either SingleExecution or ContinuousExecution. If either of these is queried while not applicable, the function returns MV_CODE_INV_PARAM.

Parameters
[in]statusis the handle to the current status that is queried.
[in]parameteris one of the above MV_PARAM_* defines.
[out]pValuepoints to the value handle that is to be initialized with a copy of the value of the queried parameter.
Returns
  • MV_CODE_OK The value corresponding to the specified parameter key was successfully used to initialize the value pointed to by pValue.
  • MV_CODE_INV_HANDLE The provided status is not valid.
  • MV_CODE_INV_VALUE The pointer pValue is NULL.
  • MV_CODE_UNK_PARAM The provided parameter key does not match any of the parameters listed above.
  • MV_CODE_INV_PARAM The queried parameter is not applicable in the current vision state.