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
- Use the KP op_intrpt_esys_interface() to get the esys interface ID for an esys interface
- Use the KP op_esys_interface_vector_set() to place the contents of a value vector onto a vector interface
- Use the KP op_esys_interface_array_get() to place elements from a vector interface into an existing array
- Use the KP op_esys_interface_value_get() to place the value form an esys interface into a variable
- Use the KP op_vvec_create() to create a value vector
- Use the KP op_vvec_type_get() to determine the data type of a vector