val request = ReadCoilsRequest()
request.serverAddress = 1
request.startAddress = 0
request.transactionId = 0
request.quantity = 123
val response = m.processRequest(request) as ReadCoilsResponse
When trying to get the value of an individual coil, it gives an exception java.lang.ArrayIndexOutOfBoundsException when accessing a specific coil index
println("test: ${response.modbusCoils.get(120)}")
As a workaround I am using the coils property (which is indicated to be deprecated)
When performing a read of coils
When trying to get the value of an individual coil, it gives an exception java.lang.ArrayIndexOutOfBoundsException when accessing a specific coil index
println("test: ${response.modbusCoils.get(120)}")
As a workaround I am using the coils property (which is indicated to be deprecated)
println("test: ${response.coils.get(120)}")