Modbus profile for MA01-AXCX4040

Discussion in 'C-Bus Automation Controllers' started by geoffwatts, Mar 27, 2024.

  1. geoffwatts

    geoffwatts

    Joined:
    Mar 11, 2024
    Messages:
    10
    Likes Received:
    0
    Location:
    Perth
    Hi all,

    I needed some low voltage inputs and outputs for a door release button, door strike and garage opener. I found this module on Aliexpress with 4 inputs and 4 outputs, and some slightly awful documentation, but, cheap ($20ish delivered), and I've figured out the profile.

    Modbus profile is below:

    Code:
    {
    "manufacturer": "Chengdu Ebyte Electronic Technology Co. Ltd.",
    "description": "MA01-AXCX4040",
    "mapping": [
    
    { "name": "Output 1", "bus_datatype": "bool", "type": "coil",
    "address": 0,"writable": 1 },
    { "name": "Output 2", "bus_datatype": "bool", "type": "coil",
    "address": 1,"writable": 1 },
    { "name": "Output 3", "bus_datatype": "bool", "type": "coil",
    "address": 2,"writable": 1 },
    { "name": "Output 4", "bus_datatype": "bool", "type": "coil",
    "address": 3,"writable": 1 },
    
    { "name": "Input 1", "bus_datatype": "bool",
    "type": "discreteinput", "address": 0, "writable": 0},
    { "name": "Input 2", "bus_datatype": "bool",
    "type": "discreteinput", "address": 1, "writable": 0},
    { "name": "Input 3", "bus_datatype": "bool",
    "type": "discreteinput", "address": 2, "writable": 0},
    { "name": "Input 4", "bus_datatype": "bool",
    "type": "discreteinput", "address": 3, "writable": 0},
    
    { "name": "Input 1 Trigger Count", "bus_datatype": "uint32", "datatype": "uint16",
    "type": "register", "address": 2527, "writable": 0},
    { "name": "Input 2 Trigger Count", "bus_datatype": "uint32", "datatype": "uint16",
    "type": "register", "address": 2528, "writable": 0},
    { "name": "Input 3 Trigger Count", "bus_datatype": "uint32", "datatype": "uint16",
    "type": "register", "address": 2529, "writable": 0},
    { "name": "Input 4 Trigger Count", "bus_datatype": "uint32", "datatype": "uint16",
    "type": "register", "address": 2530, "writable": 0}
    
    
    ]
    
    
    
    }
    
    And some additions to my init script to get the module into the state I want:
    Code:
    -- We're going to init the modbus relay box, and set some registers
    
    require('luamodbus')
    mb = luamodbus.rtu()
    
    mb:open('/dev/RS485', 9600, 'N', 8, 1, 'F')
    mb:connect()
    
    -- Connect to the module
    mb:setslave(32)
    
    -- Set to pulse mode for the first 2 outputs
    mb:writeregisters(1400, 1,1,0,0)
    
    -- Set pulse width to 8 seconds for gate, 2 seconds for garage door
    mb:writeregisters(1500, 8000,2000,0,0)
    
    mb:flush()
    mb:close()
    
    
    The module's docs are here: https://www.cdebyte.com/pdf-down.aspx?id=22

    You can buy it here (not an ad): https://www.aliexpress.us/item/1005003651903541.html
     
    Last edited: Mar 27, 2024
    geoffwatts, Mar 27, 2024
    #1
  2. geoffwatts

    geoffwatts

    Joined:
    Mar 11, 2024
    Messages:
    10
    Likes Received:
    0
    Location:
    Perth
    Incidentally, to pulse those outputs, create objects in the User Parameter application, bind them with modbus, and then set them using
    Code:
    SetUserParam('MYNET', 'Garage Opener', true)
    I haven't been able to set cbus levels to make them trigger. I haven't tried triggering the application from the cbus network.
     
    geoffwatts, Mar 27, 2024
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.