BusWorks
Model 903MB/902MB/901MB Network I/O Module User’s Manual Digital I/O
___________________________________________________________________________________________
- 12 -
Force Single Coil Example Query
Field Name
Example Value (Hex)
Slave Address
247 (F7)
Function Code
5 (05)
Coil Address High Order
0 (00)
Coil Address Low Order
9 (09)
Force Data High Order
255 (FF)
Force Data Low Order
0 (00)
Error Check (LRC or CRC)
--
Force Single Coil Example Response
Field Name
Example Value (Hex)
Slave Address
247 (F7)
Function Code
5 (05)
Coil Address High Order
0 (00)
Coil Address Low Order
9 (09)
Force Data High Order
255 (FF)
Force Data Low Order
0 (00)
Error Check (LRC or CRC)
--
The Force Single Coil response is an echo of the query as
shown above, returned after executing the force coil command.
No response is returned to broadcast queries from a master.
Preset Single Register (06)
This command will preset a single holding register (4x
reference address) to a specific value. Broadcast transmission is
supported by this command and will act to preset the same
register in all networked slaves.
The Preset Single Register query specifies the register
reference address to preset, and the preset value. Registers are
addressed starting at 0--registers 1-16 are addressed as 0-15.
The Preset Single Registers response message is an echo of the
query, returned after the register contents have been preset. The
following example writes a baud rate of 9600bps to holding
register 40002 (Baud Rate) at slave device 247:
Preset Holding Register Example Query
Field Name
Example Value (Hex)
Slave Address
247 (F7)
Function Code
6 (06)
Register Address High Order
0 (00)
Register Address Low Order
1 (01)
Preset Data High Order
0 (00)
Preset Data Low Order
2 (02)
Error Check (LRC or CRC)
--
Preset Holding Register Example Response
Field Name
Example Value (Hex)
Slave Address
247 (F7)
Function Code
6 (06)
Register Address High Order
0 (00)
Register Address Low Order
1 (01)
Preset Data High Order
0 (00)
Preset Data Low Order
2 (02)
Error Check (LRC or CRC)
--
The response simply echoes the query after the register
contents have been preset. No response is returned to broadcast
queries from a master device.
Force Multiple Coils (15)
(902MB & 903MB Models Only)
This command will simultaneously force a sequence of coils
(0x reference addresses) either ON or OFF. Broadcast
transmission is supported by this command and will act to force
the same block of coils in all networked slaves.
The Force Multiple Coils query specifies the starting coil
reference address to be forced, the number of coils, and the force
data to be written in ascending order. The ON/OFF states are
specified by the contents in the query data field. A logic 1 in a bit
position of this field requests that the coil turn ON, while a logic 0
requests that the corresponding coil be turned OFF. Unused bits
in a data byte should be set to zero. Note that coils are
referenced starting at 0—up to 12 coils are addressed as 0-11
and this also corresponds to the output channel number.
The Force Multiple Coils normal response message returns
the slave address, function code, starting address, and the
number of coils forced, after executing the force instruction. Note
that it does not return the byte count or force value.
The following example forces odd-numbered coils (outputs)
OFF, and even numbered coils ON, for coils 0-11 at slave device
247:
Force Multiple Coils Example Query
Field Name
Example Value (Hex)
Slave Address
247 (F7)
Function Code
15 (0F)
Coil Address High Order
0 (00)
Coil Address Low Order
0 (00)
Number Of Coils High Order
0 (00)
Number Of Coils Low Order
12 (0C)
Byte Count
02
Force Data High (First Byte)
170 (55)
Force Data Low (Second Byte)
5 (05)
Error Check (LRC or CRC)
--
Note that the leading character of the 0x reference address is
implied by the function code and omitted from the address
specified. In this example, the first address is 00001,
corresponding to coil 0, and referenced via 0000H. Thus, the first
byte transmitted will address coils 7...0, with the least significant
bit addressing the lowest coil in this set as follows:
Bin
0
1
0
1
0
1
0
1
Hex
5
5
Coil
7
6
5
4
3
2
1
0
The second byte transmitted will address coils 11...8, with the
least significant bit addressing the lowest coil in this set as
follows (note that the four unused upper bits in the second data
byte are set to zero):
Bin
0
0
0
0
0
1
0
1
Hex
0
5
Coil
NA
NA
NA
NA
11
10
9
8