Fixed bug in actionBlock actions editing
authorLaurent Bessard
Wed, 02 Oct 2013 17:23:44 +0200
changeset 1339 6adf05c4508d
parent 1338 c1e6c712cc35
child 1340 7e5702d1f246
Fixed bug in actionBlock actions editing
PLCControler.py
dialogs/ActionBlockDialog.py
graphics/SFC_Objects.py
plcopen/plcopen.py
plcopen/pou_block_instances.xslt
plcopen/pou_block_instances.ysl2
--- a/PLCControler.py	Wed Oct 02 01:21:35 2013 +0200
+++ b/PLCControler.py	Wed Oct 02 17:23:44 2013 +0200
@@ -419,8 +419,13 @@
 _ConnectionLinkInfos = namedtuple("ConnectionLinkInfos",
     ["refLocalId", "formalParameter", "points"])
 
-_ActionInfos = namedtuple("ActionInfos",
-    ["qualifier", "type", "value", "duration", "indicator"])
+class _ActionInfos:
+    __slots__ = ["qualifier", "type", "value", "duration", "indicator"]
+    def __init__(self, *args):
+        for attr, value in zip(self.__slots__, args):
+            setattr(self, attr, value if value is not None else "")
+    def copy(self):
+        return _ActionInfos(*[getattr(self, attr) for attr in self.__slots__])
 
 def _translate_args(translations, args):
     return [translate(arg[0]) if len(arg) > 0 else None 
@@ -490,8 +495,6 @@
         if len(self.SpecificValues) == 0:
             self.SpecificValues.append([[]])
         translated_args = _translate_args([str] * 5, args)
-        if translated_args[0] is None:
-            translated_args[0] = ""
         self.SpecificValues[0][0].append(_ActionInfos(*translated_args))
     
 pou_block_instances_xslt = etree.parse(
--- a/dialogs/ActionBlockDialog.py	Wed Oct 02 01:21:35 2013 +0200
+++ b/dialogs/ActionBlockDialog.py	Wed Oct 02 17:23:44 2013 +0200
@@ -27,6 +27,7 @@
 
 from controls import CustomGrid, CustomTable
 from util.BitmapLibrary import GetBitmap
+from PLCControler import _ActionInfos
 
 #-------------------------------------------------------------------------------
 #                                  Helpers
@@ -49,17 +50,19 @@
     def GetValue(self, row, col):
         if row < self.GetNumberRows():
             colname = self.GetColLabelValue(col, False)
-            name = str(self.data[row].get(colname, ""))
+            value = getattr(self.data[row], colname.lower())
             if colname == "Type":
-                return _(name)
-            return name
+                return _(value)
+            return value
     
     def SetValue(self, row, col, value):
         if col < len(self.colnames):
             colname = self.GetColLabelValue(col, False)
             if colname == "Type":
                 value = self.Parent.TranslateType[value]
-            self.data[row][colname] = value
+            elif colname == "Qualifier" and not self.Parent.DurationList[value]:
+                self.data[row].duration = ""
+            setattr(self.data[row], colname.lower(), value)
         
     def _updateColAttrs(self, grid):
         """
@@ -81,23 +84,19 @@
                 if colname == "Duration":
                     editor = wx.grid.GridCellTextEditor()
                     renderer = wx.grid.GridCellStringRenderer()
-                    if self.Parent.DurationList[self.data[row]["Qualifier"]]:
-                        readonly = False
-                    else:
-                        readonly = True
-                        self.data[row]["Duration"] = ""
+                    readonly = not self.Parent.DurationList[self.data[row].qualifier]
                 elif colname == "Type":
                     editor = wx.grid.GridCellChoiceEditor()
                     editor.SetParameters(self.Parent.TypeList)
                 elif colname == "Value":
-                    type = self.data[row]["Type"]
-                    if type == "Action":
+                    value_type = self.data[row].type
+                    if value_type == "Action":
                         editor = wx.grid.GridCellChoiceEditor()
                         editor.SetParameters(self.Parent.ActionList)
-                    elif type == "Variable":
+                    elif value_type == "Variable":
                         editor = wx.grid.GridCellChoiceEditor()
                         editor.SetParameters(self.Parent.VariableList)
-                    elif type == "Inline":
+                    elif value_type == "Inline":
                         editor = wx.grid.GridCellTextEditor()
                         renderer = wx.grid.GridCellStringRenderer()
                 elif colname == "Indicator":
@@ -168,11 +167,7 @@
         self.ColAlignements = [wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT]
         
         self.ActionsGrid.SetTable(self.Table)
-        self.ActionsGrid.SetDefaultValue({"Qualifier" : "N", 
-                                          "Duration" : "", 
-                                          "Type" : "Action", 
-                                          "Value" : "", 
-                                          "Indicator" : ""})
+        self.ActionsGrid.SetDefaultValue(_ActionInfos("N", "Action", "", "", ""))
         self.ActionsGrid.SetButtons({"Add": self.AddButton,
                                      "Delete": self.DeleteButton,
                                      "Up": self.UpButton,
@@ -199,7 +194,7 @@
         event.Skip()
     
     def SetQualifierList(self, list):
-        self.QualifierList = "," + ",".join(list)
+        self.QualifierList = ",".join(list)
         self.DurationList = list
 
     def SetVariableList(self, list):
@@ -210,41 +205,23 @@
 
     def SetValues(self, actions):
         for action in actions:
-            row = {"Qualifier" : action["qualifier"], "Value" : action["value"]}
-            if action["type"] == "reference":
-                if action["value"] in self.ActionList:
-                    row["Type"] = "Action"
-                elif action["value"] in self.VariableList:
-                    row["Type"] = "Variable"
-                else:
-                    row["Type"] = "Inline"
+            if action.type == "reference" and action.value in self.ActionList:
+                action.type = "Action"
+            elif action.type == "reference" and action.value in self.VariableList:
+                action.type = "Variable"
             else:
-                row["Type"] = "Inline"
-            if "duration" in action:
-                row["Duration"] = action["duration"]
-            else:
-                row["Duration"] = ""
-            if "indicator" in action:
-                row["Indicator"] = action["indicator"]
-            else:
-                row["Indicator"] = ""
-            self.Table.AppendRow(row)
+                action.type = "Inline"
+        self.Table.SetData(actions)
         self.Table.ResetView(self.ActionsGrid)
         if len(actions) > 0:
             self.ActionsGrid.SetGridCursor(0, 0)
         self.ActionsGrid.RefreshButtons()
     
     def GetValues(self):
-        values = []
-        for data in self.Table.GetData():
-            action = {"qualifier" : data["Qualifier"], "value" : data["Value"]}
-            if data["Type"] in ["Action", "Variable"]:
-                action["type"] = "reference"
+        actions = self.Table.GetData()
+        for action in actions:
+            if action.type in ["Action", "Variable"]:
+                action.type = "reference"
             else:
-                action["type"] = "inline"
-            if data["Duration"] != "":
-                action["duration"] = data["Duration"]
-            if data["Indicator"] != "":
-                action["indicator"] = data["Indicator"]
-            values.append(action)
-        return values
+                action.type = "inline"
+        return actions
--- a/graphics/SFC_Objects.py	Wed Oct 02 01:21:35 2013 +0200
+++ b/graphics/SFC_Objects.py	Wed Oct 02 17:23:44 2013 +0200
@@ -1894,17 +1894,18 @@
         self.ColSize = [0, 0, 0]
         min_height = 0
         for action in self.Actions:
-            width, height = self.Parent.GetTextExtent(action.qualifier)
+            width, height = self.Parent.GetTextExtent(
+                action.qualifier if action.qualifier != "" else "N")
             self.ColSize[0] = max(self.ColSize[0], width + 10)
             row_height = height
-            if action.duration is not None:
+            if action.duration != "":
                 width, height = self.Parent.GetTextExtent(action.duration)
                 row_height = max(row_height, height)
                 self.ColSize[0] = max(self.ColSize[0], width + 10)
             width, height = self.Parent.GetTextExtent(action.value)
             row_height = max(row_height, height)
             self.ColSize[1] = max(self.ColSize[1], width + 10)
-            if action.indicator is not None:
+            if action.indicator != "":
                 width, height = self.Parent.GetTextExtent(action.indicator)
                 row_height = max(row_height, height)
                 self.ColSize[2] = max(self.ColSize[2], width + 10)
@@ -1920,7 +1921,7 @@
             self.MinSize = max(self.ColSize[0] + self.ColSize[1] + self.ColSize[2],
                 SFC_ACTION_MIN_SIZE[0]), len(self.Actions) * SFC_ACTION_MIN_SIZE[1]
             self.RefreshBoundingBox()
-            if self.Input:
+            if self.Input is not None:
                 wires = self.Input.GetWires()
                 if len(wires) == 1:
                     input_block = wires[0][0].GetOtherConnected(self.Input).GetParentBlock()
@@ -2023,7 +2024,7 @@
                 dc.DrawLine(self.Pos.x, self.Pos.y + i * line_size, 
                     self.Pos.x + self.Size[0], self.Pos.y + i * line_size)
             qualifier_size = dc.GetTextExtent(action.qualifier)
-            if action.duration is not None:
+            if action.duration != "":
                 qualifier_pos = (self.Pos.x + (colsize[0] - qualifier_size[0]) / 2,
                                  self.Pos.y + i * line_size + line_size / 2 - qualifier_size[1])
                 duration_size = dc.GetTextExtent(action.duration)
@@ -2038,7 +2039,7 @@
             content_pos = (self.Pos.x + colsize[0] + (colsize[1] - content_size[0]) / 2,
                            self.Pos.y + i * line_size + (line_size - content_size[1]) / 2)
             dc.DrawText(action.value, content_pos[0], content_pos[1])
-            if action.indicator is not None:
+            if action.indicator != "":
                 indicator_size = dc.GetTextExtent(action.indicator)
                 indicator_pos = (self.Pos.x + colsize[0] + colsize[1] + (colsize[2] - indicator_size[0]) / 2,
                                  self.Pos.y + i * line_size + (line_size - indicator_size[1]) / 2)
--- a/plcopen/plcopen.py	Wed Oct 02 01:21:35 2013 +0200
+++ b/plcopen/plcopen.py	Wed Oct 02 17:23:44 2013 +0200
@@ -49,8 +49,9 @@
 """
 Define which action qualifier must be associated with a duration 
 """
-QualifierList = {"N" : False, "R" : False, "S" : False, "L" : True, "D" : True, 
-    "P" : False, "P0" : False, "P1" : False, "SD" : True, "DS" : True, "SL" : True}
+QualifierList = OrderedDict([("N", False), ("R", False), ("S", False), 
+    ("L", True), ("D", True), ("P", False), ("P0", False), 
+    ("P1", False), ("SD", True), ("DS", True), ("SL", True)])
 
 
 FILTER_ADDRESS_MODEL = "(%%[IQM](?:[XBWDL])?)(%s)((?:\.[0-9]+)*)" 
@@ -218,7 +219,7 @@
                 
                 # Update resources pou instance attributes
                 for pouInstance in ResourceInstancesXpath(resource):
-                    type_name = pouInstance.get("type")
+                    type_name = pouInstance.attrib.pop("type")
                     if type_name is not None:
                         pouInstance.set("typeName", type_name)
             
@@ -2148,17 +2149,17 @@
         for params in actions:
             action = PLCOpenParser.CreateElement("action", "actionBlock")
             self.appendaction(action)
-            action.setqualifier(params["qualifier"])
-            if params["type"] == "reference":
+            action.setqualifier(params.qualifier)
+            if params.type == "reference":
                 action.addreference()
-                action.setreferenceName(params["value"])
+                action.setreferenceName(params.value)
             else:
                 action.addinline()
-                action.setinlineContent(params["value"])
-            if params.has_key("duration"):
-                action.setduration(params["duration"])
-            if params.has_key("indicator"):
-                action.setindicator(params["indicator"])
+                action.setinlineContent(params.value)
+            if params.duration != "":
+                action.setduration(params.duration)
+            if params.indicator != "":
+                action.setindicator(params.indicator)
     setattr(cls, "setactions", setactions)
 
     def getactions(self):
--- a/plcopen/pou_block_instances.xslt	Wed Oct 02 01:21:35 2013 +0200
+++ b/plcopen/pou_block_instances.xslt	Wed Oct 02 17:23:44 2013 +0200
@@ -1,1 +1,1 @@
-<xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:dyn="http://exslt.org/dynamic" xmlns:str="http://exslt.org/strings" xmlns:math="http://exslt.org/math" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="ns" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:yml="http://fdik.org/yml" xmlns:set="http://exslt.org/sets" version="1.0" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="pou_block_instances_ns" exclude-result-prefixes="ns" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml"/><xsl:variable name="space" select="'                                                                                                                                                                                                        '"/><xsl:param name="autoindent" select="4"/><xsl:template match="text()"><xsl:param name="_indent" select="0"/></xsl:template><xsl:template match="ppx:pou"><xsl:param name="_indent" select="0"/><xsl:apply-templates select="ppx:body/*[self::ppx:FBD or self::ppx:LD or self::ppx:SFC]/*"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template name="add_instance"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:variable name="instance"><xsl:value-of select="ns:AddBlockInstance($type, @localId, ppx:position/@x, ppx:position/@y, @width, @height)"/></xsl:variable></xsl:template><xsl:template name="execution_order"><xsl:param name="_indent" select="0"/><xsl:choose><xsl:when test="@executionOrderId"><xsl:value-of select="@executionOrderId"/></xsl:when><xsl:otherwise><xsl:text>0</xsl:text></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="ConnectionInfos"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:param name="modifiers"/><xsl:param name="formalParameter"/><xsl:variable name="negated"><xsl:choose><xsl:when test="$modifiers='input'"><xsl:value-of select="@negatedIn"/></xsl:when><xsl:when test="$modifiers='output'"><xsl:value-of select="@negatedOut"/></xsl:when><xsl:otherwise><xsl:value-of select="@negated"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="edge"><xsl:choose><xsl:when test="$modifiers='input'"><xsl:value-of select="@edgeIn"/></xsl:when><xsl:when test="$modifiers='output'"><xsl:value-of select="@edgeOut"/></xsl:when><xsl:otherwise><xsl:value-of select="@edge"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_connection"><xsl:value-of select="ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)"/></xsl:variable></xsl:template><xsl:template match="ppx:position"><xsl:param name="_indent" select="0"/><xsl:variable name="link_point"><xsl:value-of select="ns:AddLinkPoint(@x, @y)"/></xsl:variable></xsl:template><xsl:template match="ppx:connection"><xsl:param name="_indent" select="0"/><xsl:variable name="connection_link"><xsl:value-of select="ns:AddConnectionLink(@refLocalId, @formalParameter)"/></xsl:variable><xsl:apply-templates select="ppx:position"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:connectionPointIn"><xsl:param name="_indent" select="0"/><xsl:param name="modifiers"/><xsl:param name="formalParameter"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>input</xsl:text></xsl:with-param><xsl:with-param name="modifiers"><xsl:value-of select="$modifiers"/></xsl:with-param><xsl:with-param name="formalParameter"><xsl:value-of select="$formalParameter"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connection"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:connectionPointOut"><xsl:param name="_indent" select="0"/><xsl:param name="modifiers"/><xsl:param name="formalParameter"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>output</xsl:text></xsl:with-param><xsl:with-param name="modifiers"><xsl:value-of select="$modifiers"/></xsl:with-param><xsl:with-param name="formalParameter"><xsl:value-of select="$formalParameter"/></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:connectionPointOutAction"><xsl:param name="_indent" select="0"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>output</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:comment"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(ppx:content/xhtml:p/text())"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:block"><xsl:param name="_indent" select="0"/><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@instanceName, $execution_order)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="@typeName"/></xsl:with-param></xsl:call-template><xsl:for-each select="ppx:inputVariables/ppx:variable"><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="formalParameter"><xsl:value-of select="@formalParameter"/></xsl:with-param></xsl:apply-templates></xsl:for-each><xsl:for-each select="ppx:outputVariables/ppx:variable"><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="formalParameter"><xsl:value-of select="@formalParameter"/></xsl:with-param></xsl:apply-templates></xsl:for-each></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived"><xsl:param name="_indent" select="0"/><xsl:value-of select="@name"/></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string"><xsl:param name="_indent" select="0"/><xsl:text>STRING</xsl:text></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring"><xsl:param name="_indent" select="0"/><xsl:text>WSTRING</xsl:text></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*"><xsl:param name="_indent" select="0"/><xsl:value-of select="local-name()"/></xsl:template><xsl:template name="VariableBlockInfos"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:variable name="expression"><xsl:value-of select="ppx:expression/text()"/></xsl:variable><xsl:variable name="value_type"><xsl:choose><xsl:when test="ancestor::ppx:transition[@name=$expression]"><xsl:text>BOOL</xsl:text></xsl:when><xsl:when test="ancestor::ppx:pou[@name=$expression]"><xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/ppx:returnType"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/*/ppx:variable[@name=$expression]/ppx:type"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($expression, $value_type, $execution_order)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="modifiers"><xsl:choose><xsl:when test="$type='inout'"><xsl:text>input</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:with-param></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="modifiers"><xsl:choose><xsl:when test="$type='inout'"><xsl:text>output</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:with-param></xsl:apply-templates></xsl:template><xsl:template match="ppx:inVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'input'"/></xsl:call-template></xsl:template><xsl:template match="ppx:outVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'output'"/></xsl:call-template></xsl:template><xsl:template match="ppx:inOutVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'inout'"/></xsl:call-template></xsl:template><xsl:template match="ppx:connector|ppx:continuation"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@name)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:leftPowerRail|ppx:rightPowerRail"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="connectors"><xsl:choose><xsl:when test="$type='leftPowerRail'"><xsl:value-of select="count(ppx:connectionPointOut)"/></xsl:when><xsl:otherwise><xsl:value-of select="count(ppx:connectionPointIn)"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($connectors)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:choose><xsl:when test="$type='leftPowerRail'"><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:template><xsl:template match="ppx:contact|ppx:coil"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="storage"><xsl:choose><xsl:when test="$type='coil'"><xsl:value-of select="@storage"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(ppx:variable/text(), @negated, @edge, $storage, $execution_order)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:step"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@name, @initialStep)"/></xsl:variable><xsl:apply-templates select="ppx:connectionPointOutAction"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:transition"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="priority"><xsl:choose><xsl:when test="@priority"><xsl:value-of select="@priority"/></xsl:when><xsl:otherwise><xsl:text>0</xsl:text></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="condition_type"><xsl:choose><xsl:when test="ppx:condition/ppx:connectionPointIn"><xsl:text>connection</xsl:text></xsl:when><xsl:when test="ppx:condition/ppx:reference"><xsl:text>reference</xsl:text></xsl:when><xsl:when test="ppx:condition/ppx:inline"><xsl:text>inline</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="condition"><xsl:choose><xsl:when test="ppx:reference"><xsl:value-of select="ppx:condition/ppx:reference/@name"/></xsl:when><xsl:when test="ppx:inline"><xsl:value-of select="ppx:condition/ppx:inline/ppx:body/ppx:ST/xhtml:p/text()"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($priority, $condition_type, $condition)"/></xsl:variable><xsl:apply-templates select="ppx:condition/ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:selectionDivergence|ppx:selectionConvergence|ppx:simultaneousDivergence|ppx:simultaneousConvergence"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="connectors"><xsl:choose><xsl:when test="ppx:selectionDivergence|ppx:simultaneousDivergence"><xsl:value-of select="count(ppx:connectionPointOut)"/></xsl:when><xsl:otherwise><xsl:value-of select="count(ppx:connectionPointIn)"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($connectors)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:jumpStep"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:text>jump</xsl:text></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@targetName)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:action"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:choose><xsl:when test="ppx:reference"><xsl:text>reference</xsl:text></xsl:when><xsl:when test="ppx:inline"><xsl:text>inline</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="value"><xsl:choose><xsl:when test="ppx:reference"><xsl:value-of select="ppx:reference/@name"/></xsl:when><xsl:when test="ppx:inline"><xsl:value-of select="ppx:inline/ppx:ST/xhtml:p/text()"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="actionBlock_action"><xsl:value-of select="ns:AddAction(@qualifier, $type, $value, @duration, @indicator)"/></xsl:variable></xsl:template><xsl:template match="ppx:actionBlock"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues()"/></xsl:variable><xsl:apply-templates select="ppx:action"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template></xsl:stylesheet>
\ No newline at end of file
+<xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:dyn="http://exslt.org/dynamic" xmlns:str="http://exslt.org/strings" xmlns:math="http://exslt.org/math" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="ns" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:yml="http://fdik.org/yml" xmlns:set="http://exslt.org/sets" version="1.0" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="pou_block_instances_ns" exclude-result-prefixes="ns" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml"/><xsl:variable name="space" select="'                                                                                                                                                                                                        '"/><xsl:param name="autoindent" select="4"/><xsl:template match="text()"><xsl:param name="_indent" select="0"/></xsl:template><xsl:template match="ppx:pou"><xsl:param name="_indent" select="0"/><xsl:apply-templates select="ppx:body/*[self::ppx:FBD or self::ppx:LD or self::ppx:SFC]/*"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template name="add_instance"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:variable name="instance"><xsl:value-of select="ns:AddBlockInstance($type, @localId, ppx:position/@x, ppx:position/@y, @width, @height)"/></xsl:variable></xsl:template><xsl:template name="execution_order"><xsl:param name="_indent" select="0"/><xsl:choose><xsl:when test="@executionOrderId"><xsl:value-of select="@executionOrderId"/></xsl:when><xsl:otherwise><xsl:text>0</xsl:text></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="ConnectionInfos"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:param name="modifiers"/><xsl:param name="formalParameter"/><xsl:variable name="negated"><xsl:choose><xsl:when test="$modifiers='input'"><xsl:value-of select="@negatedIn"/></xsl:when><xsl:when test="$modifiers='output'"><xsl:value-of select="@negatedOut"/></xsl:when><xsl:otherwise><xsl:value-of select="@negated"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="edge"><xsl:choose><xsl:when test="$modifiers='input'"><xsl:value-of select="@edgeIn"/></xsl:when><xsl:when test="$modifiers='output'"><xsl:value-of select="@edgeOut"/></xsl:when><xsl:otherwise><xsl:value-of select="@edge"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_connection"><xsl:value-of select="ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)"/></xsl:variable></xsl:template><xsl:template match="ppx:position"><xsl:param name="_indent" select="0"/><xsl:variable name="link_point"><xsl:value-of select="ns:AddLinkPoint(@x, @y)"/></xsl:variable></xsl:template><xsl:template match="ppx:connection"><xsl:param name="_indent" select="0"/><xsl:variable name="connection_link"><xsl:value-of select="ns:AddConnectionLink(@refLocalId, @formalParameter)"/></xsl:variable><xsl:apply-templates select="ppx:position"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:connectionPointIn"><xsl:param name="_indent" select="0"/><xsl:param name="modifiers"/><xsl:param name="formalParameter"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>input</xsl:text></xsl:with-param><xsl:with-param name="modifiers"><xsl:value-of select="$modifiers"/></xsl:with-param><xsl:with-param name="formalParameter"><xsl:value-of select="$formalParameter"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connection"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:connectionPointOut"><xsl:param name="_indent" select="0"/><xsl:param name="modifiers"/><xsl:param name="formalParameter"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>output</xsl:text></xsl:with-param><xsl:with-param name="modifiers"><xsl:value-of select="$modifiers"/></xsl:with-param><xsl:with-param name="formalParameter"><xsl:value-of select="$formalParameter"/></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:connectionPointOutAction"><xsl:param name="_indent" select="0"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>output</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:comment"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(ppx:content/xhtml:p/text())"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:block"><xsl:param name="_indent" select="0"/><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@instanceName, $execution_order)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="@typeName"/></xsl:with-param></xsl:call-template><xsl:for-each select="ppx:inputVariables/ppx:variable"><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="formalParameter"><xsl:value-of select="@formalParameter"/></xsl:with-param></xsl:apply-templates></xsl:for-each><xsl:for-each select="ppx:outputVariables/ppx:variable"><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="formalParameter"><xsl:value-of select="@formalParameter"/></xsl:with-param></xsl:apply-templates></xsl:for-each></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived"><xsl:param name="_indent" select="0"/><xsl:value-of select="@name"/></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string"><xsl:param name="_indent" select="0"/><xsl:text>STRING</xsl:text></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring"><xsl:param name="_indent" select="0"/><xsl:text>WSTRING</xsl:text></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*"><xsl:param name="_indent" select="0"/><xsl:value-of select="local-name()"/></xsl:template><xsl:template name="VariableBlockInfos"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:variable name="expression"><xsl:value-of select="ppx:expression/text()"/></xsl:variable><xsl:variable name="value_type"><xsl:choose><xsl:when test="ancestor::ppx:transition[@name=$expression]"><xsl:text>BOOL</xsl:text></xsl:when><xsl:when test="ancestor::ppx:pou[@name=$expression]"><xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/ppx:returnType"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/*/ppx:variable[@name=$expression]/ppx:type"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($expression, $value_type, $execution_order)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="modifiers"><xsl:choose><xsl:when test="$type='inout'"><xsl:text>input</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:with-param></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="modifiers"><xsl:choose><xsl:when test="$type='inout'"><xsl:text>output</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:with-param></xsl:apply-templates></xsl:template><xsl:template match="ppx:inVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'input'"/></xsl:call-template></xsl:template><xsl:template match="ppx:outVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'output'"/></xsl:call-template></xsl:template><xsl:template match="ppx:inOutVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'inout'"/></xsl:call-template></xsl:template><xsl:template match="ppx:connector|ppx:continuation"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@name)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:leftPowerRail|ppx:rightPowerRail"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="connectors"><xsl:choose><xsl:when test="$type='leftPowerRail'"><xsl:value-of select="count(ppx:connectionPointOut)"/></xsl:when><xsl:otherwise><xsl:value-of select="count(ppx:connectionPointIn)"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($connectors)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:choose><xsl:when test="$type='leftPowerRail'"><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:template><xsl:template match="ppx:contact|ppx:coil"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="storage"><xsl:choose><xsl:when test="$type='coil'"><xsl:value-of select="@storage"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(ppx:variable/text(), @negated, @edge, $storage, $execution_order)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:step"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@name, @initialStep)"/></xsl:variable><xsl:apply-templates select="ppx:connectionPointOutAction"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:transition"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="priority"><xsl:choose><xsl:when test="@priority"><xsl:value-of select="@priority"/></xsl:when><xsl:otherwise><xsl:text>0</xsl:text></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="condition_type"><xsl:choose><xsl:when test="ppx:condition/ppx:connectionPointIn"><xsl:text>connection</xsl:text></xsl:when><xsl:when test="ppx:condition/ppx:reference"><xsl:text>reference</xsl:text></xsl:when><xsl:when test="ppx:condition/ppx:inline"><xsl:text>inline</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="condition"><xsl:choose><xsl:when test="ppx:reference"><xsl:value-of select="ppx:condition/ppx:reference/@name"/></xsl:when><xsl:when test="ppx:inline"><xsl:value-of select="ppx:condition/ppx:inline/ppx:body/ppx:ST/xhtml:p/text()"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($priority, $condition_type, $condition)"/></xsl:variable><xsl:apply-templates select="ppx:condition/ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:selectionDivergence|ppx:selectionConvergence|ppx:simultaneousDivergence|ppx:simultaneousConvergence"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="connectors"><xsl:choose><xsl:when test="ppx:selectionDivergence|ppx:simultaneousDivergence"><xsl:value-of select="count(ppx:connectionPointOut)"/></xsl:when><xsl:otherwise><xsl:value-of select="count(ppx:connectionPointIn)"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($connectors)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:jumpStep"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:text>jump</xsl:text></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@targetName)"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:action"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:choose><xsl:when test="ppx:reference"><xsl:text>reference</xsl:text></xsl:when><xsl:when test="ppx:inline"><xsl:text>inline</xsl:text></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="value"><xsl:choose><xsl:when test="ppx:reference"><xsl:value-of select="ppx:reference/@name"/></xsl:when><xsl:when test="ppx:inline"><xsl:value-of select="ppx:inline/ppx:ST/xhtml:p/text()"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="qualifier"><xsl:choose><xsl:when test="@qualifier=''"></xsl:when><xsl:when test="@qualifier"><xsl:value-of select="@qualifier"/></xsl:when><xsl:otherwise><xsl:text>N</xsl:text></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="actionBlock_action"><xsl:value-of select="ns:AddAction($qualifier, $type, $value, @duration, @indicator)"/></xsl:variable></xsl:template><xsl:template match="ppx:actionBlock"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues()"/></xsl:variable><xsl:apply-templates select="ppx:action"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template></xsl:stylesheet>
\ No newline at end of file
--- a/plcopen/pou_block_instances.ysl2	Wed Oct 02 01:21:35 2013 +0200
+++ b/plcopen/pou_block_instances.ysl2	Wed Oct 02 17:23:44 2013 +0200
@@ -339,8 +339,14 @@
                 otherwise > 
             }
         }
+        variable "qualifier" {
+            choose {
+                when "@qualifier" > «@qualifier»
+                otherwise > N
+            }
+        }
         variable "actionBlock_action" {
-            > «ns:AddAction(@qualifier, $type, $value, @duration, @indicator)»
+            > «ns:AddAction($qualifier, $type, $value, @duration, @indicator)»
         }
     }