Modbus: allows modbus thread stack size customization with MODBUS_STACK_SIZE macro.
For example, add "-DMODBUS_STACK_SIZE=0x2000" to target CFLAGS to limit stack size to 128kB
<?xml version='1.0' encoding='utf-8'?>
<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/>
<contentHeader name="First Steps" modificationDateTime="2024-07-25T16:55:27">
<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="plc_prg" pouType="program">
<interface>
<localVars>
<variable name="LocalVar0">
<type>
<DINT/>
</type>
<initialValue>
<simpleValue value="0"/>
</initialValue>
</variable>
</localVars>
<localVars>
<variable name="LocalVar1" address="%QD0.2">
<type>
<DINT/>
</type>
</variable>
<variable name="LocalVar2" address="%ID0.2">
<type>
<DINT/>
</type>
</variable>
</localVars>
</interface>
<body>
<FBD>
<inVariable localId="1" executionOrderId="0" height="27" width="82" negated="false">
<position x="421" y="83"/>
<connectionPointOut>
<relPosition x="82" y="13"/>
</connectionPointOut>
<expression>LocalVar0</expression>
</inVariable>
<inVariable localId="3" executionOrderId="0" height="27" width="82" negated="false">
<position x="126" y="224"/>
<connectionPointOut>
<relPosition x="82" y="13"/>
</connectionPointOut>
<expression>LocalVar2</expression>
</inVariable>
<block localId="4" typeName="ADD" executionOrderId="0" height="60" width="63">
<position x="112" y="48"/>
<inputVariables>
<variable formalParameter="IN1">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="2">
<position x="112" y="78"/>
<position x="102" y="78"/>
<position x="102" y="33"/>
<position x="314" y="33"/>
<position x="314" y="78"/>
<position x="291" y="78"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="IN2">
<connectionPointIn>
<relPosition x="0" y="50"/>
<connection refLocalId="5">
<position x="112" y="98"/>
<position x="64" y="98"/>
</connection>
</connectionPointIn>
</variable>
</inputVariables>
<inOutVariables/>
<outputVariables>
<variable formalParameter="OUT">
<connectionPointOut>
<relPosition x="63" y="30"/>
</connectionPointOut>
</variable>
</outputVariables>
</block>
<inOutVariable localId="2" executionOrderId="0" height="27" width="82" negatedOut="false" negatedIn="false">
<position x="209" y="65"/>
<connectionPointIn>
<relPosition x="0" y="13"/>
<connection refLocalId="4" formalParameter="OUT">
<position x="209" y="78"/>
<position x="175" y="78"/>
</connection>
</connectionPointIn>
<connectionPointOut>
<relPosition x="82" y="13"/>
</connectionPointOut>
<expression>LocalVar0</expression>
</inOutVariable>
<inVariable localId="5" executionOrderId="0" height="27" width="18" negated="false">
<position x="46" y="85"/>
<connectionPointOut>
<relPosition x="18" y="13"/>
</connectionPointOut>
<expression>1</expression>
</inVariable>
<block localId="6" typeName="MOD" executionOrderId="0" height="60" width="63">
<position x="588" y="66"/>
<inputVariables>
<variable formalParameter="IN1">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="1">
<position x="588" y="96"/>
<position x="503" y="96"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="IN2">
<connectionPointIn>
<relPosition x="0" y="50"/>
<connection refLocalId="7">
<position x="588" y="116"/>
<position x="548" y="116"/>
</connection>
</connectionPointIn>
</variable>
</inputVariables>
<inOutVariables/>
<outputVariables>
<variable formalParameter="OUT">
<connectionPointOut>
<relPosition x="63" y="30"/>
</connectionPointOut>
</variable>
</outputVariables>
</block>
<inVariable localId="7" executionOrderId="0" height="27" width="26" negated="false">
<position x="522" y="103"/>
<connectionPointOut>
<relPosition x="26" y="13"/>
</connectionPointOut>
<expression>50</expression>
</inVariable>
<block localId="8" typeName="GT" executionOrderId="0" height="60" width="63">
<position x="721" y="65"/>
<inputVariables>
<variable formalParameter="IN1">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="6" formalParameter="OUT">
<position x="721" y="95"/>
<position x="704" y="95"/>
<position x="704" y="96"/>
<position x="651" y="96"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="IN2">
<connectionPointIn>
<relPosition x="0" y="50"/>
<connection refLocalId="9">
<position x="721" y="115"/>
<position x="709" y="115"/>
<position x="709" y="117"/>
<position x="697" y="117"/>
</connection>
</connectionPointIn>
</variable>
</inputVariables>
<inOutVariables/>
<outputVariables>
<variable formalParameter="OUT">
<connectionPointOut>
<relPosition x="63" y="30"/>
</connectionPointOut>
</variable>
</outputVariables>
</block>
<inVariable localId="9" executionOrderId="0" height="27" width="26" negated="false">
<position x="671" y="104"/>
<connectionPointOut>
<relPosition x="26" y="13"/>
</connectionPointOut>
<expression>24</expression>
</inVariable>
<outVariable localId="10" executionOrderId="0" height="27" width="82" negated="false">
<position x="1112" y="106"/>
<connectionPointIn>
<relPosition x="0" y="13"/>
<connection refLocalId="11" formalParameter="OUT">
<position x="1112" y="119"/>
<position x="1065" y="119"/>
<position x="1065" y="83"/>
<position x="1019" y="83"/>
</connection>
</connectionPointIn>
<expression>LocalVar1</expression>
</outVariable>
<block localId="11" typeName="SEL" executionOrderId="0" height="80" width="63">
<position x="956" y="53"/>
<inputVariables>
<variable formalParameter="G">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="8" formalParameter="OUT">
<position x="956" y="83"/>
<position x="870" y="83"/>
<position x="870" y="95"/>
<position x="784" y="95"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="IN0">
<connectionPointIn>
<relPosition x="0" y="50"/>
<connection refLocalId="12">
<position x="956" y="103"/>
<position x="927" y="103"/>
<position x="927" y="115"/>
<position x="898" y="115"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="IN1">
<connectionPointIn>
<relPosition x="0" y="70"/>
<connection refLocalId="13">
<position x="956" y="123"/>
<position x="933" y="123"/>
<position x="933" y="171"/>
<position x="910" y="171"/>
</connection>
</connectionPointIn>
</variable>
</inputVariables>
<inOutVariables/>
<outputVariables>
<variable formalParameter="OUT">
<connectionPointOut>
<relPosition x="63" y="30"/>
</connectionPointOut>
</variable>
</outputVariables>
</block>
<inVariable localId="12" executionOrderId="0" height="27" width="34" negated="false">
<position x="872" y="102"/>
<connectionPointOut>
<relPosition x="34" y="13"/>
</connectionPointOut>
<expression>666</expression>
</inVariable>
<inVariable localId="13" executionOrderId="0" height="27" width="34" negated="false">
<position x="876" y="158"/>
<connectionPointOut>
<relPosition x="34" y="13"/>
</connectionPointOut>
<expression>666</expression>
</inVariable>
</FBD>
</body>
</pou>
</pous>
</types>
<instances>
<configurations>
<configuration name="config">
<resource name="resource1">
<task name="plc_task" priority="1" interval="T#100ms">
<pouInstance name="plc_task_instance" typeName="plc_prg"/>
</task>
</resource>
<globalVars constant="true">
<variable name="ResetCounterValue">
<type>
<INT/>
</type>
<initialValue>
<simpleValue value="17"/>
</initialValue>
</variable>
</globalVars>
</configuration>
</configurations>
</instances>
</project>