File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -25,4 +25,16 @@ class PlcMemoryTest {
25
25
assertEquals(1 , values.size, )
26
26
assertEquals( values[0 ], 30 )
27
27
}
28
+
29
+
30
+ @Test
31
+ fun `PlcMemory must be initialized with configured coil registers symbols` () {
32
+ val configuration = ConfigurationParser ()
33
+ configuration.setReadFromResources(true )
34
+ configuration.setFileName(" configuration_init.xml" )
35
+ val plcMemory = PlcMemory (configuration)
36
+ val values = plcMemory.readCoilStatus(5 , 1 )
37
+ assertEquals(1 , values.size)
38
+ assertEquals( values[0 ], true )
39
+ }
28
40
}
Original file line number Diff line number Diff line change 9
9
<registers >
10
10
<register addressType =" HOLDING_REGISTER" address =" 14" symbol =" RPM_MOTOR" >500</register >
11
11
<register addressType =" INPUT_REGISTER" address =" 5" symbol =" HUMIDITY" >30</register >
12
+ <register addressType =" COIL" address =" 5" symbol =" RELAYON" >1</register >
12
13
</registers >
13
14
</configuration >
14
15
<simulation plcScanTime =" 1000" >
You can’t perform that action at this time.
0 commit comments