File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,15 @@ class PlcMemoryTest {
14
14
assertEquals(1 , values.size, )
15
15
assertEquals( values[0 ], 500 )
16
16
}
17
+
18
+ @Test
19
+ fun `PlcMemory must be initialized with configured input registers symbols` () {
20
+ val configuration = ConfigurationParser ()
21
+ configuration.setReadFromResources(true )
22
+ configuration.setFileName(" configuration_init.xml" )
23
+ val plcMemory = PlcMemory (configuration)
24
+ val values = plcMemory.readInputRegister(5 , 1 )
25
+ assertEquals(1 , values.size, )
26
+ assertEquals( values[0 ], 30 )
27
+ }
17
28
}
Original file line number Diff line number Diff line change 8
8
<configuration initializeUndefinedRegisters =" true" initialValue =" 0" >
9
9
<registers >
10
10
<register addressType =" HOLDING_REGISTER" address =" 14" symbol =" RPM_MOTOR" >500</register >
11
+ <register addressType =" INPUT_REGISTER" address =" 5" symbol =" HUMIDITY" >30</register >
11
12
</registers >
12
13
</configuration >
13
14
<simulation plcScanTime =" 1000" >
You can’t perform that action at this time.
0 commit comments