M090 – how to control over Modbus TCP

Domat Control System Forums Hardware (english) M090 – how to control over Modbus TCP

This topic contains 7 replies, has 3 voices, and was last updated by  Jan Vidim 19.10. 2015 10:27.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #12602

    Jan Vidim
    Keymaster

    the default Modbus TCP port is 502 which is also what the M090 is using.

    As for the control principle: there are 8 “blocks” – (D0 to D7) – positions for DALI commands. If you want to execute a command, you have to:

    - fill in a block with the data representing the command

    - set the bit in Register 5 LSB which corresponds to the block you want to execute.

    After executing of the command, the info bit in register 5 MSB is set so that your software knows it was OK.

    If a command is generating a response, the response is stored in the D0..D2 registers of the particular block.

    Of course you can fill in more block at the same time and execute them all together by writing a corresponding bit pattern into register 5 LSB.

    Here is an example of bytes to be sent over Modbus TCP to the M090 to switch a light on:

    Prepare command to block 0

    3.9.2012 10:31:47: Tx: 00 07 00 00 00 0D 01 10 00 05 00 03 06 0B 05 00 00 00 00

    this is an example telegram for ballast Adr 6: set to max (DALI function 5). It is written in command block 0 (Modbus register 6, which is Modbus address 5)

    00 07 00 00 00 0D 01 Details see Modbus TCP frame structure
    10 Modbus F16, write multiple registers
    00 05 Modbus address to be written to, address 5 = register 6
    00 03 number of 16bit registers to be written
    06 number of bytes to follow
    0B 05 00 00 00 00 The data is 0B 05 for command block 0

    - and other command blocks 1 and 2 are empty (00 00 00 00) -

    (this is how our software, with which I did the example, is communicating:

    it writes three blocks at a time; yours may only send the first couple of bytes).

    The most important data is 0B 05.

    05: LSB = DALI command, see Tab 2 No.5

    0B: MSB = 0000 1011 – the structure of a standard DALI command is in Tab 2 of the M090 data sheet: Y AAA AAA 1, where Y = 0 for Short address (see Tab 3), and AAA AAA = 000 101 = 5 = DALI address of the ballast.

    In a similar way you may fill more command blocks, and then activate all of them at the same time.

    And another Modbus TCP telegram has to activate (execute) this command:

    adr6: execute block 0 (write 1 into Modbus register 5, aka Modbus address 4)

    00 08 00 00 00 09 01 Details see Modbus TCP frame structure
    10 Modbus F16, write multiple registers
    00 04 Modbus address to be written to, address 4 = register 5
    00 01 number of 16bit registers to be written
    02 number of bytes to follow
    00 01 1 at Bit0 means Execute command block D0.
    At this time the commands are sent to the DALI bus.

    #13972

    guest
    Participant

    The commands are STANDARD and EXTENDED.

     

    STANDARD

     

    Do not care about the first column in the table 2 in the data sheet, because this is just the number of the command, but it has nothing to do with the DALI command number, even if most of the lines are of the same numbering.

     

    The second column is the DALI command in binary form. So what has to be written into reg. 6 LSB is in this column. The XXXX must be replaced by what you calculate from the described function. Mostly they are groups (0..15), scenes etc.

     

    The addresses are according to the ADDRESS TYPES and this is so both for standard and for extended commands.

     

    The other registers D0, D1, and D2 are always 0 at STANDARD commands.

     

    So if a user wants to save a value to DTR (this command is No. 257 according to the first column), he will NOT write 257 into register 6 LSB (because this is, as you discovered, not possible), but 6 LSB must be 10100011 = a3 hex, and the value must be written into reg. 6 MSB.

     

    EXTENDED

     

    The extended command is recognized by the M090 so that in D2 there is a number according to the Extended commands table. At an extended commmand there is the “DALI command” register always 0, and in D2 there is the Extended command number.

     

    The Address, D0, and D1 fields must be filled in according to the description in the Extended commands table.

     

    The communication result appears then in the DALI command, DALI address, D0, and D1 fields. This is easy to see in the Extended commands reply table.

     

    #13978

    Jan Vidim
    Keymaster

    Please note that the numbering of the ballasts is:

    1…64 at the web interface

    0…63 in the Modbus telegrams.

     

    #13979

    Jan Vidim
    Keymaster

    A note or two regarding the direct addressing telegram composition:

     

    the command register (e.g. 6) should contain the DALI address in the MSB byte, and DALI command in the LSB byte.

    MSB - LSB:
    xxxxxxxx - xxxxxxxx

     

    The Off command is 00000000, see Tab 2 in the M090 datasheet, so the reg. 6 will look like

    xxxxxxxx - 00000000

     

    Now we compose the DALI address into the MSB, which is now displayed as xxxxxxxx.

    See the structure of the DALI address in Tab 2: 0 AAA AAA 0, if we use direct control, see Tab 3. The last position is always 0. The “AAA AAA”s means DALI address in the range of 0…63.

    If you send 2048, the MSB is 0000 1000 bin, which means that the AAA AAA part is 000 100 (just remove the two zeros, on the start and on the end of the byte). This is 4 dec, this means ballast No 5, because in the web interface they are numbered 1 to 64 (for practical reasons, and to comply with common usage and understanding of DALI addressing). Note that we have to address them 0 to 63, which brings along a little mess, but this is not uncommon in programming… I think that having ballast 64 addressed as 0 (because of address range overflow) would be evil.

     

    So we should say “ballast 5 addressed 4″ rather than “address 5″, however funny it may sound.

     

    #16492

    cimasile
    Participant

    Hi,
    I bought a M090 CONVERTER. How I’m able to be sure I adress correctly each balast.
    I connected only one ballast and send adress. When I select ‘Lamp status’, each number is off, even ballast is switch on.
    On the other hand, is DALI BUS IS connected?
    Have you got a programming notice to know all parameters of ECG SETTING,…?
    Thanks for your help.
    Best regards.

    #16493

    cimasile
    Participant

    Hi,
    I bought a M090 CONVERTER. How I’m able to be sure I adress correctly each balast.
    I connected only one ballast and send adress. When I select ‘Lamp status’, each number is off, even ballast is switch on.
    On the other hand, is DALI BUS polarize on ballast?
    Have you got a programming notice to know all parameters of ECG SETTING,…?
    Thanks for your help.
    Best regards.

    #16628

    Jan Vidim
    Keymaster

    Cimasile,
    the DALI addressing is performed either by the lights supplier, or by the M090 supplier. In the latter case, you can use the ballast addressing functionality over the M090 web interface. Then all DALI ballasts are addressed and detected, and you can check which addresses are active on the bus.
    What address does your ballast have?
    DALI bus has polarity, however, the slave devices are designed so as to fit both ways of connection, so you do not have to care.
    The reference between the Modbus commands and standard DALI commands is in the M090 Modbus table. If you have a particular question put it here or drop a mail at support@domat.cz please.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.