Logic Machine Forum
Problem with function 16 in Spacelynk modbus - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Problem with function 16 in Spacelynk modbus (/showthread.php?tid=3953)



Problem with function 16 in Spacelynk modbus - Kilogica - 23.03.2022

Hello,

I'm trying to control a Hidew DOS dehumidifier via Modbus, I made this profile:

Code:
{

"product_code": "DOS",

"manufacturer": "HIDEW",

"description": "Deumidificatore DOS",

    "mapping":
    
        [
                
        {    "name": "Unità On/Off",
            "bus_datatype":    "bool",
            "address": 0,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Forzatura Deumidifica",
            "bus_datatype":    "bool",
            "address": 1,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Abilititazione Forzatura Deumidifica",
            "bus_datatype":    "bool",
            "address": 2,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Forzatura Riscaldamento",
            "bus_datatype":    "bool",
            "address": 3,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Abilitazione Forzatura Riscaldamento",
            "bus_datatype":    "bool",
            "address": 4,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Reset Allarmi",
            "bus_datatype":    "bool",
            "address": 5,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Reset pulizia filtri",
            "bus_datatype":    "bool",
            "address": 6,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Forzatura Raffreddamento",
            "bus_datatype":    "bool",
            "address": 7,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Abilitazione Forzatura Raffreddamento",
            "bus_datatype":    "bool",
            "address": 8,
            "type": "coil",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Stato compressore",
            "bus_datatype":    "bool",
            "address": 0,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Stato valvola acqua",
            "bus_datatype":    "bool",
            "address": 1,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Stato resistenza elettrica",
            "bus_datatype":    "bool",
            "address": 2,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza valvola acqua",
            "bus_datatype":    "bool",
            "address": 3,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza resistenza elettrica",
            "bus_datatype":    "bool",
            "address": 4,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza allarme",
            "bus_datatype":    "bool",
            "address": 5,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Filtri da pulire",
            "bus_datatype":    "bool",
            "address": 6,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza ventilatori elettronici",
            "bus_datatype":    "bool",
            "address": 7,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza opzione sbrinamento gas caldo",
            "bus_datatype":    "bool",
            "address": 8,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Allarme sonda",
            "bus_datatype":    "bool",
            "address": 9,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Allarme alta pressione",
            "bus_datatype":    "bool",
            "address": 10,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Allarme bassa pressione",
            "bus_datatype":    "bool",
            "address": 11,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Allarme macchina scarica",
            "bus_datatype":    "bool",
            "address": 12,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Allarme bassa temperatura per ON compressore",
            "bus_datatype":    "bool",
            "address": 13,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Allarme sovratemperatura resistenza elettrica",
            "bus_datatype":    "bool",
            "address": 14,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Allarme ventilatore",
            "bus_datatype":    "bool",
            "address": 15,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Sbrinamento attivo",
            "bus_datatype":    "bool",
            "address": 16,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Richiesta deumidifica",
            "bus_datatype":    "bool",
            "address": 17,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Richiesta riscaldamento",
            "bus_datatype":    "bool",
            "address": 18,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Richiesta raffreddamento",
            "bus_datatype":    "bool",
            "address": 19,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza controllo riscaldamento",
            "bus_datatype":    "bool",
            "address": 20,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza controllo raffreddamento",
            "bus_datatype":    "bool",
            "address": 21,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza funzione deumidificazione ad aria neutra",
            "bus_datatype":    "bool",
            "address": 22,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Presenza opzione raffreddamento con condensatore remoto",
            "bus_datatype":    "bool",
            "address": 23,
            "type": "discreteinput",
            "writable": false
            },
            
        {    "name": "Stato condensatore remoto",
            "bus_datatype":    "bool",
            "address": 24,
            "type": "discreteinput",
            "writable": false
            },
        
        {    "name": "Set umidità relativa",
            "bus_datatype":    "int16",
            "address": 0,
            "type": "register",
            "write_multiple" : true,
            "writable": true,
            "units": " %"
            },
            
        {    "name": "Set temperatura",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 1,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
        
        {    "name": "Ore di attesa promemoria pulizia filtri",
            "bus_datatype":    "int16",
            "address": 2,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " h"
            },
            
        {    "name": "Velocità ventilatore in ricircolo",
            "value_custom":    
                                {
                                    "1" : "Minima",
                                    "2" : "Media",
                                    "3" : "Massima"
                                },
            "bus_datatype":    "int16",
            "address": 3,
            "type": "register",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Velocità ventilatore in deumidifica",
            "value_custom":    
                                {
                                    "2" : "Media",
                                    "3" : "Massima"
                                },
            "bus_datatype":    "int16",
            "address": 4,
            "type": "register",
            "write_multiple" : true,
            "writable": true
            },
            
        {    "name": "Set sbrinamento statico",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 5,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
            
        {    "name": "Differenziale sbrinamento statico",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 6,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
            
        {    "name": "Set sbrinamento gas caldo",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 7,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
            
        {    "name": "Fine sbrinamento gas caldo",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 8,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
            
        {    "name": "Offset temperatura ambiente",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 9,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
        
        {    "name": "Offset umidità ambiente",
            "bus_datatype":    "int16",
            "address": 10,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " %"
            },
            
        {    "name": "Differenziale on riscaldamento",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 11,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
            
        {    "name": "Differenziale off riscaldamento",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 12,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
        
        {    "name": "Differenziale on deumidifica",
            "bus_datatype":    "int16",
            "address": 13,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " %"
            },
        
        {    "name": "Differenziale off deumidifica",
            "bus_datatype":    "int16",
            "address": 14,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " %"
            },
            
        {    "name": "Differenziale on raffreddamento",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 15,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
            
        {    "name": "Differenziale off raffreddamento",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 16,
            "type": "register",
            "write_multiple": true,
            "writable": true,
            "units": " °C"
            },
            
        {    "name": "Stagione",
            "value_custom":    
                                {
                                    "0" : "Inverno",
                                    "1" : "Estate",
                                    "2" : "Solo Deumidifica"
                                },
            "bus_datatype":    "int16",
            "address": 17,
            "type": "register",
            "write_multiple" : true,
            "writable": true
            },
        
        {    "name": "Set umidità relativa effettivo",
            "bus_datatype":    "int16",
            "address": 0,
            "type": "inputregister",
            "writable": false,
            "units": " %"
            },
            
        {    "name": "Set temperatura effettivo",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 1,
            "type": "inputregister",
            "writable": false,
            "units": " °C"
            },
            
        {    "name": "Velocità effettiva ventilatore",
            "value_custom":    
                                {
                                    "0" : "Off",
                                    "1" : "Minima",
                                    "2" : "Media",
                                    "3" : "Massima"
                                },
            "bus_datatype":    "int16",
            "address": 2,
            "type": "inputregister",
            "writable": false
            },
        
        {    "name": "Umidità relativa ambiente",
            "bus_datatype":    "int16",
            "address": 3,
            "type": "inputregister",
            "writable": false,
            "units": " %"
            },
            
        {    "name": "Temperatura ambiente",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 4,
            "type": "inputregister",
            "writable": false,
            "units": " °C"
            },
            
        {    "name": "Temperatura acqua",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 5,
            "type": "inputregister",
            "writable": false,
            "units": " °C"
            },
            
        {    "name": "Temperatura evaporazione",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 6,
            "type": "inputregister",
            "writable": false,
            "units": " °C"
            },
            
        {    "name": "Temperatura sbrinamento",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 7,
            "type": "inputregister",
            "writable": false,
            "units": " °C"
            },
            
        {    "name": "Matricola valore 1",
            "bus_datatype":    "int16",
            "address": 8,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 2",
            "bus_datatype":    "int16",
            "address": 9,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 3",
            "bus_datatype":    "int16",
            "address": 10,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 4",
            "bus_datatype":    "int16",
            "address": 11,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 5",
            "bus_datatype":    "int16",
            "address": 12,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 6",
            "bus_datatype":    "int16",
            "address": 13,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 7",
            "bus_datatype":    "int16",
            "address": 14,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 8",
            "bus_datatype":    "int16",
            "address": 15,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 9",
            "bus_datatype":    "int16",
            "address": 16,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Matricola valore 10",
            "bus_datatype":    "int16",
            "address": 17,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Tipo Macchina",
            "value_custom":    
                                {
                                    "0" : "DDS",
                                    "1" : "DCS",
                                    "2" : "DVS",
                                    "3" : "DOS"
                                },
            "bus_datatype":    "int16",
            "address": 18,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Taglia Macchina",
            "bus_datatype":    "int16",
            "address": 19,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Ore funzionamento macchina",
            "bus_datatype":    "int16",
            "address": 20,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Minuti rimanenti per standby",
            "bus_datatype":    "int16",
            "address": 21,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Stato accensione macchina",
            "value_custom":    
                                {
                                    "0" : "Off",
                                    "1" : "Standby",
                                    "2" : "On"
                                },
            "bus_datatype":    "int16",
            "address": 22,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Comando Unità",
            "value_custom":    
                                {
                                    "0" : "da display",
                                    "1" : "da fasce orarie",
                                    "2" : "da remoto",
                                    "3" : "da seriale"
                                },
            "bus_datatype":    "int16",
            "address": 23,
            "type": "inputregister",
            "writable": false
            },
            
        {    "name": "Taratura ventilatore elettronico",
            "bus_datatype":    "int16",
            "address": 24,
            "type": "inputregister",
            "writable": false,
            "units": " %"
            },
            
        {    "name": "Stagione effettiva",
            "value_custom":    
                                {
                                    "0" : "Inverno",
                                    "1" : "Estate",
                                    "2" : "Solo deumidifica"
                                },
            "bus_datatype":    "int16",
            "address": 25,
            "type": "inputregister",
            "writable": false
            },
        
        {    "name": "Pressione di evaporazione",
            "bus_datatype":    "float16",
            "value_multiplier": 0.1,                        
            "address": 26,
            "type": "inputregister",
            "writable": false,
            "units": " bar"
            }
            
    ]
    
}

Something strange is happening:

I have a Modbus TCP bridge (Z-KEY by Seneca) and 3 modbus devices, everything is working fine but when I try to write a holding register (with write_multiple set to true as the manufacturer recommend) it doesn't work. For example, I can read this register, but I can't write it.

Code:
{    "name": "Set umidità relativa",
            "bus_datatype":    "int16",
            "address": 0,
            "type": "register",
            "write_multiple" : true,
            "writable": true,
            "units": " %"
            },


I tried with Modscan and everything works fine, also all the coils are managed correctly from Spacelynk...only write holding registers function seems broken.

Any ideas?


RE: Problem with function 16 in Spacelynk modbus - admin - 24.03.2022

Try adding "datatype": "int16" to the mapping entry.


RE: Problem with function 16 in Spacelynk modbus - Kilogica - 29.03.2022

thanks, it works!