elreha
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
elreha [2020/12/23 14:09] – ↷ Page name changed from elreho to elreha emozolyak | elreha [2022/01/15 15:11] (current) – ↷ Links adapted because of a move operation 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Elreha cooling controllers ====== | ====== Elreha cooling controllers ====== | ||
- | {{ :: | + | {{ network:vpr_19000_and_logo.png? |
+ | The VPR-19000 Controllers for Compressor Compounds, Condenser Fans together with TAR/MSR/SMP refrigeration controller has been popular cooling solution and can be found in many large food malls or supermarkets. | ||
+ | There is an obsolete software tool for WinXP to monitor the system, which can show a tree of the controllers network and show/modify their parameters using tables. | ||
+ | With the WebHMI visualization, | ||
+ | |||
+ | Turn to your local representative for more information. | ||
+ | |||
+ | <code lua - example.lua> | ||
+ | SOH = 0x01 | ||
+ | STX = 0x02 | ||
+ | ETX = 0x03 | ||
+ | EOT = 0x04 | ||
+ | |||
+ | LIMIT_BYTE_COUNT = 255 | ||
+ | |||
+ | CACHE_REFRESH_DELAY = 5 * 60 | ||
+ | |||
+ | function readRegister (reg, device, unitId) | ||
+ | | ||
+ | local iAddrString= tostring(reg.internalAddr) | ||
+ | local targetBase = tonumber(string.sub(iAddrString, | ||
+ | local targetOffset = tonumber(string.sub(iAddrString, | ||
+ | |||
+ | if replies[targetBase] then | ||
+ | | ||
+ | local ifData = replies[targetBase][targetOffset] | ||
+ | if ifData then | ||
+ | ERROR(' | ||
+ | tprint(ifData) | ||
+ | return ifData[' | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | -- | ||
+ | |||
+ | if syncRequest() then | ||
+ | local packet = finishRequest() | ||
+ | |||
+ | if packet then | ||
+ | local b, o = parseRequest(packet) | ||
+ | b = tonumber(b) ; o = tonumber(o) | ||
+ | |||
+ | if (b and o) then | ||
+ | if (not readUntil(string.byte('#' | ||
+ | return false | ||
+ | | ||
+ | | ||
+ | local replyAddr = tonumber(readString(4)) | ||
+ | | ||
+ | if (replyAddr == b) then | ||
+ | | ||
+ | ERROR(' | ||
+ | local data = readUntil(ETX) | ||
+ | |||
+ | -- DATA PROCESSING | ||
+ | if not data then | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | -- get string presentation | ||
+ | local dataAsString = {} | ||
+ | for i, v in ipairs(data) do | ||
+ | dataAsString[i] = string.char(v) | ||
+ | | ||
+ | data = table.concat(dataAsString) | ||
+ | -- ERROR(data) | ||
+ | | ||
+ | -- check if data in cache | ||
+ | if (not replies[b]) then | ||
+ | | ||
+ | | ||
+ | -- if sub-set in the group | ||
+ | if (not replies[b][o]) then | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | -- check if data is old or no | ||
+ | if ((now - replies[b][o][' | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | if not replies[targetBase] or not replies[targetOffset] then | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | end | ||
+ | else | ||
+ | ERROR(' | ||
+ | return false | ||
+ | end | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | end -- readRegister | ||
+ | |||
+ | </ | ||
elreha.1608732595.txt.gz · Last modified: 2020/12/23 14:09 by emozolyak