Remote Processing CX-10 User Manual
Page 28
RELAY AND OPTO INPUT LINES
SECTION 6
Page 6-3
Modbus Register Interface
There are two ways relays can be controlled and status
read: First is as a group through register 10. This is a bit
mapped register that controls all relays in one register.
The second is individually through registers 19-26,
inclusive. Writing a 1 will turn on a relay while writing
a 0 turns it off. A 1 in a register or bit position means a
relay is on.
Registers 10 and 19-26 are read and write types. The
status of a relay is always reflected in register 10 and its
individual register number. You could write to register
10 and read its status in register 22, for example. On the
other hand, you can write to register 22 and read its
status in register 10.
Below is a table of relays, wiring designations, and
register number used to control a relay.
Relay
No.
Connector
designatio
n on PCB
Common
designator
Register number
to control or
read relay
1
L
M
19
2
K
M
20
3
H
M
21
4
G
M
22
5
E
F
23
6
D
F
24
7
B
C
25
8
A
C
26
When the specified register set to 1, that relay turns on
and makes contact. An LED behind the relay also
illuminates when a relay is ON.
All relays may be turned on or off using a single register
10. Register 10 is be useful when a number of relays
need to be controlled at the same time. This register is
bit oriented, meaning a sum of weighted values are
written to this register to turn relays on or off.
Relay No
Register 10 weighing value
1
1
2
2
3
4
4
8
5
16
6
32
7
64
8
128
To turn on specific relays, simply add up the value
associated with a relay and write it to register 10. For
example, suppose you needed relays 1, 3 and 7 turned on.
Register 10 value is computed as
register_value = 1 + 4 + 64 = 69
Writing a value of 69 register 10 will energize relays 1,
3, and 7. This would have the same effect as writing a 1
to registers 19, 22, and 25.
Using Basic, the command becomes:
50 REGWRITE 10,69
The status of each relay may be read by polling the
appropriate register. Register 10 returns the status of
each relay in one number. In Basic, this may be done as:
100 A = REGREAD(10)
Assuming 69 was written to register 10, variable A
should return a value of 69.