
17-26
System 3
BH32 Behavioral Cage Controller
BH32
Circuit
Design
To communicate with an RZ device, the BH32 must first be paired with the RZ
device. See “RZ Configuration” on page 17-22, for more information. Once paired,
there are several circuit macros available to access the BH32 using the UDP
interface on an RZ device. If using one, two, three or four BH32s on the network,
use the RZ_BH_Send_1-4Ch and RZ_BH_Rec_1-4Ch macros. If using more than
four BH32s, use the RZ_BH_Send_MC and RZ_BH_Rec_MC macros. All macros can
be configured to specify the number of BH32s, which corresponds to the size of the
underlying UDP packets.
RZ_BH_Send
Macros
The RZ_BH_Send macros are used to send 32-bit words from the RZ over UDP to
BH32 devices numbered from 1 to 4. The macro automatically sends a new packet
if any of the Inputs change value. The 32-bit integer represents the current state of
all I/O on the BH32 device. The ordering is as follows:
| Bit31 …………………………………. Bit0 |
| A8 … A1 | B8 … B1 | C8 … C1 | D8 … D1 |
Example:
To change the state of D1 on BH32 Device Number 2, toggle the first bit of Input-
2 of RZ_BH_Send_1-4Ch or channel two of RZ_BH_Send_MC’s Input.
An output labeled “Busy” indicates if the macro is currently in the process of
sending out a packet. The duration of the busy signal is dependent on the number
of BH32 devices (it takes NumberOf2 samples to send a packet).
Note:
Since the data packets are sent serially, it is recommended that the macro inputs
are latched during transmission to ensure that the packet contains data from the
same sample in time.
RZ_BH_Rec
Macros
The RZ_BH_Rec macros are used to receive 32-bit words from networked BH32
devices through the RZ UDP port. The structure of each 32-bit word is described in
the Packet Structure section below.