436 lines
23 KiB
Plaintext
436 lines
23 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from pycomm3 import LogixDriver\n",
|
|
"import json, pprint"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"ip_address = \"107.84.248.90\" # \"ngrok.iot.inhandnetworks.com:3021\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "ResponseError",
|
|
"evalue": "failed to get attribute list",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
|
|
"\u001b[31mResponseError\u001b[39m Traceback (most recent call last)",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/logix_driver.py:499\u001b[39m, in \u001b[36mLogixDriver._get_instance_attribute_list_service\u001b[39m\u001b[34m(self, program)\u001b[39m\n\u001b[32m 498\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m response:\n\u001b[32m--> \u001b[39m\u001b[32m499\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m ResponseError(\n\u001b[32m 500\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msend_unit_data returned not valid data - \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mresponse.error\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m\"\u001b[39m\n\u001b[32m 501\u001b[39m )\n\u001b[32m 503\u001b[39m last_instance = \u001b[38;5;28mself\u001b[39m._parse_instance_attribute_list(response, tag_list)\n",
|
|
"\u001b[31mResponseError\u001b[39m: send_unit_data returned not valid data - Object state conflict",
|
|
"\nThe above exception was the direct cause of the following exception:\n",
|
|
"\u001b[31mResponseError\u001b[39m Traceback (most recent call last)",
|
|
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[5]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m LogixDriver(ip_address) \u001b[38;5;28;01mas\u001b[39;00m plc:\n\u001b[32m 2\u001b[39m \u001b[38;5;66;03m#info = plc.get_plc_info()\u001b[39;00m\n\u001b[32m 3\u001b[39m plctags = plc.get_tag_list()\n\u001b[32m 4\u001b[39m \u001b[38;5;66;03m#print(info)\u001b[39;00m\n",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/cip_driver.py:144\u001b[39m, in \u001b[36mCIPDriver.__enter__\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 143\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m__enter__\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m144\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 145\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\n",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/logix_driver.py:165\u001b[39m, in \u001b[36mLogixDriver.open\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 163\u001b[39m ret = \u001b[38;5;28msuper\u001b[39m().open()\n\u001b[32m 164\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m ret:\n\u001b[32m--> \u001b[39m\u001b[32m165\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_initialize_driver\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_init_args\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 166\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m ret\n",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/logix_driver.py:192\u001b[39m, in \u001b[36mLogixDriver._initialize_driver\u001b[39m\u001b[34m(self, init_tags, init_program_tags)\u001b[39m\n\u001b[32m 187\u001b[39m \u001b[38;5;28mself\u001b[39m._cfg[\u001b[33m\"\u001b[39m\u001b[33mcip_path\u001b[39m\u001b[33m\"\u001b[39m].pop(\n\u001b[32m 188\u001b[39m -\u001b[32m1\u001b[39m\n\u001b[32m 189\u001b[39m ) \u001b[38;5;66;03m# strip off backplane/0 segment, not used for these processors\u001b[39;00m\n\u001b[32m 191\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m init_tags:\n\u001b[32m--> \u001b[39m\u001b[32m192\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mget_tag_list\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprogram\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43m*\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43minit_program_tags\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[32m 194\u001b[39m \u001b[38;5;28mself\u001b[39m.__log.info(\u001b[33m\"\u001b[39m\u001b[33mInitialization complete.\u001b[39m\u001b[33m\"\u001b[39m)\n",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/cip_driver.py:100\u001b[39m, in \u001b[36mwith_forward_open.<locals>.wrapped\u001b[39m\u001b[34m(self, *args, **kwargs)\u001b[39m\n\u001b[32m 98\u001b[39m msg = \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mTarget did not connected. \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfunc.\u001b[34m__name__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m will not be executed.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 99\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m ResponseError(msg)\n\u001b[32m--> \u001b[39m\u001b[32m100\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/logix_driver.py:422\u001b[39m, in \u001b[36mLogixDriver.get_tag_list\u001b[39m\u001b[34m(self, program, cache)\u001b[39m\n\u001b[32m 420\u001b[39m \u001b[38;5;28mself\u001b[39m.__log.info(\u001b[33m\"\u001b[39m\u001b[33mStarting tag list upload...\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 421\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m program == \u001b[33m\"\u001b[39m\u001b[33m*\u001b[39m\u001b[33m\"\u001b[39m:\n\u001b[32m--> \u001b[39m\u001b[32m422\u001b[39m tags = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_get_tag_list\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 423\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m prog \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m._info[\u001b[33m\"\u001b[39m\u001b[33mprograms\u001b[39m\u001b[33m\"\u001b[39m]:\n\u001b[32m 424\u001b[39m tags += \u001b[38;5;28mself\u001b[39m._get_tag_list(prog)\n",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/logix_driver.py:438\u001b[39m, in \u001b[36mLogixDriver._get_tag_list\u001b[39m\u001b[34m(self, program)\u001b[39m\n\u001b[32m 436\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_get_tag_list\u001b[39m(\u001b[38;5;28mself\u001b[39m, program=\u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[32m 437\u001b[39m \u001b[38;5;28mself\u001b[39m.__log.info(\u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33mBeginning upload of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mprogram\u001b[38;5;250m \u001b[39m\u001b[38;5;129;01mor\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcontroller\u001b[39m\u001b[33m\"\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m tags...\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m--> \u001b[39m\u001b[32m438\u001b[39m all_tags = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_get_instance_attribute_list_service\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprogram\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 439\u001b[39m \u001b[38;5;28mself\u001b[39m.__log.info(\u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33mCompleted upload of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mprogram\u001b[38;5;250m \u001b[39m\u001b[38;5;129;01mor\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcontroller\u001b[39m\u001b[33m\"\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m tags\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m 440\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._isolate_user_tags(all_tags, program)\n",
|
|
"\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/pycomm/lib/python3.13/site-packages/pycomm3/logix_driver.py:511\u001b[39m, in \u001b[36mLogixDriver._get_instance_attribute_list_service\u001b[39m\u001b[34m(self, program)\u001b[39m\n\u001b[32m 508\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m tag_list\n\u001b[32m 510\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[32m--> \u001b[39m\u001b[32m511\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m ResponseError(\u001b[33m\"\u001b[39m\u001b[33mfailed to get attribute list\u001b[39m\u001b[33m\"\u001b[39m) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01merr\u001b[39;00m\n",
|
|
"\u001b[31mResponseError\u001b[39m: failed to get attribute list"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"with LogixDriver(ip_address) as plc:\n",
|
|
" #info = plc.get_plc_info()\n",
|
|
" plctags = plc.get_tag_list()\n",
|
|
" #print(info)\n",
|
|
" with open('/Users/nico/Documents/GitHub/HP_InHand_IG502/code snippets/tag_dump.json', 'w') as f:\n",
|
|
" json.dump(plc.tags_json,f, indent=4)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"print(plctags)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"json.dumps(plctags, indent=4)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"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": 8,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Lifetime_Flow_Meter_Gal, 67015360.0, REAL, None\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"with LogixDriver(ip_address) as plc:\n",
|
|
" #for x in range(20):\n",
|
|
" print(plc.read('Lifetime_Flow_Meter_Gal'))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"with LogixDriver('107.84.254.147') as plc:\n",
|
|
" print(plc.write(\"Lifetime_Flow_Meter_Gal\", 0))"
|
|
]
|
|
},
|
|
{
|
|
"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": "pycomm",
|
|
"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.13.2"
|
|
},
|
|
"orig_nbformat": 4
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|