How to extract array elements in Excel Connector: Difference between revisions

From OPC Labs Knowledge Base
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Excel Option]] [[Category:How to]]  
[[Category:Excel Connector]] [[Category:How to]]  
In order to obtain a single element from an OPC item or node that contains an array value:
In order to obtain a single element from an OPC item or node that contains an array value:
# Start Connectivity Explorer.
# Start Connectivity Explorer.
# In the Browse tab of the Point Editor, select the point you are interested in.
# In the {{Style=label|Browse}} tab of the {{Style=label|Point Editor}}, select the point you are interested in.
# Switch to the Properties tab of the Point Editor.
# Switch to the {{Style=label|Properties}} tab of the {{Style=label|Point Editor}}.
# 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.
# In the property grid, under the {{Style=label|[Advanced]}} category, select the {{Style=label|Extract Array Element Indexes}} row, and click the {{Style=button|...}} button on the right side of the value column.
# In the "Int32 Collection Editor", press the Add button.
# In the {{Style=label|Int32 Collection Editor}}, press the {{Style=button|Add}} button.
# 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.
# In the property grid of the {{Style=label|Int32 Collection Editor}}, edit the integer next to {{Style=label|Value}}, entering the index of the array element you are interested in. The indexes are numbered starting with zero.
# In the "Int32 Collection Editor", press the OK button.
# In the {{Style=label|Int32 Collection Editor}}, press the {{Style=button|OK}} button.
# 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".
# In the property grid of the {{Style=label|Properties}} tab of the {{Style=label|Point Editor}}, verify that the selected array index is displayed next to the {{Style=label|Extract Array Element Indexes}}. There will also be '''True''' next to {{Style=label|Uses Client Element Extraction}}.
# Switch back to the Browse tab of the Property Editor.
# Switch back to the {{Style=label|Browse}} tab of the {{Style=label|Property Editor}}.
# 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.
# Add the data row into {{Style=label|Live Point Data}} as normally, e.g. by clicking on the {{Style=menu|Add Live Data Row}} in the {{Style=label|Action}} pane of the {{Style=label|Point Editor}} window.
# In the Live Point Data window, verify that you see the extracted array element value as required.
# In the {{Style=label|Live Point Data}} window, verify that you see the extracted array element value as required.
# Drag&drop or copy&paste the value from Live Point Data window into Excel as normally.
# Drag&drop or copy&paste the value from {{Style=label|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".
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, e.g.:
This procedure works with all currently supported point types, i.e.:
* OPC-DA Item Point
* OPC-DA Item Point
* OPC-DA Property Point
* OPC-DA Property Point

Latest revision as of 08:51, 12 January 2024

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.