op_esys_interface_vector_set()

Abstract

Sets successive values of a vector interface from a value vector.

Syntax

op_esys_interface_vector_set (interface, schedule_time, source, start_offset)
Argument Type Description
interface Esys_Interface esys interface ID of the vector interface whose values will be set
[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().]
schedule_time double scheduled time to write the data to the vector interface (see Details for available constants)
source Vvec_Vector value vector to be used in setting the vector interface
[The types of the vector interface and the value vector must match, and they must have the same dimension.]
start_offset int position at which to begin reading values from the source vector
[The value in the position specified is placed on the first position in the vector interface (index 0). Each element of the value vector is then read to a successive position in the vector interface. Any values already existing in those positions are overwritten.]

Return Type

Evhandle

Handle to the OPC_INTRPT_ESYS_INTERFACE_EXT interrupt scheduled to set the interface, if one was scheduled; OPC_NIL otherwise.

Example

/* Send some data to an esys interface. Extract lower-order 16 bits from 'vvec' vector. */
head = op_vvec_remove (vvec, OPC_VVEC_VECTOR_START, 16);

/* Schedule values on the esys vector interface. */
op_esys_interface_vector_set (interface_id, op_sim_time(), head, 0);

/* Done with this vector. */
op_vvec_destroy (head);

Details

The value of start_offset refers to the value vector index, not the vector interface. Therefore, by setting the start_offset to 5, the first element of the vector interface (index 0) will be set to the value at the sixth position in the value vector (index 5). Thereafter, the second element of the vector interface will be set to the value at the seventh position in the value vector, and so on until all values of the vector interface have been set.

The value vector must be long enough to fill all elements of the vector interface because op_esys_interface_vector_set() does not stop reading values until all values of the vector interface have been set.

The schedule_time argument can be an explicit time or one of the following special values:

  • OPC_ESYS_NOTIFY_IMMEDIATELY—the interface value is delivered to the registered callback (if any) right away
  • OPC_ESYS_NOTIFY_NEVER—the interface value is updated, but any registered callback is not invoked

Purpose

Provides a mechanism for writing the contents of a value vector to a vector interface.

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 set a value on an esys input interface (<id>).
  • Recoverable Error: Attempt to set vector or array value on a non-vector interface (<id>).
  • Recoverable Error: Input Vvec vector's type (<type>) does not match interface type (<type>).
  • Recoverable Error: Specified time (<schedule_time>) is less than current time.

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