author | Edouard Tisserant <edouard.tisserant@gmail.com> |
Sat, 17 Aug 2024 18:44:12 +0200 | |
changeset 3976 | 86e39be014d8 |
parent 3814 | ab0afe798428 |
permissions | -rw-r--r-- |
1436
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
1 |
<?xml version='1.0' encoding='utf-8'?> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
2 |
<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
3 |
<variables> |
2699
467ff0e58327
Add a little test to see OnChange's .count .first .last in action
Edouard Tisserant
parents:
2692
diff
changeset
|
4 |
<variable name="SomeVarName" type="DINT" onchange="MyFunc, SomeChange"/> |
2692
d4bede6cd3f1
PY_EXT: OnChange is now a coma separated list of callables. Updated tests/python accordingly.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2680
diff
changeset
|
5 |
<variable name="Grumpf" type="STRING" initial="'mhoo'" onchange="MyFunc, MyOtherFunc"/> |
1436
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
6 |
</variables> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
7 |
<globals> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
8 |
<xhtml:p><![CDATA[ |
3814
ab0afe798428
Examples: use print() function in "python" example
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3318
diff
changeset
|
9 |
print("All python PLC globals variables :", PLCGlobalsDesc) |
ab0afe798428
Examples: use print() function in "python" example
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3318
diff
changeset
|
10 |
print("Current extention name :", __ext_name__) |
2680
6bfed6757495
tests/python : add some STRING PLC Python globals with OnChange.
Edouard Tisserant
parents:
1452
diff
changeset
|
11 |
|
6bfed6757495
tests/python : add some STRING PLC Python globals with OnChange.
Edouard Tisserant
parents:
1452
diff
changeset
|
12 |
def MyFunc(*args): |
3814
ab0afe798428
Examples: use print() function in "python" example
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3318
diff
changeset
|
13 |
print(args) |
2680
6bfed6757495
tests/python : add some STRING PLC Python globals with OnChange.
Edouard Tisserant
parents:
1452
diff
changeset
|
14 |
|
2692
d4bede6cd3f1
PY_EXT: OnChange is now a coma separated list of callables. Updated tests/python accordingly.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2680
diff
changeset
|
15 |
def MyOtherFunc(*args): |
3814
ab0afe798428
Examples: use print() function in "python" example
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3318
diff
changeset
|
16 |
print("other", args) |
2692
d4bede6cd3f1
PY_EXT: OnChange is now a coma separated list of callables. Updated tests/python accordingly.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2680
diff
changeset
|
17 |
|
2699
467ff0e58327
Add a little test to see OnChange's .count .first .last in action
Edouard Tisserant
parents:
2692
diff
changeset
|
18 |
def SomeChange(*args): |
3814
ab0afe798428
Examples: use print() function in "python" example
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3318
diff
changeset
|
19 |
print("count",OnChange.SomeVarName.count) |
ab0afe798428
Examples: use print() function in "python" example
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3318
diff
changeset
|
20 |
print("first",OnChange.SomeVarName.first) |
ab0afe798428
Examples: use print() function in "python" example
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3318
diff
changeset
|
21 |
print("last",OnChange.SomeVarName.last) |
2699
467ff0e58327
Add a little test to see OnChange's .count .first .last in action
Edouard Tisserant
parents:
2692
diff
changeset
|
22 |
|
2692
d4bede6cd3f1
PY_EXT: OnChange is now a coma separated list of callables. Updated tests/python accordingly.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2680
diff
changeset
|
23 |
|
1436
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
24 |
]]></xhtml:p> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
25 |
</globals> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
26 |
<init> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
27 |
<xhtml:p><![CDATA[ |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
28 |
]]></xhtml:p> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
29 |
</init> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
30 |
<cleanup> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
31 |
<xhtml:p><![CDATA[ |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
32 |
]]></xhtml:p> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
33 |
</cleanup> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
34 |
<start> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
35 |
<xhtml:p><![CDATA[ |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
36 |
]]></xhtml:p> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
37 |
</start> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
38 |
<stop> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
39 |
<xhtml:p><![CDATA[ |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
40 |
]]></xhtml:p> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
41 |
</stop> |
e15ca67197b9
py_ext user python code can now know about global variables shared with PLC. updated tests/python accordingly
Edouard Tisserant
parents:
diff
changeset
|
42 |
</PyFile> |