op_sim_error()

Abstract

Prints a specified error message, and optionally terminates the simulation.

Syntax

op_sim_error (gravity, line1, line2)
Argument Type Description
gravity OpT_Sim_Error_Gravity Severity of error (see Details section).
line1 const char * First line of error message, or OPC_NIL.
line2 const char * Second line of error message, or OPC_NIL.

Return Type

void

No return value.

Example

op_sim_error (OPC_SIM_ERROR_WARNING, "Error message line 1", "message line 2");

The preceding statement produces output similar to the following:

|-----------------------------------------------------------------------------|
| <<< Warning >>>                                                             |
| Error message line 1                                                        |
| message line 2				                                                              |
| T (0), EV (0), MOD (top.node_0.p_0), PROC (s52825 [st_0 enter execs])       |
|-----------------------------------------------------------------------------|

Details

The gravity argument must be one of:

  • OPC_SIM_ERROR_DIAGNOSTIC
  • OPC_SIM_ERROR_WARNING
  • OPC_SIM_ERROR_RECOVER
  • OPC_SIM_ERROR_ABORT

If gravity is OPC_SIM_ERROR_ABORT, this KP will end the simulation (similar to calling op_sim_end()).

Purpose

Provides a mechanism for printing a diagnostic error, warning, recoverable error, or program abort message of up to two lines. Each message is accompanied by the simulation time, event, module, and process in which the error was generated.

Errors

  • No errors are trapped.

Reference

  • None

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com