Array Slice Processor

The “Array Slice Processor” is installed with the Dataristix Application. The processor takes one or more array values as inputs and selects a subset off each array value as output.

Add to Task

Add the “Array Slice Processor” to a task by dragging it from the “Build” panel onto the task’s “Task Builder” panel.

../_images/processor-arrayslice.png

Configuration

Select the “Array Slice Processor” item in the “Task Builder” panel to view its properties.

../_images/processor-arrayslice-edit.png

You can change the following properties:

  • Topic

    The title of the “Array Slice Processor” as it appears within the task builder.

  • First index

    The first element that should be selected as an output element. The numbering starts with zero; enter zero to include the first element in the array.

  • Select all remaining elements

    If ticked, then elements at the “First Index” and all remaining elements in the array are selected for output.

  • Number of elements

    The entry field is enabled when “Select all remaining elements” is unticked. The number of elements specifies how many elements should be selected as the output, starting at “First Index”.

Note

If “Select all remaining elements” is not ticked and “Number of Elements” is “1” then the output is a single, scalar value. You can use these settings to pick a single value from the input array.

If “Select all remaining elements” is not ticked and the “First Index” and “Number of Elements” define a range that is wholly or partially outside of the input array then the output array will contain all elements of the array that are within range and default values for out-of-range elements; the resulting array will contain “Number of Elements”.

If “Select all remaining elements” is ticked and the “First Index” is an index past the end of the input array then the output is empty.

If the input value is not an array then the value is passed to the output unmodified.

Example

The following example shows a task that transfers array data from the OPC UA Connector to the ODBC Connector. The “Array Slice Processor” is used to select 3 elements of the input array starting with the second element of the array.

../_images/processor-arrayslice-example.png