Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
e58ccc56
Commit
e58ccc56
authored
May 20, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ModbusMaster): отключил лишнее в тестах
parent
733dd5cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
test.xml
conf/test.xml
+3
-1
mbmaster-test-configure.xml
extensions/ModbusMaster/tests/mbmaster-test-configure.xml
+4
-0
run_test_mbtcpmaster.sh
extensions/ModbusMaster/tests/run_test_mbtcpmaster.sh
+1
-2
test_mbtcpmaster.cc
extensions/ModbusMaster/tests/test_mbtcpmaster.cc
+38
-0
No files found.
conf/test.xml
View file @
e58ccc56
...
@@ -246,10 +246,12 @@
...
@@ -246,10 +246,12 @@
<item
id=
"58"
iotype=
"AO"
name=
"Lamp58_C"
textname=
"Lamp 58"
rrd=
"1"
rrd1_ds=
"GAUGE:20:U:U"
/>
<item
id=
"58"
iotype=
"AO"
name=
"Lamp58_C"
textname=
"Lamp 58"
rrd=
"1"
rrd1_ds=
"GAUGE:20:U:U"
/>
<item
id=
"62"
iotype=
"AI"
name=
"LogLevel_S"
textname=
"LogLevel control"
/>
<item
id=
"62"
iotype=
"AI"
name=
"LogLevel_S"
textname=
"LogLevel control"
/>
<item
id=
"63"
iotype=
"AI"
name=
"SVU_AskCount_AS"
textname=
"svu asl count"
/>
<item
id=
"63"
iotype=
"AI"
name=
"SVU_AskCount_AS"
textname=
"svu asl count"
/>
<item
id=
"64"
iotype=
"AI"
name=
"AI64_AS"
textname=
"AI64"
mbaddr=
"0x01"
mbfunc=
"0x03"
mbreg=
"64"
mbtype=
"rtu"
rs=
"5"
/>
<item
id=
"64"
iotype=
"AI"
name=
"AI64_AS"
textname=
"AI64"
mbaddr=
"0x01"
mbfunc=
"0x03"
mbreg=
"64"
mbtype=
"rtu"
rs=
"5"
tcp=
"6"
/>
<item
id=
"66"
iotype=
"DI"
name=
"DI66_AS"
textname=
"DI66"
mbaddr=
"0x01"
mbfunc=
"0x01"
mbreg=
"66"
mbtype=
"rtu"
rs=
"5"
/>
<item
id=
"66"
iotype=
"DI"
name=
"DI66_AS"
textname=
"DI66"
mbaddr=
"0x01"
mbfunc=
"0x01"
mbreg=
"66"
mbtype=
"rtu"
rs=
"5"
/>
<item
id=
"65"
iotype=
"DI"
name=
"D65_S"
textname=
"D65"
threshold_aid=
"AI64_AS"
lowlimit=
"3"
hilimit=
"5"
threshold_invert=
"1"
rs=
"5"
/>
<item
id=
"65"
iotype=
"DI"
name=
"D65_S"
textname=
"D65"
threshold_aid=
"AI64_AS"
lowlimit=
"3"
hilimit=
"5"
threshold_invert=
"1"
rs=
"5"
/>
<item
id=
"100"
iotype=
"AI"
name=
"AI100_AS"
textname=
"AI100"
mbaddr=
"0x01"
mbfunc=
"0x03"
mbreg=
"100"
mbtype=
"rtu"
tcp=
"6"
vtype=
"F2"
/>
<item
id=
"100"
iotype=
"AI"
name=
"AI100_AS"
textname=
"AI100"
mbaddr=
"0x01"
mbfunc=
"0x03"
mbreg=
"100"
mbtype=
"rtu"
tcp=
"6"
vtype=
"F2"
/>
<item
id=
"101"
iotype=
"AI"
name=
"AI101_AS"
textname=
"AI101"
mbaddr=
"0x01"
mbfunc=
"0x03"
mbreg=
"102"
mbtype=
"rtu"
tcp=
"6"
/>
<item
id=
"102"
iotype=
"AI"
name=
"AI102_AS"
textname=
"AI102"
mbaddr=
"0x01"
mbfunc=
"0x03"
mbreg=
"99"
mbtype=
"rtu"
tcp=
"6"
/>
</sensors>
</sensors>
<thresholds
name=
"thresholds"
>
<thresholds
name=
"thresholds"
>
<sensor
iotype=
"AI"
name=
"AI_AS"
>
<sensor
iotype=
"AI"
name=
"AI_AS"
>
...
...
extensions/ModbusMaster/tests/mbmaster-test-configure.xml
View file @
e58ccc56
...
@@ -107,6 +107,10 @@
...
@@ -107,6 +107,10 @@
<item
id=
"1025"
mb=
"1"
mbtype=
"rtu"
mbaddr=
"0x01"
mbreg=
"39"
mbfunc=
"0x0F"
iotype=
"DO"
name=
"TestWrite0F_2"
textname=
"Тестовый регистр для 0x0F"
/>
<item
id=
"1025"
mb=
"1"
mbtype=
"rtu"
mbaddr=
"0x01"
mbreg=
"39"
mbfunc=
"0x0F"
iotype=
"DO"
name=
"TestWrite0F_2"
textname=
"Тестовый регистр для 0x0F"
/>
<item
id=
"1026"
mb=
"1"
mbtype=
"rtu"
mbaddr=
"0x01"
mbreg=
"40"
mbfunc=
"0x0F"
iotype=
"DO"
name=
"TestWrite0F_3"
textname=
"Тестовый регистр для 0x0F"
/>
<item
id=
"1026"
mb=
"1"
mbtype=
"rtu"
mbaddr=
"0x01"
mbreg=
"40"
mbfunc=
"0x0F"
iotype=
"DO"
name=
"TestWrite0F_3"
textname=
"Тестовый регистр для 0x0F"
/>
<!-- <item id="1027" mb="1" mbtype="rtu" mbaddr="0x01" mbreg="41" mbfunc="0x10" vtype="F2" iotype="AO" name="TestWrite10_F2" textname="Тестовый регистр для 0x10"/> -->
<!-- <item id="1028" mb="1" mbtype="rtu" mbaddr="0x01" mbreg="45" mbfunc="0x10" vtype="F4" iotype="AO" name="TestWrite10_F4" textname="Тестовый регистр для 0x10"/> -->
<item
id=
"10000"
iotype=
"DI"
name=
"TestMode_S"
textname=
"Тестовый датчик"
/>
<item
id=
"10000"
iotype=
"DI"
name=
"TestMode_S"
textname=
"Тестовый датчик"
/>
...
...
extensions/ModbusMaster/tests/run_test_mbtcpmaster.sh
View file @
e58ccc56
...
@@ -15,8 +15,7 @@ cd -
...
@@ -15,8 +15,7 @@ cd -
--mbtcp-filter-value
1
\
--mbtcp-filter-value
1
\
--mbtcp-gateway-iaddr
localhost
\
--mbtcp-gateway-iaddr
localhost
\
--mbtcp-gateway-port
20048
\
--mbtcp-gateway-port
20048
\
--mbtcp-polltime
50
--mbtcp-recv-timeout
500
\
--mbtcp-polltime
50
--mbtcp-recv-timeout
500
$*
#--mbtcp-default-mbinit-ok 1
#--mbtcp-default-mbinit-ok 1
#--dlog-add-levels any
#--dlog-add-levels any
...
...
extensions/ModbusMaster/tests/test_mbtcpmaster.cc
View file @
e58ccc56
...
@@ -571,3 +571,41 @@ TEST_CASE("MBTCPMaster: 0x66 (file transfer)", "[modbus][0x66][mbmaster][mbtcpma
...
@@ -571,3 +571,41 @@ TEST_CASE("MBTCPMaster: 0x66 (file transfer)", "[modbus][0x66][mbmaster][mbtcpma
WARN
(
"Test of '0x66'..not yet.. "
);
WARN
(
"Test of '0x66'..not yet.. "
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#if 0
TEST_CASE("MBTCPMaster: 0x10 (F2)", "[modbus][0x10][F2][mbmaster][mbtcpmaster]")
{
InitTest();
ui->setValue(1027, 100);
REQUIRE( ui->getValue(1027) == 100 );
msleep(polltime + 200);
ModbusRTU::WriteOutputMessage q = mbs->getLastWriteOutput();
REQUIRE( q.addr == slaveADDR );
REQUIRE( q.start == 41 );
REQUIRE( q.quant == 2 );
VTypes::F2 f2(q.data,VTypes::F2::wsize());
float f = f2;
REQUIRE( f == 100 );
}
// -----------------------------------------------------------------------------
TEST_CASE("MBTCPMaster: 0x10 (F4)", "[modbus][0x10][F4][mbmaster][mbtcpmaster]")
{
InitTest();
long v = 10000000;
ui->setValue(1028, v);
REQUIRE( ui->getValue(1028) == v );
msleep(polltime + 200);
ModbusRTU::WriteOutputMessage q = mbs->getLastWriteOutput();
REQUIRE( q.addr == slaveADDR );
REQUIRE( q.start == 45 );
REQUIRE( q.quant == 4 );
VTypes::F4 f4(q.data,VTypes::F4::wsize());
float f = f4;
REQUIRE( f == v );
}
#endif
// -----------------------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment