27.08.2024, 09:20
(27.08.2024, 08:56)Daniel Wrote: Can't really say much from the info provided.
This is the script which generates load.
What else I can check?
Code:
local mb = require('user.mbslave')
local copas = require('copas')
local socket = require('socket')
local address = '*'
local port = 502
local server = assert(socket.bind(address, port))
mb.setmapping({
['*'] = {
coils = {
[0] = 'U.5.004_LightOnOff',
[1] = 'U.5.003_LightOnOff',
[2] = 'U.5.002_LightOnOff',
[3] = 'U.5.004_LightSts',
[4] = 'U.5.003_LightSts',
[5] = 'U.5.002_LightSts',
[6] = 'U.5.004_LightOnOffWC',
[7] = 'U.5.003_LightOnOffWC',
[8] = 'U.5.002_LightOnOffWC',
[9] = 'U.5.004_LightStsWC',
[10] = 'U.5.003_LightStsWC',
[11] = 'U.5.002_LightStsWC',
[12] = 'U.5.004_FancoilOnOff',
[13] = 'U.5.003_FancoilOnOff',
[14] = 'U.5.002_FancoilOnOff',
[15] = 'U.5.004_FancoilStatus',
[16] = 'U.5.003_FancoilStatus',
[17] = 'U.5.002_FancoilStatus',
[18] = 'U.5.004_FancoilAlarm',
[19] = 'U.5.003_FancoilAlarm',
[20] = 'U.5.002_FancoilAlarm',
[21] = 'U.5.004_Call',
[22] = 'U.5.003_Call',
[23] = 'U.5.002_Call',
[24] = '5.SHAVIP.2_D1_KNXStatus',
[25] = '5.SHAVIP.2_D2_KNXStatus',
[26] = '5.SHAVIP.2_MEGateway_Status',
[27] = '7.SHAUOV.6_Status',
[28] = '5.SHAVIP.2_LightOnOff',
[29] = '5.SHAVIP.2_LightOnOffWCStaff',
[30] = '5.SHAVIP.2_DisableButtons',
[31] = 'U.5.004_Status',
[32] = 'U.5.004_Status',
[33] = 'U.5.004_Status'
},
registers = {
[0] = 'U.5.004_LightDim',
[1] = 'U.5.003_LightDim',
[2] = 'U.5.002_LightDim',
[3] = 'U.5.004_LightDimWC',
[4] = 'U.5.003_LightDimWC',
[5] = 'U.5.002_LightDimWC',
[6] = 'U.5.004_Temp',
[7] = 'U.5.003_Temp',
[8] = 'U.5.002_Temp',
[9] = 'U.5.004_Setpoint',
[10] = 'U.5.003_Setpoint',
[11] = 'U.5.002_Setpoint',
[12] = 'U.5.004_FancoilErrorCode',
[13] = 'U.5.003_FancoilErrorCode',
[14] = 'U.5.002_FancoilErrorCode',
[15] = '5.SHAVIP.2-D1_1_GenFaultCount',
[16] = '5.SHAVIP.2-D1_1_FaultLampCount',
[17] = '5.SHAVIP.2-D1_1_FaultECGCount',
[18] = '5.SHAVIP.2-D1_2_GenFaultCount',
[19] = '5.SHAVIP.2-D1_2_FaultLampCount',
[20] = '5.SHAVIP.2-D1_2_FaultECGCount',
[21] = '5.SHAVIP.2-D2_1_GenFaultCount',
[22] = '5.SHAVIP.2-D2_1_FaultLampCount',
[23] = '5.SHAVIP.2-D2_1_FaultECGCount',
[24] = '5.SHAVIP.2-D2_2_GenFaultCount',
[25] = '5.SHAVIP.2-D2_2_FaultLampCount',
[26] = '5.SHAVIP.2-D2_2_FaultECGCount'
}
}
})
mb.setswap('w')
mb.setfloat16precision(2)
local function handler(sock)
copas.setErrorHandler(log)
sock = copas.wrap(sock)
sock:settimeout(60)
while true do
local res, err = mb.tcphandler(sock)
if not res then
break
end
end
sock:close()
end
copas.addserver(server, handler, 60)
copas.loop()