Comfort Automation/ Security System Forums > Third Party (interfacing to Comfort) > UCM/Modbus > UCM/Modbus as Master |
Moderated by: slychiu |
Author | Post | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
slychiu Administrator
|
In Properties, select Modbus Master/Slave as Master If Modbus Interface is TCP, then the Comfort Server Manager link will be shown Tabs: Modbus to Comfort, Alarm to Modbus, Monitor Mode can be seen Modbus to Comfort This is applicable for UCM/Modbus as Master only, not as Slave. In this tab, the Modbus addresses are defined and mapped to Comfort registers (Counters, Flags, Sensors, Outputs, Arm Security, Panic, Bypass Zones). Up to 256 Modbus addresses can be mapped to Comfort A Typical Modbus to Comfort screen is shown above. Press Add Modbus Element to add another element Select the Modbus Element Type from
Discrete Input Modbus Discrete Inputs are 1 bit (on/off) registers that can be mapped to Counters, Virtual Inputs, Flags, Outputs, Output Toggle, Output Pulse, Arm Security, Panic, Bypass Zone Coil Modbus Coils are 1 bit (on/off) registers that can be mapped to Counter, Physical Input, Counter, Flag , Sensor Input Register Modbus Input Registers are 16-bit registers that can be mapped to Counters, Sensors, Flags, Outputs, Virtual Inputs, arm security, panic, bypass zone. Modbus Input registers are read only, and cannot be changed by the maped counter and sensor. Holding Register Modbus Holding Registers 16-bit registers can be mapped to Counters, Physical Input, Flag, Sensors, Modbus Holding registers are read/write registers and can be changed by the mapped counter and sensor. Modbus Register Number After selecting the Modbus element (Coil, Discrete Input, Input Register, Holding Register), enter the Modbus Address in Decimal or Hexadecimal notation (depending on the setting in Properties). Modbus Registers have a range from 0 to FFFF Hexadecimal or 0 to 65535 in Decimal. Avoid entering the same Register number for the same Modbus element type, eg Coil 1000 is entered in the table it should not be duplicated in any of the tables to avoid conflict. Every Modbus device will have a table showing the Modbus element and address and the function related to it, so that other Modbus devices acting as Master can read and/or write to the correct Register. Number of Registers This means that multiple modbus slave registers can be polled in one command. For example in the above screenshot example on the 1st line, Modbus address 0 Discrete Input and mapped to Flag 21. No of Registers = 5 means that 5 sequential Modbus registers are mapped to 5 sequential Flags. eg
This allows the Modbus Master to poll the slave very fast and reduces the number of Modbus to Comfort Table entries. The above example required 5 entries before, but nopw only requires 1 entry in Modbus to Comfort Last edited on Sunday Sep 25th, 2022 03:02 am by slychiu |
|||||||||
slychiu Administrator
|
Comfort Register Mapping Modbus Registers can be mapped to Comfort Registers. The following Comfort Register Types are described below Counter Modbus 1-bit (Discrete Inputs, Coils) are either On or off. Map to Counter means the Modbus Input state Off sets the mapped counter value to OFF and Modbus Input On sets the counter value to 255. The Counter Response (if assigned) is triggered. This allows the Modbus Discrete Input state change to cause a Response to be executed. The Response can check the counter value, eg If Counter 001 = 0 then . Do this else Do that endif Modbus Holding and Input Registers are 16 bit registers that can be mapped to Comfort Counters. The 16 bit value from Modbus is written into the mapped Counter register. Modbus Holding Registers and read/write, and any change in the mapped Comfort counter is also updated to the Modbus Register. Modbus Input Registers are read only, so changes in Comfort Counters are not updated to the Modbus Register. Virtual Input When a 1-bit (On/Off) Modbus register (Coil, Discrete input) is mapped to a Virtual Input, the Modbus register can act like an alarm Input which can cause an alarm when armed, Select a Zone/Input which is not used otherwise. The zone/input can be any unsed zone, even when it is not physically on Comfort or Slave, eg Comfort with only 16 zones, Virtual Input can be on any unused zone from 1 to 16 or >16. When a zone is a virtual input due to mapping by Modbus discrete input, the physical input will not work. Flag When When a 1-bit (On/Off) Modbus register (Coil, Discrete input) is mapped to a Flag, the state of the Flag will follow that of the Modbus element On or Off. Output When When a 1-bit (On/Off) Modbus Discrete Input Register is mapped to an Output, the state of the Output will follow that of the Modbus Element On or Off. Select Output number. Output Toggle When a 1-bit (On/Off) Modbus Discrete Input register is mapped to an Output Toggle, the state of the Output will toggle ie invert state when the Modbus Element turns on. Select Output number. Output Pulse When a 1-bit (On/Off) Modbus Discrete Input register is mapped to an Output Pulse the state of the Output will Pulse on for 1 second when the Modbus Element turns on. Select Output number. Arm Security When a 1-bit (On/Off) Modbus register (Discrete input) is mapped to Arm Security, the security system will arm to the security mode when the Modbus Element turns on. Select the Security Mode to arm to (Away, Night, Day, Vacation). Panic When a 1-bit (On/Off) Modbus register (Discrete input) is mapped to Panic, the Modbus element Input will trigger a Panic Alarm when turned on. Bypass Zone When a 1-bit (On/Off) Modbus register (Discrete input) is mapped to Bypass zone, the Modbus element Input will bypass the zone when turned on and unbypass when turned off. Select a Zone/Input. Note Comfort Registers cannot be duplicated in the Modbus to Comfort table. For example you cannot map the same Counter to 2 Modbus registers Comments Field Enter maximum 16 characters in the comments field to describe the Modbus register. This field has no function and is saved in the UCM/Modbus EEPROM so it can be read back to show optional information. |
|||||||||
slychiu Administrator
|
Alarm To Modbus This is applicable for UCM/Modbus as Master only, not as Slave. This is for signalling of Alarm conditions to Modbus. Map the alarm condition to a Modbus element for notification of alarm conditions. The alarm conditions are listed below;
|
|||||||||
slychiu Administrator
|
Modbus Monitor mode is a great help when you are setting up the Modbus Interface. This shows the Modbus communications in both Transmit and receive directions. see http://www.comfortforums.com/forum133/4668.html Last edited on Monday Apr 10th, 2017 04:33 pm by slychiu |
|||||||||
slychiu Administrator
|
In Modbus to Comfort, the mapped Comfort registers status can be viewed as well as changed directly - This is a very useful too for testing the Modbus Integration Check the "Show Status" button to show the actual status of the Comfort Register, eg Flag02 in the example below mapped to Holding Register 400 Hex. Click on the status to change the state of the flag from Off to ON and vice versa. This should change the state of the modbus holding register In the example below Show Status shows the value of Counter002. Enter a new value in the Status field to change the Counter value. This should afffect the maped modbus register ie Holding Register 400 hex |
|||||||||
slychiu Administrator
|
PyModSlave is am excellent tool for testing UCM/Modbus in Master Mode. The software can be set up as a Modbus Slave to communicate with UCM/Modbus in Master Mode. It works in RTU and IP modes. Download from https://sourceforge.net/projects/pymodslave/files/ |