Skip to content

Commit

Permalink
Enhanced event handling for OPC UA server APIs interactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
MeenaBana committed Mar 21, 2024
1 parent 4d1be8e commit b0d2ae7
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 675 deletions.
30 changes: 29 additions & 1 deletion notebooks/Exploring_API_Functions_Authentication.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,34 @@
"opc_data = OPC_UA(rest_url=opcua_rest_url, opcua_url=opcua_server_url, namespaces=namespace_list, auth_client=auth_client)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Getting all event types\n",
"event_types = opc_data.get_event_types()\n",
"event_types"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Reading one month historical events of trackers \n",
"hist_events = opc_data.read_historical_events(\n",
" start_time=(datetime.datetime.now() - datetime.timedelta(30)),\n",
" end_time=(datetime.datetime.now() - datetime.timedelta(1)),\n",
" variable_list=trackers.variables_as_list([\"AngleMeasured\", \"AngleSetpoint\"], True),\n",
" fields_list=[\"Time\", \"Message\", \"SourceName\", \"Severity\", \"Active\", \"Acknowledged\", \"Comment\", \"EventTypeName\"],\n",
" event_type_name=\"InverterEventType\",\n",
")\n",
"hist_events"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -284,7 +312,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit b0d2ae7

Please sign in to comment.