This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus cyclic writes
#1
Hi,

I have a modbus slave on which i want to write a register periodically. Can this be done via the Modbus UI? I have the following profile prepared:
Code:
{
    "manufacturer": "IDM",
    "description": "Heat Pump Injection",
    "mapping": [        
        {
            "name": "Current Injection",
            "bus_datatype": "float32",
            "type": "register",
            "address": 74,            
            "writable": 1,
            "write_only": 1,
            "datatype": "float32",
            "units": "Kw",
            "read_swap": true,
    "value_multiplier": "0.001"
        }
    ]
}

But i have no clue when the value will be written? Is it only on mapped address change? Of can it be set to update no matter what every 30 seconds? If so, how? Or should this be done differently? 

Thanks for the help!
Reply
#2
It is on write to the mapped object, create a resident or scheduled script which will write periodically to this object.
------------------------------
Ctrl+F5
Reply
#3
This should be helpful: https://forum.logicmachine.net/showthread.php?tid=1878
Reply
#4
Thanks!
Reply
#5
Follow up question. For reads i need to use the swap_read option. I thus assume i should also swap the write (words) as i attempt to write a float32, meaning two 16 bit registers. Since i send a group address, how can i swap the words? I do not see an option for this in the profile (documentation profile json).
Reply
#6
read_swap works for both reading and writing.
Reply


Forum Jump: