tests/canopen_slave/plc.xml
author |
Andrey Skvortsov <andrej.skvortzov@gmail.com> |
|
Tue, 05 Mar 2019 11:19:36 +0300 |
changeset 2519 |
27955f010b23 |
parent 2346 |
ac16bad593cf
|
permissions |
-rw-r--r-- |
Fix crash if LD input contact isn't connected
Traceback (most recent call last):
File "/home/developer/WorkData/PLC/beremiz/beremiz/BeremizIDE.py", line 339, in OnMethod
obj.CTR.CallMethod('_'+meth)
File "/home/developer/WorkData/PLC/beremiz/beremiz/ProjectController.py", line 1996, in CallMethod
getattr(self, method)()
File "/home/developer/WorkData/PLC/beremiz/beremiz/ProjectController.py", line 1134, in _Build
IECGenRes = self._Generate_SoftPLC()
File "/home/developer/WorkData/PLC/beremiz/beremiz/ProjectController.py", line 746, in _Generate_SoftPLC
if self._Generate_PLC_ST():
File "/home/developer/WorkData/PLC/beremiz/beremiz/ProjectController.py", line 763, in _Generate_PLC_ST
self._getIECgeneratedcodepath())
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCControler.py", line 456, in GenerateProgram
self.ProgramChunks = GenerateCurrentProgram(self, self.Project, errors, warnings)
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 1762, in GenerateCurrentProgram
generator.GenerateProgram()
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 478, in GenerateProgram
self.GeneratePouProgram(pou_name)
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 260, in GeneratePouProgram
program = pou_program.GenerateProgram(pou)
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 1718, in GenerateProgram
self.ComputeProgram(pou)
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 1028, in ComputeProgram
self.GenerateBlock(instance, block_infos, body, None)
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 1144, in GenerateBlock
expression = self.ComputeExpression(body, connections, executionOrderId > 0)
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 1373, in ComputeExpression
paths = self.GeneratePaths(connections, body, order, to_inout)
File "/home/developer/WorkData/PLC/beremiz/beremiz/PLCGenerator.py", line 1344, in GeneratePaths
elif isinstance(result[0], list):
IndexError: list index out of range
Close #70
<?xml version='1.0' encoding='utf-8'?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="beremiz" productName="beremiz" productVersion="1" creationDateTime="2008-06-24T18:44:00"/>
<contentHeader name="canopen_slave" modificationDateTime="2018-09-26T13:32:23" language="en-US">
<coordinateInfo>
<fbd>
<scaling x="0" y="0"/>
</fbd>
<ld>
<scaling x="0" y="0"/>
</ld>
<sfc>
<scaling x="0" y="0"/>
</sfc>
</coordinateInfo>
</contentHeader>
<types>
<dataTypes/>
<pous>
<pou name="test_main" pouType="program">
<interface>
<localVars>
<variable name="outvar" address="%QW0.0.8192.0">
<type>
<INT/>
</type>
</variable>
<variable name="invar" address="%IW0.0.8193.0">
<type>
<INT/>
</type>
</variable>
</localVars>
</interface>
<body>
<FBD>
<outVariable localId="1" height="29" width="80" executionOrderId="0" negated="false">
<position x="362" y="139"/>
<connectionPointIn>
<relPosition x="0" y="14"/>
<connection refLocalId="4" formalParameter="OUT">
<position x="362" y="153"/>
<position x="299" y="153"/>
</connection>
</connectionPointIn>
<expression>outvar</expression>
</outVariable>
<inVariable localId="2" height="29" width="20">
<position x="100" y="115"/>
<connectionPointOut>
<relPosition x="20" y="14"/>
</connectionPointOut>
<expression>1</expression>
</inVariable>
<block localId="4" width="75" height="60" typeName="ADD">
<position x="224" y="123"/>
<inputVariables>
<variable formalParameter="IN1">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="2">
<position x="224" y="153"/>
<position x="183" y="153"/>
<position x="183" y="129"/>
<position x="120" y="129"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="IN2">
<connectionPointIn>
<relPosition x="0" y="50"/>
<connection refLocalId="5">
<position x="224" y="173"/>
<position x="187" y="173"/>
<position x="187" y="187"/>
<position x="150" y="187"/>
</connection>
</connectionPointIn>
</variable>
</inputVariables>
<inOutVariables/>
<outputVariables>
<variable formalParameter="OUT">
<connectionPointOut>
<relPosition x="75" y="30"/>
</connectionPointOut>
</variable>
</outputVariables>
</block>
<inVariable localId="5" height="29" width="60">
<position x="90" y="173"/>
<connectionPointOut>
<relPosition x="60" y="14"/>
</connectionPointOut>
<expression>invar</expression>
</inVariable>
</FBD>
</body>
</pou>
</pous>
</types>
<instances>
<configurations>
<configuration name="conf">
<resource name="res">
<task name="tache" interval="T#10ms" priority="0">
<pouInstance name="toto" typeName="test_main"/>
</task>
</resource>
</configuration>
</configurations>
</instances>
</project>