# HG changeset patch
# User Edouard Tisserant
# Date 1569318959 -7200
# Node ID 39d78c530cbbc9724154d9cea7ab7b5394e76f00
# Parent e5ce6c4a8672d596c75aa973d75bbd37b4e425ab
Fixed unitialized parameter in instances_path stylesheet, leading to
calls to add_instance with no data when passing datatypes insteatd of project
root. That bug was making exceptions (for exemple when editing type) when
having arrays of derivated types in project.
diff -r e5ce6c4a8672 -r 39d78c530cbb plcopen/instances_path.xslt
--- a/plcopen/instances_path.xslt Sun Jul 14 08:43:12 2019 +0200
+++ b/plcopen/instances_path.xslt Tue Sep 24 11:55:59 2019 +0200
@@ -62,9 +62,9 @@
-
+
-
+
@@ -108,12 +108,12 @@
.
+
+
+
+
+
-
-
-
-
-
diff -r e5ce6c4a8672 -r 39d78c530cbb plcopen/instances_path.ysl2
--- a/plcopen/instances_path.ysl2 Sun Jul 14 08:43:12 2019 +0200
+++ b/plcopen/instances_path.ysl2 Tue Sep 24 11:55:59 2019 +0200
@@ -60,9 +60,9 @@
}
template "ppx:dataType" {
- param "instance_path";
+ param "instance_path","concat('#',@name)";
apply "ppx:baseType/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" {
- with "parent_path" > «$instance_path»
+ with "variable_path" > «$instance_path»
}
}
@@ -94,9 +94,9 @@
param "variable_path";
foreach "ppx:variable[ppx:type/ppx:derived or ppx:type/ppx:struct or ppx:type/ppx:array]" {
variable "element_path" > «$variable_path».«@name»
- }
- apply "ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" {
- with "variable_path" > «$element_path»
+ apply "ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" {
+ with "variable_path" > «$element_path»
+ }
}
}
diff -r e5ce6c4a8672 -r 39d78c530cbb tests/python/plc.xml
--- a/tests/python/plc.xml Sun Jul 14 08:43:12 2019 +0200
+++ b/tests/python/plc.xml Tue Sep 24 11:55:59 2019 +0200
@@ -1,7 +1,7 @@
-
+
@@ -49,6 +49,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -61,6 +71,9 @@
+
+
+
@@ -1351,6 +1364,11 @@
+
+
+
+
+
@@ -1372,6 +1390,9 @@
}}
(* If you do not use GetFbVar and SetFbVar macros, expect unexpected behaviour*)
Global_RS();
+
+(* testing access to global struct array *)
+Dudiduda[2].FIRSTBYTE := 0;
]]>
@@ -1442,6 +1463,11 @@
+
+
+
+
+