-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joakim Gustafsson
committed
Jul 9, 2024
1 parent
91195ee
commit 702a0f7
Showing
4 changed files
with
50 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
OPC_UA_Clients/Release2/IJT_Web_Client/Python/CallStructure.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from asyncua import ua | ||
|
||
def createCallStructure(argument): | ||
""" | ||
This function creates the input call structures | ||
""" | ||
|
||
value = argument["value"] | ||
print(value) | ||
inp = 0 | ||
|
||
match argument["dataType"]: | ||
case 3029: | ||
inp = ua.JoiningProcessIdentificationDataType() | ||
arg0 = value[0] | ||
inp.JoiningProcessId = arg0["value"] | ||
arg1 = value[1] | ||
inp.JoiningProcessOriginId = arg1["value"] | ||
arg2 = value[2] | ||
inp.SelectionName = arg2["value"] | ||
case 3010: | ||
lst = [] | ||
|
||
for row in value: | ||
entityRow = row['value'] | ||
entity = ua.EntityDataType() | ||
entity.Name = entityRow["Name"] | ||
entity.Description = entityRow["Description"] | ||
entity.EntityId = entityRow["EntityId"] | ||
entity.EntityOriginId = entityRow["EntityOriginId"] | ||
entity.IsExternal = entityRow["IsExternal"] | ||
entity.EntityType = entityRow["EntityType"] | ||
|
||
lst.append(entity) | ||
|
||
inp = ua.Variant(lst, ua.VariantType.ExtensionObject) | ||
print(inp.__dict__) | ||
case _: | ||
inp = ua.Variant(value, ua.VariantType(argument["dataType"])) | ||
|
||
return inp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
OPC_UA_Clients/Release2/IJT_Web_Client/Resources/connectionpoints.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"connectionpoints": [{"name": "Local", "address": "opc.tcp://127.0.0.1:40451", "autoconnect": false}, {"name": "Windows simulation", "address": "opc.tcp://10.46.19.106:40451", "autoconnect": false}, {"name": "ICB-A", "address": "opc.tcp://10.46.16.68:40451", "autoconnect": true}, {"name": "PF8", "address": "opc.tcp://10.46.16.174:40451", "autoconnect": true}, {"name": "Pf8Demo", "address": "opc.tcp://192.168.1.1:40451", "autoconnect": false}], "command": "set connectionpoints", "endpoint": "common"} | ||
{"connectionpoints": [{"name": "Local", "address": "opc.tcp://127.0.0.1:40451", "autoconnect": false}, {"name": "Windows simulation", "address": "opc.tcp://10.46.19.106:40451", "autoconnect": false}, {"name": "ICB-A", "address": "opc.tcp://10.46.16.68:40451", "autoconnect": false}, {"name": "PF8", "address": "opc.tcp://10.46.16.174:40451", "autoconnect": true}, {"name": "Pf8Demo", "address": "opc.tcp://192.168.1.1:40451", "autoconnect": false}], "command": "set connectionpoints", "endpoint": "common"} |