TestTheStack.can
Fixed small bug
This commit is contained in:
parent
77d5eb5137
commit
4c508f7653
2 changed files with 9 additions and 17 deletions
|
@ -1,6 +1,8 @@
|
|||
/*@!Encoding:1252*/
|
||||
|
||||
// The state machine in this file will use all functions of the Modbus Client and check the results
|
||||
// Use the SysVars to configure the test.
|
||||
|
||||
// The states are:
|
||||
//
|
||||
// 0: Get device information [ -> OnModbusReadRegistersSuccess ]
|
||||
|
@ -130,13 +132,13 @@ void OnModbusReadBitsFailed(enum ModbusRequestError error, enum ModbusException
|
|||
case 130:
|
||||
writeDbg(MbError, "State %d. Reading %d output bits from 0x%04X did not work! Reason: %s", state, mbreq.Count, mbreq.Address, reason);
|
||||
break;
|
||||
case 200:
|
||||
case 900:
|
||||
if (error == FinalTimeout)
|
||||
{
|
||||
writeDbg(MbError, "State %d. Packet timed out! Receive window size: %d", state, s90i-1);
|
||||
state = 210;
|
||||
writeDbg(MbInfo, "State %d. Packet timed out! Receive window size: %d", state, s90i-1);
|
||||
state = 910;
|
||||
stop();
|
||||
break;
|
||||
return;
|
||||
}
|
||||
else
|
||||
writeDbg(MbError, "State %d. Error while writing bit: %s", state, reason);
|
||||
|
@ -332,7 +334,7 @@ void OnModbusReadRegistersSuccess(struct ModbusResReceiveRegisters mbres, struct
|
|||
case 150:
|
||||
writeDbg(MbDebug, "State %d. Successfully received three Read-Registers telegrams (as expected)", state);
|
||||
if (skipOutput)
|
||||
state = 900;
|
||||
state = 190;
|
||||
else
|
||||
{
|
||||
state = 160;
|
||||
|
|
|
@ -3,24 +3,14 @@
|
|||
<namespace name="" comment="">
|
||||
<namespace name="Device" comment="Server with ip address '192.168.1.100'">
|
||||
<namespace name="Config" comment="Configuration section for this server">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="IP" comment="The IP address of this server" bitcount="8" isSigned="true" encoding="65001" type="string" startValue="192.168.1.3" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="ms" name="Interval" comment="The interval with which the device will be queried" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="100" minValue="10" minValuePhys="10" maxValue="10000" maxValuePhys="10000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Vendor" comment="The vendor of the device" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="2" minValue="2" minValuePhys="2" maxValue="23" maxValuePhys="23">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="IP" comment="The IP address of this server" bitcount="8" isSigned="true" encoding="65001" type="string" startValue="192.168.1.2" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Vendor" comment="The vendor of the device" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="23" minValue="2" minValuePhys="2" maxValue="23" maxValuePhys="23">
|
||||
<valuetable definesMinMax="true">
|
||||
<valuetableentry value="2" description="BuR" />
|
||||
<valuetableentry value="23" description="Wago" />
|
||||
</valuetable>
|
||||
</variable>
|
||||
</namespace>
|
||||
<namespace name="Info" comment="Some information about the device">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="InputRegisters" comment="Number of input registers" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="0" minValuePhys="0" maxValue="256" maxValuePhys="256" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Modules" comment="The type and number of inputs of modules that are connected to the server" bitcount="8" isSigned="true" encoding="65001" type="string" startValue="DI2,DO16,DO16" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="SerialCode" comment="The serial code of the server" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="750" minValue="1" minValuePhys="1" maxValue="10000" maxValuePhys="10000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="DeviceCode" comment="The device code of the server" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="881" minValue="1" minValuePhys="1" maxValue="10000" maxValuePhys="10000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="InputBits" comment="Number of input bits" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="2" minValue="0" minValuePhys="0" maxValue="256" maxValuePhys="256" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="OutputBits" comment="Number of output bits" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="32" minValue="0" minValuePhys="0" maxValue="256" maxValuePhys="256" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="OutputRegisters" comment="Number of output registers" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="0" minValuePhys="0" maxValue="256" maxValuePhys="256" />
|
||||
</namespace>
|
||||
</namespace>
|
||||
<namespace name="Config" comment="">
|
||||
<namespace name="Modbus" comment="">
|
||||
|
|
Loading…
Reference in a new issue