codesysultra 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,7 @@ import inspect
|
|
|
5
5
|
|
|
6
6
|
def get_codesys_system_api():
|
|
7
7
|
try:
|
|
8
|
-
print "
|
|
8
|
+
print "\n=== CODESYS Script Engine System API ===\n"
|
|
9
9
|
|
|
10
10
|
print "=== Script Engine Modules ==="
|
|
11
11
|
print "scriptengine module:"
|
|
@@ -32,10 +32,8 @@ def get_codesys_system_api():
|
|
|
32
32
|
print " Error listing methods: %s" % e
|
|
33
33
|
except Exception as e:
|
|
34
34
|
print " Error: %s" % e
|
|
35
|
-
except Exception as e:
|
|
36
|
-
print " Error: %s" % e
|
|
37
35
|
|
|
38
|
-
print "
|
|
36
|
+
print "\n=== Script Engine Functions ==="
|
|
39
37
|
script_functions = []
|
|
40
38
|
for name in dir(script_engine):
|
|
41
39
|
if not name.startswith('_') and callable(getattr(script_engine, name)):
|
|
@@ -44,7 +42,7 @@ def get_codesys_system_api():
|
|
|
44
42
|
for func in sorted(script_functions):
|
|
45
43
|
print " - %s()" % func
|
|
46
44
|
|
|
47
|
-
print "
|
|
45
|
+
print "\n=== Available Enums ==="
|
|
48
46
|
try:
|
|
49
47
|
enums = []
|
|
50
48
|
for name in dir(script_engine):
|
|
@@ -53,7 +51,7 @@ def get_codesys_system_api():
|
|
|
53
51
|
enums.append((name, obj))
|
|
54
52
|
|
|
55
53
|
for enum_name, enum_obj in sorted(enums):
|
|
56
|
-
print "
|
|
54
|
+
print "\n%s:" % enum_name
|
|
57
55
|
try:
|
|
58
56
|
members = []
|
|
59
57
|
for name in dir(enum_obj):
|
|
@@ -70,7 +68,7 @@ def get_codesys_system_api():
|
|
|
70
68
|
except Exception as e:
|
|
71
69
|
print " Error: %s" % e
|
|
72
70
|
|
|
73
|
-
print "
|
|
71
|
+
print "\n=== Project Management ==="
|
|
74
72
|
print "script_engine.projects module functions:"
|
|
75
73
|
project_functions = []
|
|
76
74
|
for name in dir(script_engine.projects):
|
|
@@ -80,7 +78,7 @@ def get_codesys_system_api():
|
|
|
80
78
|
for func in sorted(project_functions):
|
|
81
79
|
print " - %s()" % func
|
|
82
80
|
|
|
83
|
-
print "
|
|
81
|
+
print "\n=== POU Types ==="
|
|
84
82
|
try:
|
|
85
83
|
pou_types = []
|
|
86
84
|
for name in dir(script_engine):
|
|
@@ -106,7 +104,7 @@ def get_codesys_system_api():
|
|
|
106
104
|
except Exception as e:
|
|
107
105
|
print " Error: %s" % e
|
|
108
106
|
|
|
109
|
-
print "
|
|
107
|
+
print "\n=== Implementation Languages ==="
|
|
110
108
|
try:
|
|
111
109
|
impl_langs = []
|
|
112
110
|
for name in dir(script_engine):
|
|
@@ -132,14 +130,14 @@ def get_codesys_system_api():
|
|
|
132
130
|
except Exception as e:
|
|
133
131
|
print " Error: %s" % e
|
|
134
132
|
|
|
135
|
-
print "
|
|
133
|
+
print "\n=== Version Info ==="
|
|
136
134
|
try:
|
|
137
135
|
version = getattr(script_engine, '__version__', 'Unknown')
|
|
138
136
|
print " Script Engine Version: %s" % version
|
|
139
137
|
except Exception as e:
|
|
140
138
|
print " Error getting version: %s" % e
|
|
141
139
|
|
|
142
|
-
print "
|
|
140
|
+
print "\n=== API Usage Examples ==="
|
|
143
141
|
print "Example 1: Open a project"
|
|
144
142
|
print " project = script_engine.projects.open('C:/Projects/MyProject.project')"
|
|
145
143
|
print ""
|
|
@@ -155,13 +153,13 @@ def get_codesys_system_api():
|
|
|
155
153
|
print " analyze(child, indent+1)"
|
|
156
154
|
print " analyze(project)"
|
|
157
155
|
|
|
158
|
-
print "
|
|
156
|
+
print "\n=== Analysis Complete ==="
|
|
159
157
|
print "SCRIPT_SUCCESS: CODESYS system API retrieved successfully."
|
|
160
158
|
sys.exit(0)
|
|
161
159
|
|
|
162
160
|
except Exception as e:
|
|
163
161
|
detailed_error = traceback.format_exc()
|
|
164
|
-
error_message = "Error retrieving CODESYS system API: %s
|
|
162
|
+
error_message = "Error retrieving CODESYS system API: %s\n%s" % (e, detailed_error)
|
|
165
163
|
print error_message
|
|
166
164
|
print "SCRIPT_ERROR: %s" % error_message
|
|
167
165
|
sys.exit(1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codesysultra",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for CODESYS automation platform",
|
|
5
5
|
"main": "dist/server.js",
|
|
6
6
|
"bin": {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.10.2",
|
|
38
38
|
"axios": "^1.6.8",
|
|
39
|
+
"codesysultra": "^1.0.8",
|
|
39
40
|
"commander": "^11.1.0",
|
|
40
41
|
"yargs": "^17.7.2",
|
|
41
42
|
"zod": "^3.24.3"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-16"?>
|
|
2
|
+
<Single xml:space="preserve" Type="{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}" Method="IArchivable">
|
|
3
|
+
<Single Name="Name" Type="string"><MachineProjectRoot></Single>
|
|
4
|
+
<Dictionary Type="System.Collections.Hashtable" Name="SubKeys" />
|
|
5
|
+
<Dictionary Type="System.Collections.Hashtable" Name="Values" />
|
|
6
|
+
</Single>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-16"?>
|
|
2
|
+
<Single xml:space="preserve" Type="{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}" Method="IArchivable">
|
|
3
|
+
<Single Name="Name" Type="string"><UserProjectRoot></Single>
|
|
4
|
+
<Dictionary Type="System.Collections.Hashtable" Name="SubKeys">
|
|
5
|
+
<Entry>
|
|
6
|
+
<Key>
|
|
7
|
+
<Single Type="string">{4F76D0CF-5F2B-4f90-B443-B3FED105365A}</Single>
|
|
8
|
+
</Key>
|
|
9
|
+
<Value>
|
|
10
|
+
<Single Type="{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}" Method="IArchivable">
|
|
11
|
+
<Single Name="Name" Type="string">{4F76D0CF-5F2B-4f90-B443-B3FED105365A}</Single>
|
|
12
|
+
<Dictionary Type="System.Collections.Hashtable" Name="SubKeys" />
|
|
13
|
+
<Dictionary Type="System.Collections.Hashtable" Name="Values" />
|
|
14
|
+
</Single>
|
|
15
|
+
</Value>
|
|
16
|
+
</Entry>
|
|
17
|
+
<Entry>
|
|
18
|
+
<Key>
|
|
19
|
+
<Single Type="string">{79968A73-AAAA-46E3-B71D-DD238D1A198A}</Single>
|
|
20
|
+
</Key>
|
|
21
|
+
<Value>
|
|
22
|
+
<Single Type="{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}" Method="IArchivable">
|
|
23
|
+
<Single Name="Name" Type="string">{79968A73-AAAA-46E3-B71D-DD238D1A198A}</Single>
|
|
24
|
+
<Dictionary Type="System.Collections.Hashtable" Name="SubKeys" />
|
|
25
|
+
<Dictionary Type="System.Collections.Hashtable" Name="Values">
|
|
26
|
+
<Entry>
|
|
27
|
+
<Key>
|
|
28
|
+
<Single Type="string">DefaultLocalizationCulture</Single>
|
|
29
|
+
</Key>
|
|
30
|
+
<Value>
|
|
31
|
+
<Single Type="string"></Single>
|
|
32
|
+
</Value>
|
|
33
|
+
</Entry>
|
|
34
|
+
</Dictionary>
|
|
35
|
+
</Single>
|
|
36
|
+
</Value>
|
|
37
|
+
</Entry>
|
|
38
|
+
<Entry>
|
|
39
|
+
<Key>
|
|
40
|
+
<Single Type="string">{B431F4F6-68E9-4767-9143-6471A69719A9}</Single>
|
|
41
|
+
</Key>
|
|
42
|
+
<Value>
|
|
43
|
+
<Single Type="{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}" Method="IArchivable">
|
|
44
|
+
<Single Name="Name" Type="string">{B431F4F6-68E9-4767-9143-6471A69719A9}</Single>
|
|
45
|
+
<Dictionary Type="System.Collections.Hashtable" Name="SubKeys" />
|
|
46
|
+
<Dictionary Type="System.Collections.Hashtable" Name="Values">
|
|
47
|
+
<Entry>
|
|
48
|
+
<Key>
|
|
49
|
+
<Single Type="string">ActiveApplicationGuid</Single>
|
|
50
|
+
</Key>
|
|
51
|
+
<Value>
|
|
52
|
+
<Single Type="string">{26f81cb7-7a7b-4e0d-b781-333c7c0256f9}</Single>
|
|
53
|
+
</Value>
|
|
54
|
+
</Entry>
|
|
55
|
+
</Dictionary>
|
|
56
|
+
</Single>
|
|
57
|
+
</Value>
|
|
58
|
+
</Entry>
|
|
59
|
+
<Entry>
|
|
60
|
+
<Key>
|
|
61
|
+
<Single Type="string">{E958CDB5-7DE4-41af-8650-09D402301787}</Single>
|
|
62
|
+
</Key>
|
|
63
|
+
<Value>
|
|
64
|
+
<Single Type="{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}" Method="IArchivable">
|
|
65
|
+
<Single Name="Name" Type="string">{E958CDB5-7DE4-41af-8650-09D402301787}</Single>
|
|
66
|
+
<Dictionary Type="System.Collections.Hashtable" Name="SubKeys" />
|
|
67
|
+
<Dictionary Type="System.Collections.Hashtable" Name="Values" />
|
|
68
|
+
</Single>
|
|
69
|
+
</Value>
|
|
70
|
+
</Entry>
|
|
71
|
+
</Dictionary>
|
|
72
|
+
<Dictionary Type="System.Collections.Hashtable" Name="Values" />
|
|
73
|
+
</Single>
|
|
Binary file
|
|
Binary file
|