440 lines
23 KiB
Plaintext
440 lines
23 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from pycomm3 import LogixDriver\n",
|
|
"import json, pprint"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"{'vendor': 'Rockwell Automation/Allen-Bradley', 'product_type': 'Programmable Logic Controller', 'product_code': 180, 'revision': {'major': 12, 'minor': 11}, 'status': b'4\\x00', 'serial': 'd05b07d5', 'product_name': '2080-LC20-20QWB', 'keyswitch': 'UNKNOWN'}\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"with LogixDriver('107.84.238.170') as plc:\n",
|
|
" #info = plc.get_plc_info()\n",
|
|
" plctags = plc.get_tag_list()\n",
|
|
" #print(info)\n",
|
|
" print(json.dumps(plc.tags_json, indent=4))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"print(plctags)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "TypeError",
|
|
"evalue": "Object of type _DataTypeMeta is not JSON serializable",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
|
|
"\u001b[1;32m/Users/nico/Documents/GitHub/HP_InHand_IG502/getPLCData.ipynb Cell 3\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/nico/Documents/GitHub/HP_InHand_IG502/getPLCData.ipynb#X13sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m json\u001b[39m.\u001b[39;49mdumps(plctags, indent\u001b[39m=\u001b[39;49m\u001b[39m4\u001b[39;49m)\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/__init__.py:238\u001b[0m, in \u001b[0;36mdumps\u001b[0;34m(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)\u001b[0m\n\u001b[1;32m 232\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mcls\u001b[39m \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 233\u001b[0m \u001b[39mcls\u001b[39m \u001b[39m=\u001b[39m JSONEncoder\n\u001b[1;32m 234\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mcls\u001b[39;49m(\n\u001b[1;32m 235\u001b[0m skipkeys\u001b[39m=\u001b[39;49mskipkeys, ensure_ascii\u001b[39m=\u001b[39;49mensure_ascii,\n\u001b[1;32m 236\u001b[0m check_circular\u001b[39m=\u001b[39;49mcheck_circular, allow_nan\u001b[39m=\u001b[39;49mallow_nan, indent\u001b[39m=\u001b[39;49mindent,\n\u001b[1;32m 237\u001b[0m separators\u001b[39m=\u001b[39;49mseparators, default\u001b[39m=\u001b[39;49mdefault, sort_keys\u001b[39m=\u001b[39;49msort_keys,\n\u001b[0;32m--> 238\u001b[0m \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkw)\u001b[39m.\u001b[39;49mencode(obj)\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:201\u001b[0m, in \u001b[0;36mJSONEncoder.encode\u001b[0;34m(self, o)\u001b[0m\n\u001b[1;32m 199\u001b[0m chunks \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39miterencode(o, _one_shot\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m)\n\u001b[1;32m 200\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39misinstance\u001b[39m(chunks, (\u001b[39mlist\u001b[39m, \u001b[39mtuple\u001b[39m)):\n\u001b[0;32m--> 201\u001b[0m chunks \u001b[39m=\u001b[39m \u001b[39mlist\u001b[39;49m(chunks)\n\u001b[1;32m 202\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39m'\u001b[39m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39mjoin(chunks)\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:429\u001b[0m, in \u001b[0;36m_make_iterencode.<locals>._iterencode\u001b[0;34m(o, _current_indent_level)\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[39myield\u001b[39;00m _floatstr(o)\n\u001b[1;32m 428\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(o, (\u001b[39mlist\u001b[39m, \u001b[39mtuple\u001b[39m)):\n\u001b[0;32m--> 429\u001b[0m \u001b[39myield from\u001b[39;00m _iterencode_list(o, _current_indent_level)\n\u001b[1;32m 430\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(o, \u001b[39mdict\u001b[39m):\n\u001b[1;32m 431\u001b[0m \u001b[39myield from\u001b[39;00m _iterencode_dict(o, _current_indent_level)\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:325\u001b[0m, in \u001b[0;36m_make_iterencode.<locals>._iterencode_list\u001b[0;34m(lst, _current_indent_level)\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 324\u001b[0m chunks \u001b[39m=\u001b[39m _iterencode(value, _current_indent_level)\n\u001b[0;32m--> 325\u001b[0m \u001b[39myield from\u001b[39;00m chunks\n\u001b[1;32m 326\u001b[0m \u001b[39mif\u001b[39;00m newline_indent \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 327\u001b[0m _current_indent_level \u001b[39m-\u001b[39m\u001b[39m=\u001b[39m \u001b[39m1\u001b[39m\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:405\u001b[0m, in \u001b[0;36m_make_iterencode.<locals>._iterencode_dict\u001b[0;34m(dct, _current_indent_level)\u001b[0m\n\u001b[1;32m 403\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 404\u001b[0m chunks \u001b[39m=\u001b[39m _iterencode(value, _current_indent_level)\n\u001b[0;32m--> 405\u001b[0m \u001b[39myield from\u001b[39;00m chunks\n\u001b[1;32m 406\u001b[0m \u001b[39mif\u001b[39;00m newline_indent \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 407\u001b[0m _current_indent_level \u001b[39m-\u001b[39m\u001b[39m=\u001b[39m \u001b[39m1\u001b[39m\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:405\u001b[0m, in \u001b[0;36m_make_iterencode.<locals>._iterencode_dict\u001b[0;34m(dct, _current_indent_level)\u001b[0m\n\u001b[1;32m 403\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 404\u001b[0m chunks \u001b[39m=\u001b[39m _iterencode(value, _current_indent_level)\n\u001b[0;32m--> 405\u001b[0m \u001b[39myield from\u001b[39;00m chunks\n\u001b[1;32m 406\u001b[0m \u001b[39mif\u001b[39;00m newline_indent \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 407\u001b[0m _current_indent_level \u001b[39m-\u001b[39m\u001b[39m=\u001b[39m \u001b[39m1\u001b[39m\n",
|
|
" \u001b[0;31m[... skipping similar frames: _make_iterencode.<locals>._iterencode_dict at line 405 (1 times)]\u001b[0m\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:405\u001b[0m, in \u001b[0;36m_make_iterencode.<locals>._iterencode_dict\u001b[0;34m(dct, _current_indent_level)\u001b[0m\n\u001b[1;32m 403\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 404\u001b[0m chunks \u001b[39m=\u001b[39m _iterencode(value, _current_indent_level)\n\u001b[0;32m--> 405\u001b[0m \u001b[39myield from\u001b[39;00m chunks\n\u001b[1;32m 406\u001b[0m \u001b[39mif\u001b[39;00m newline_indent \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 407\u001b[0m _current_indent_level \u001b[39m-\u001b[39m\u001b[39m=\u001b[39m \u001b[39m1\u001b[39m\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:438\u001b[0m, in \u001b[0;36m_make_iterencode.<locals>._iterencode\u001b[0;34m(o, _current_indent_level)\u001b[0m\n\u001b[1;32m 436\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39m\"\u001b[39m\u001b[39mCircular reference detected\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 437\u001b[0m markers[markerid] \u001b[39m=\u001b[39m o\n\u001b[0;32m--> 438\u001b[0m o \u001b[39m=\u001b[39m _default(o)\n\u001b[1;32m 439\u001b[0m \u001b[39myield from\u001b[39;00m _iterencode(o, _current_indent_level)\n\u001b[1;32m 440\u001b[0m \u001b[39mif\u001b[39;00m markers \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n",
|
|
"File \u001b[0;32m~/miniforge3/envs/thingsboard/lib/python3.10/json/encoder.py:179\u001b[0m, in \u001b[0;36mJSONEncoder.default\u001b[0;34m(self, o)\u001b[0m\n\u001b[1;32m 160\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mdefault\u001b[39m(\u001b[39mself\u001b[39m, o):\n\u001b[1;32m 161\u001b[0m \u001b[39m\"\"\"Implement this method in a subclass such that it returns\u001b[39;00m\n\u001b[1;32m 162\u001b[0m \u001b[39m a serializable object for ``o``, or calls the base implementation\u001b[39;00m\n\u001b[1;32m 163\u001b[0m \u001b[39m (to raise a ``TypeError``).\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 177\u001b[0m \n\u001b[1;32m 178\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 179\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mTypeError\u001b[39;00m(\u001b[39mf\u001b[39m\u001b[39m'\u001b[39m\u001b[39mObject of type \u001b[39m\u001b[39m{\u001b[39;00mo\u001b[39m.\u001b[39m\u001b[39m__class__\u001b[39m\u001b[39m.\u001b[39m\u001b[39m__name__\u001b[39m\u001b[39m}\u001b[39;00m\u001b[39m \u001b[39m\u001b[39m'\u001b[39m\n\u001b[1;32m 180\u001b[0m \u001b[39mf\u001b[39m\u001b[39m'\u001b[39m\u001b[39mis not JSON serializable\u001b[39m\u001b[39m'\u001b[39m)\n",
|
|
"\u001b[0;31mTypeError\u001b[0m: Object of type _DataTypeMeta is not JSON serializable"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"json.dumps(plctags, indent=4)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Lact_01_Monthly_Total, None, None, Tag doesn't exist - Lact_01_Monthly_Total\n",
|
|
"Lact_01_Prev_Month_Total, None, None, Tag doesn't exist - Lact_01_Prev_Month_Total\n",
|
|
"Lact_01_Today_Total, None, None, Tag doesn't exist - Lact_01_Today_Total\n",
|
|
"Lact_01_Yesterday_Total, None, None, Tag doesn't exist - Lact_01_Yesterday_Total\n",
|
|
"Lact_02_Monthly_Total, 0.0, REAL, None\n",
|
|
"Lact_02_Prev_Month_Total, 0.0, REAL, None\n",
|
|
"Lact_02_Today_Total, 684.0, REAL, None\n",
|
|
"Lact_02_Yesterday_Total, 1631.27197265625, REAL, None\n",
|
|
"XferPump_01_Daily_Totalizer.Total, 226.14686584472656, REAL, None\n",
|
|
"XferPump_01_Daily_Totalizer.OldTotal, 1106.1217041015625, REAL, None\n",
|
|
"XferPump_02_Monthly_Totalizer.Total, 6236.13525390625, REAL, None\n",
|
|
"XferPump_02_Monthly_Totalizer.OldTotal, 0.0, REAL, None\n",
|
|
"Val_Water_Xfer_Current_Day, 6898.751953125, REAL, None\n",
|
|
"Val_Water_Xfer_Prev_Day, 10086.0771484375, REAL, None\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"readtags = [\n",
|
|
" \"Lact_01_Monthly_Total\",\n",
|
|
" \"Lact_01_Prev_Month_Total\",\n",
|
|
" \"Lact_01_Today_Total\",\n",
|
|
" \"Lact_01_Yesterday_Total\",\n",
|
|
" \"Lact_02_Monthly_Total\",\n",
|
|
" \"Lact_02_Prev_Month_Total\",\n",
|
|
" \"Lact_02_Today_Total\",\n",
|
|
" \"Lact_02_Yesterday_Total\",\n",
|
|
" \"XferPump_01_Daily_Totalizer.Total\",\n",
|
|
" \"XferPump_01_Daily_Totalizer.OldTotal\",\n",
|
|
" \"XferPump_02_Monthly_Totalizer.Total\",\n",
|
|
" \"XferPump_02_Monthly_Totalizer.OldTotal\",\n",
|
|
" \"Val_Water_Xfer_Current_Day\",\n",
|
|
" \"Val_Water_Xfer_Prev_Day\"\n",
|
|
"]\n",
|
|
"with LogixDriver('63.40.227.154') as plc:\n",
|
|
" print(*plc.read(*readtags), sep=\"\\n\")\n",
|
|
" "
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"with LogixDriver('166.141.135.198') as plc:\n",
|
|
" print(plc.write(\"sts_PID_Control\", 3))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"attributes = [\n",
|
|
" \"EnableIn\",\n",
|
|
" \"EnableOut\",\n",
|
|
" \"Inp_PV\",\n",
|
|
" \"Inp_PVSrcQ\",\n",
|
|
" \"Inp_PVBad\",\n",
|
|
" \"Inp_PVUncertain\",\n",
|
|
" \"Inp_Sim\",\n",
|
|
" \"Inp_HiHiGate\",\n",
|
|
" \"Inp_HiGate\",\n",
|
|
" \"Inp_LoGate\",\n",
|
|
" \"Inp_LoLoGate\",\n",
|
|
" \"Inp_FailGate\",\n",
|
|
" \"Inp_Reset\",\n",
|
|
" \"Cfg_NoSubstPV\",\n",
|
|
" \"Cfg_SetTrack\",\n",
|
|
" \"Cfg_HasChanObj\",\n",
|
|
" \"Cfg_UseChanSrcQ\",\n",
|
|
" \"Cfg_PCmdClear\",\n",
|
|
" \"Cfg_ProgDefault\",\n",
|
|
" \"Cfg_HasHiHiAlm\",\n",
|
|
" \"Cfg_HasHiAlm\",\n",
|
|
" \"Cfg_HasLoAlm\",\n",
|
|
" \"Cfg_HasLoLoAlm\",\n",
|
|
" \"Cfg_HasFailAlm\",\n",
|
|
" \"Cfg_HiHiResetReqd\",\n",
|
|
" \"Cfg_HiResetReqd\",\n",
|
|
" \"Cfg_LoResetReqd\",\n",
|
|
" \"Cfg_LoLoResetReqd\",\n",
|
|
" \"Cfg_FailResetReqd\",\n",
|
|
" \"Cfg_HiHiAckReqd\",\n",
|
|
" \"Cfg_HiAckReqd\",\n",
|
|
" \"Cfg_LoAckReqd\",\n",
|
|
" \"Cfg_LoLoAckReqd\",\n",
|
|
" \"Cfg_FailAckReqd\",\n",
|
|
" \"Cfg_HiHiSeverity\",\n",
|
|
" \"Cfg_HiSeverity\",\n",
|
|
" \"Cfg_LoSeverity\",\n",
|
|
" \"Cfg_LoLoSeverity\",\n",
|
|
" \"Cfg_FailSeverity\",\n",
|
|
" \"Cfg_InpRawMin\",\n",
|
|
" \"Cfg_InpRawMax\",\n",
|
|
" \"Cfg_PVEUMin\",\n",
|
|
" \"Cfg_PVEUMax\",\n",
|
|
" \"Cfg_FiltTC\",\n",
|
|
" \"Cfg_HiHiDB\",\n",
|
|
" \"Cfg_HiHiOnDly\",\n",
|
|
" \"Cfg_HiHiOffDly\",\n",
|
|
" \"Cfg_HiHiGateDly\",\n",
|
|
" \"Cfg_HiDB\",\n",
|
|
" \"Cfg_HiOnDly\",\n",
|
|
" \"Cfg_HiOffDly\",\n",
|
|
" \"Cfg_HiGateDly\",\n",
|
|
" \"Cfg_LoDB\",\n",
|
|
" \"Cfg_LoOnDly\",\n",
|
|
" \"Cfg_LoOffDly\",\n",
|
|
" \"Cfg_LoGateDly\",\n",
|
|
" \"Cfg_LoLoDB\",\n",
|
|
" \"Cfg_LoLoOnDly\",\n",
|
|
" \"Cfg_LoLoOffDly\",\n",
|
|
" \"Cfg_LoLoGateDly\",\n",
|
|
" \"Cfg_FailHiLim\",\n",
|
|
" \"Cfg_FailLoLim\",\n",
|
|
" \"Cfg_FailDB\",\n",
|
|
" \"Cfg_FailOnDly\",\n",
|
|
" \"Cfg_FailOffDly\",\n",
|
|
" \"Cfg_FailGateDly\",\n",
|
|
" \"PSet_Owner\",\n",
|
|
" \"PSet_HiHiLim\",\n",
|
|
" \"PSet_HiLim\",\n",
|
|
" \"PSet_LoLim\",\n",
|
|
" \"PSet_LoLoLim\",\n",
|
|
" \"MSet_SubstPV\",\n",
|
|
" \"OSet_HiHiLim\",\n",
|
|
" \"OSet_HiLim\",\n",
|
|
" \"OSet_LoLim\",\n",
|
|
" \"OSet_LoLoLim\",\n",
|
|
" \"Set_SimPV\",\n",
|
|
" \"PCmd_ClearCapt\",\n",
|
|
" \"PCmd_Acq\",\n",
|
|
" \"PCmd_Rel\",\n",
|
|
" \"PCmd_Lock\",\n",
|
|
" \"PCmd_Unlock\",\n",
|
|
" \"PCmd_Reset\",\n",
|
|
" \"PCmd_HiHiAck\",\n",
|
|
" \"PCmd_HiHiSuppress\",\n",
|
|
" \"PCmd_HiHiUnsuppress\",\n",
|
|
" \"PCmd_HiHiUnshelve\",\n",
|
|
" \"PCmd_HiAck\",\n",
|
|
" \"PCmd_HiSuppress\",\n",
|
|
" \"PCmd_HiUnsuppress\",\n",
|
|
" \"PCmd_HiUnshelve\",\n",
|
|
" \"PCmd_LoAck\",\n",
|
|
" \"PCmd_LoSuppress\",\n",
|
|
" \"PCmd_LoUnsuppress\",\n",
|
|
" \"PCmd_LoUnshelve\",\n",
|
|
" \"PCmd_LoLoAck\",\n",
|
|
" \"PCmd_LoLoSuppress\",\n",
|
|
" \"PCmd_LoLoUnsuppress\",\n",
|
|
" \"PCmd_LoLoUnshelve\",\n",
|
|
" \"PCmd_FailAck\",\n",
|
|
" \"PCmd_FailSuppress\",\n",
|
|
" \"PCmd_FailUnsuppress\",\n",
|
|
" \"PCmd_FailUnshelve\",\n",
|
|
" \"MCmd_SubstPV\",\n",
|
|
" \"MCmd_InpPV\",\n",
|
|
" \"OCmd_ClearCapt\",\n",
|
|
" \"MCmd_Acq\",\n",
|
|
" \"MCmd_Rel\",\n",
|
|
" \"OCmd_AcqLock\",\n",
|
|
" \"OCmd_Unlock\",\n",
|
|
" \"OCmd_Reset\",\n",
|
|
" \"OCmd_ResetAckAll\",\n",
|
|
" \"Val\",\n",
|
|
" \"Val_InpPV\",\n",
|
|
" \"Val_PVMinCapt\",\n",
|
|
" \"Val_PVMaxCapt\",\n",
|
|
" \"Val_PVEUMin\",\n",
|
|
" \"Val_PVEUMax\",\n",
|
|
" \"SrcQ_IO\",\n",
|
|
" \"SrcQ\",\n",
|
|
" \"Val_Fault\",\n",
|
|
" \"Val_Mode\",\n",
|
|
" \"Val_Owner\",\n",
|
|
" \"Val_Notify\",\n",
|
|
" \"Val_HiHiLim\",\n",
|
|
" \"Val_HiLim\",\n",
|
|
" \"Val_LoLim\",\n",
|
|
" \"Val_LoLoLim\",\n",
|
|
" \"Sts_SubstPV\",\n",
|
|
" \"Sts_InpPV\",\n",
|
|
" \"Sts_PVBad\",\n",
|
|
" \"Sts_PVUncertain\",\n",
|
|
" \"Sts_MaintByp\",\n",
|
|
" \"Sts_AlmInh\",\n",
|
|
" \"Sts_Err\",\n",
|
|
" \"Err_Raw\",\n",
|
|
" \"Err_EU\",\n",
|
|
" \"Err_Timer\",\n",
|
|
" \"Err_Filt\",\n",
|
|
" \"Err_DB\",\n",
|
|
" \"Err_Alarm\",\n",
|
|
" \"Sts_Maint\",\n",
|
|
" \"Sts_Prog\",\n",
|
|
" \"Sts_Oper\",\n",
|
|
" \"Sts_ProgOperLock\",\n",
|
|
" \"Sts_NoMode\",\n",
|
|
" \"Sts_MAcqRcvd\",\n",
|
|
" \"Sts_HiHiCmp\",\n",
|
|
" \"Sts_HiHiGate\",\n",
|
|
" \"Sts_HiHi\",\n",
|
|
" \"Alm_HiHi\",\n",
|
|
" \"Ack_HiHi\",\n",
|
|
" \"Sts_HiHiDisabled\",\n",
|
|
" \"Sts_HiHiSuppressed\",\n",
|
|
" \"Sts_HiHiShelved\",\n",
|
|
" \"Sts_HiCmp\",\n",
|
|
" \"Sts_HiGate\",\n",
|
|
" \"Sts_Hi\",\n",
|
|
" \"Alm_Hi\",\n",
|
|
" \"Ack_Hi\",\n",
|
|
" \"Sts_HiDisabled\",\n",
|
|
" \"Sts_HiSuppressed\",\n",
|
|
" \"Sts_HiShelved\",\n",
|
|
" \"Sts_LoCmp\",\n",
|
|
" \"Sts_LoGate\",\n",
|
|
" \"Sts_Lo\",\n",
|
|
" \"Alm_Lo\",\n",
|
|
" \"Ack_Lo\",\n",
|
|
" \"Sts_LoDisabled\",\n",
|
|
" \"Sts_LoSuppressed\",\n",
|
|
" \"Sts_LoShelved\",\n",
|
|
" \"Sts_LoLoCmp\",\n",
|
|
" \"Sts_LoLoGate\",\n",
|
|
" \"Sts_LoLo\",\n",
|
|
" \"Alm_LoLo\",\n",
|
|
" \"Ack_LoLo\",\n",
|
|
" \"Sts_LoLoDisabled\",\n",
|
|
" \"Sts_LoLoSuppressed\",\n",
|
|
" \"Sts_LoLoShelved\",\n",
|
|
" \"Sts_FailCmp\",\n",
|
|
" \"Sts_FailGate\",\n",
|
|
" \"Sts_Fail\",\n",
|
|
" \"Alm_Fail\",\n",
|
|
" \"Ack_Fail\",\n",
|
|
" \"Sts_FailDisabled\",\n",
|
|
" \"Sts_FailSuppressed\",\n",
|
|
" \"Sts_FailShelved\",\n",
|
|
" \"Rdy_SubstPV\",\n",
|
|
" \"Rdy_InpPV\",\n",
|
|
" \"Rdy_Reset\",\n",
|
|
" \"Rdy_ResetAckAll\",\n",
|
|
" \"Rdy_OSet\",\n",
|
|
" \"P_AIn\",\n",
|
|
" \"inp_ProcessRunning\",\n",
|
|
" \"LoLo\",\n",
|
|
" \"Lo\",\n",
|
|
" \"Hi\",\n",
|
|
" \"HiHi\",\n",
|
|
" \"Mode\",\n",
|
|
" \"Cfg_EU\",\n",
|
|
" \"Cfg_Tag\",\n",
|
|
" \"Cfg_Label\",\n",
|
|
" \"Cfg_Desc\",\n",
|
|
" \"Fail\",\n",
|
|
" \"Wrk_Notify\",\n",
|
|
" \"Inf_Tab\",\n",
|
|
" \"Wrk_Fault\",\n",
|
|
" \"Wrk_SrcQ\",\n",
|
|
" \"Wrk_SubstPV\",\n",
|
|
" \"Wrk_UnfiltPV\",\n",
|
|
" \"Wrk_Alpha\",\n",
|
|
" \"Wrk_ScanT\",\n",
|
|
" \"Wrk_ScanTime\",\n",
|
|
" \"Wrk_FiltPV\",\n",
|
|
" \"Wrk_ValidONS\",\n",
|
|
" \"Wrk_SelPVDINT\",\n",
|
|
" \"Wrk_SelPVInfNaN\",\n",
|
|
" \"Inf_Type\",\n",
|
|
" \"Wrk_Fail\",\n",
|
|
" \"Wrk_LoLo\",\n",
|
|
" \"Wrk_Lo\",\n",
|
|
" \"Wrk_Hi\",\n",
|
|
" \"Wrk_HiHi\",\n",
|
|
" \"FailGate\",\n",
|
|
" \"LoLoGate\",\n",
|
|
" \"LoGate\",\n",
|
|
" \"HiHiGate\",\n",
|
|
" \"HiGate\",\n",
|
|
" \"Wrk_InpInfNaN\",\n",
|
|
" \"Wrk_InpDINT\",\n",
|
|
" \"Inf_Lib\",\n",
|
|
" \"Wrk_InpFail\",\n",
|
|
" \"ONS_Supress\",\n",
|
|
" \"ONS_Unsupress\",\n",
|
|
" \"ONS_ProcessRunning\",\n",
|
|
" \"ONS_ProcessNotRunning\"\n",
|
|
" ]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"taglist = []\n",
|
|
"basetag = \"AIn_IntakePressure\"\n",
|
|
"for x in attributes:\n",
|
|
" taglist.append(basetag + \".\" + x)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"with LogixDriver('166.252.25.65') as plc:\n",
|
|
" r = plc.read(*taglist)\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"\n",
|
|
"for x in r:\n",
|
|
" print(x)"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "thingsboard",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.10.5"
|
|
},
|
|
"orig_nbformat": 4,
|
|
"vscode": {
|
|
"interpreter": {
|
|
"hash": "32b1684233d9748bd1bb5a29a1b19459c9564d6488d1324e633b9c48826c5d03"
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|