Comfort  Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register

UCM/Modbus as Master
 Moderated by: slychiu
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Tuesday Jan 31st, 2017 01:48 pm
   PM  Quote  Reply 
1st Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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
  • Coil
  • Input Register
  • Holding Register

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
  1. Modbus address 0 -> Flag 21
  2. Modbus address 1 > Flag 22
  3. Modbus address 2 > Flag 23
  4. Modbus Address 3 > Flag 24
  5. Modbus Adress 4 > Flag 25
These modbus addresses must be the same type eg Discrete Inputs
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



 Posted: Tuesday Jan 31st, 2017 01:53 pm
   PM  Quote  Reply 
2nd Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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.




 Posted: Tuesday Jan 31st, 2017 01:55 pm
   PM  Quote  Reply 
3rd Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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;
  • Zone Not Ready (1 bit): Zone Open during arming
  • Arm state: Off (disarned), On (armed)
  • Alarm state: Off (No alarm), On (full alarm). Trouble, alert is not alarm.
  • Panic: Panic alarm
  • Tamper: Tamper alarm
  • Line Cut: Phone Trouble/Line Cut
  • AC Failure: Power /AC Failure
  • Arm Failure: Failed to Arm
  • Low Battery
  • Alarm Type: see Alarm Types in Comfigurator > Security Types
  • Security Mode: 0=Security Off, 1=Away, 2=Night, 3=Day, 4=Vacation
  • Alarm Zone: Last zone which caused alarm
  • Alarm User: User armed and disarmed
  • Alarm RS485 ID: Communications Failure Module ID
  • RS485 Comms fail: Communications Failure state
  • Bypass: Zone Number bypassed
  • Entry Alert: Entry alert in progress
  • Fire: Fire alarm active
  • Alarm State (Value): 0 – Idle, 1 = Trouble, 2= Alert, 3 = Alarm
  • Intruder Alarm- Intruder Alarm Active
  • Zone NotReady (value): Zone number which is open in alarm
  • Security Off (1-bit): Security Off state On/Off
  • Away Mode (1-bit): Away Mode On/Off
  • Night Mode (1-Bit): Night Mode On/Off
  • Day Mode (1-Bit): Day Mode On/Off
  • Vacation Mode (1 bit):Vacation Mode On/Off



 Posted: Sunday Apr 9th, 2017 02:56 pm
   PM  Quote  Reply 
4th Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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



 Posted: Friday Apr 28th, 2017 11:14 am
   PM  Quote  Reply 
5th Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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




 Posted: Saturday Jan 27th, 2018 11:42 am
   PM  Quote  Reply 
6th Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5493
Status: 
Offline

  back to top

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/



 Current time is 08:48 am
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems