op_esys_interface_vector_get()

Abstract

Reads successive values from a vector interface and inserts them into a value vector.

Syntax

op_esys_interface_vector_get (interface, target, start_offset)
Argument Type Description
interface Esys_Interface esys interface ID of the vector interface to be read [The esys interface must be a vector interface. You can get the esys interface ID from several KPs in the Topo and Id packages, including op_topo_child() and op_id_from_name(), as well as op_intrpt_esys_interface().]
target Vvec_Vector value vector that is to receive the contents of the vector interface [The data types of the vector interface and the target value vector must match, and they must have the same dimension. The target value vector must already exist.]
start_offset int position at which to begin inserting values in the target vector [The constant OPC_VVEC_VECTOR_END can be used to specify that values be appended to the end of a vector. Each element of the vector interface is read to a successive position in the value vector. Any values already existing in those positions are not overwritten; instead their position numbers are increased to make room for the new values.]

Return Type

int

Completion code indicating whether the operation completed successfully.

OPC_ESYS_SUCCESS means the operation was successful. For the remaining completion codes, see Table 53 “External System Completion Code Symbolic Constants“ on page 13.

Example

/* Obtain value of an esys vector interface, and convert to an integer. */
vector = op_vvec_create (OPC_TYPE_BIT);
op_esys_interface_vector_get (interface_id, vector, 0);
/* Convert this vector into an integer. */
op_vvec_to_value (vector, OPC_VVEC_BYTE_ORDER_LITTLE_ENDIAN,
	OPC_VVEC_BITFORMAT_BINARY, OPC_VVEC_NATIVE_INT, &i);

Details

You can use the constants described in Table 99 “Value Vector Position Symbolic Constants“ on page 35 to specify where in the value vector to begin inserting values from the vector interface.

Purpose

Provide a mechanism to read values on vector interfaces and place them into value vectors. You can therefore treat vector interfaces as if they hold the contents of a value vector. This function call lets you insert the values from a vector interface into a value vector.

Errors

  • Program Abort: Segmentation violation. (due to invalid vector argument)
  • Recoverable Error: Interface handle is invalid.
  • Recoverable Error: Input vector is invalid.
  • Recoverable Error: Attempt to get a vector or array value from a non-vector interface (<name>).
  • Recoverable Error: Attempt to get a value from an esys input interface (<name>).

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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