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 @@ -37,4 +37,15 @@ class PlcMemoryTest {
37
37
assertEquals(1 , values.size)
38
38
assertEquals( values[0 ], true )
39
39
}
40
+
41
+ @Test
42
+ fun `PlcMemory must be initialized with configured input status registers symbols` () {
43
+ val configuration = ConfigurationParser ()
44
+ configuration.setReadFromResources(true )
45
+ configuration.setFileName(" configuration_init.xml" )
46
+ val plcMemory = PlcMemory (configuration)
47
+ val values = plcMemory.readInputStatus(5 , 1 )
48
+ assertEquals(1 , values.size)
49
+ assertEquals( values[0 ], true )
50
+ }
40
51
}
Original file line number Diff line number Diff line change 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
12
<register addressType =" COIL" address =" 5" symbol =" RELAYON" >1</register >
13
+ <register addressType =" DISCRETE_INPUT" address =" 5" symbol =" RELAY_STATUS" >1</register >
13
14
</registers >
14
15
</configuration >
15
16
<simulation plcScanTime =" 1000" >
You can’t perform that action at this time.
0 commit comments