# Amplifier Diagnostics

## Functions
DLLEXPORT TECELLA_ERRNUM CALL | tecella_system_monitor_run (TECELLA_HNDL h, int *result_count, int *results_per_controller, int *results_per_slot)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_system_monitor_get (TECELLA_HNDL h, int result_index, TECELLA_SYSTEM_MONITOR_RESULT *result)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_system_monitor_dynamic_set (TECELLA_HNDL h, int monitor_index)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_diagnostics_run (TECELLA_HNDL h, int *pass_count, int *fail_count)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_diagnostics_get_pass (TECELLA_HNDL h, int pass_index, const wchar_t **msg)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_diagnostics_get_failure (TECELLA_HNDL h, int fail_index, const wchar_t **msg)

## Detailed Description

All Tecella amplifiers are equiped with a system monitor feature that helps monitor the amplifier's health by measuring various voltages of the system. To use this feature, call the tecella_system_monitor_run() function followed by muliple calls to tecella_system_monitor_get().

Various other diagnostics functions are no longer supported and are marked deprecated in the documentation.

## Function Documentation

DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_get_failure | ( | TECELLA_HNDL | h,
|  | int | fail_index,
|  | const wchar_t ** | msg |
| ) |  |  |

Returns messages of failed tests after running tecella_diagnostics_run().

Deprecated:
  Do not use this function.

Parameters:

  | h | A handle to an initialized device.
  | fail_index | An index in the range [0,fail_count), as returned by tecella_diagnostics_run().
  | msg | A return argument for the null-terminated text of the failure. Pointer remains valid until the next call to tecella_diagnostics_run() with the same handle.

DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_get_pass | ( | TECELLA_HNDL | h,
|  | int | pass_index,
|  | const wchar_t ** | msg |
| ) |  |  |

Returns messages of passing tests after running tecella_diagnostics_run().

Deprecated:
  Do not use this function.

Parameters:

  | h | A handle to an initialized device.
  | pass_index | An index in the range [0,pass_count), as returned by tecella_diagnostics_run().
  | msg | A return argument for the null-terminated text describing the test. Pointer remains valid until the next call to tecella_diagnostics_run() with the same handle.

DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_run | ( | TECELLA_HNDL | h,
|  | int * | pass_count,
|  | int * | fail_count |
| ) |  |  |

Performs hardware diagnostics / sanity checks to make sure hardware is functional. To get actual warning/error messages, call tecella_diagnostics_run_get_pass() or tecella_diagnostics_get_failure().

Deprecated:
  Do not use this function.

Parameters:

  | h | A handle to an initialized device.
  | pass_count | A return argument for the number of warnings reported.
  | fail_count | A return argument for the number of errors reported.

DLLEXPORT TECELLA_ERRNUM CALL tecella_system_monitor_dynamic_set | ( | TECELLA_HNDL | h,
|  | int | monitor_index |
| ) |  |  |

Tells the dynamic monitor which point to monitor. Dynamic monitor is when one of the channels records a monitor point at the same sampling rate as all the other channels during acquisition.

Deprecated:
  Do not use this function.

Parameters:

  | h | A handle to an initialized device.
  | monitor_index | Indicates which point to monitor.

DLLEXPORT TECELLA_ERRNUM CALL tecella_system_monitor_get | ( | TECELLA_HNDL | h,
|  | int | result_index,
|  | TECELLA_SYSTEM_MONITOR_RESULT * | result |
| ) |  |  |

Retreives results from the most recent call to tecella_system_monitor_run(). Cannot be used during acquisition.

Parameters:

  | h | A handle to an initialized device.
  | result_index | An index to a result between 0 and result_count as returned by tecella_system_monitor_run.
  | result | A pointer to a TECELLA_SYSTEM_MONITOR_RESULT structure that will contain the result on return.

DLLEXPORT TECELLA_ERRNUM CALL tecella_system_monitor_run | ( | TECELLA_HNDL | h,
|  | int * | result_count,
|  | int * | results_per_controller,
|  | int * | results_per_slot |
| ) |  |  |

Runs a quick tests on the system, such as system voltage and power measurments. Retreive results by using tecella_system_monitor_get(). Cannot be used during acquisition.

Parameters:

  | h | A handle to an initialized device.
  | result_count | A pointer to an int that will hold how many results can be retreived by calling tecella_system_monitor_get().
  | results_per_controller | A helper variable that indicates how many results will belong to the controller board.
  | results_per_slot | A helper variable that indicates how many results will belong to each daughter board. If 0, there are not daughter boards.