How to extract array elements in Excel Connector

From OPC Labs Knowledge Base
Revision as of 18:26, 4 January 2021 by User (talk | contribs)
Jump to navigation Jump to search

In order to obtain a single element from an OPC item or node that contains an array value:

  1. Start Connectivity Explorer.
  2. In the Browse tab of the Point Editor, select the point you are interested in.
  3. Switch to the Properties tab of the Point Editor.
  4. In the property grid, under the [Advanced] category, select the Extract Array Element Indexes row, and click the ... button on the right side of the value column.
  5. In the Int32 Collection Editor, press the Add button.
  6. In the property grid of the Int32 Collection Editor, edit the integer next to Value, entering the index of the array element you are interested in. The indexes are numbered starting with zero.
  7. In the Int32 Collection Editor, press the OK button.
  8. In the property grid of the Properties tab of the Point Editor, verify that the selected array index is displayed next to the Extract Array Element Indexes. There will also be True next to Uses Client Element Extraction.
  9. Switch back to the Browse tab of the Property Editor.
  10. Add the data row into Live Point Data as normally, e.g. by clicking on the Add Live Data Row in the Action pane of the Point Editor window.
  11. In the Live Point Data window, verify that you see the extracted array element value as required.
  12. Drag&drop or copy&paste the value from Live Point Data window into Excel as normally.

It is also possible to extract elements of multi-dimensional arrays, by adding multiple indexes for "Extract Array Element Indexes".

This procedure works with all currently supported point types, i.e.:

  • OPC-DA Item Point
  • OPC-DA Property Point
  • OPC-UA Attribute Point

By repeating or modifying the procedure with different indexes, you can "transfer" the whole array contents into Excel.