![]() |
| RabbitNet Peripheral Cards User's Manual |
5. Relay Card
Chapter 5 describes the features and the use of the Relay Card, one of the peripheral cards designed for use with the RabbitNet expansion ports on selected Rabbit Semiconductor single-board computers, operator interfaces, and RabbitCore Prototyping Boards.
Figure 34 shows a conceptual view of the Relay Card connected to a master.
![]()
NOTE The OP7200 master and the RabbitCore Prototyping Boards do not supply any power to the slave. 5.1 Features
- 6 SPDT relays rated at 250 V AC, 1200 V·A (30 V DC up to 240 W) with built-in snubbers
- can be mounted in standard 100 mm DIN rail trays sold by other suppliers
- interfaces with master through RabbitNet serial protocol at 1 Megabit per second using standard Ethernet cable, can be up to 10 m (33 ft) away from master
5.1.1 Software
The Relay Card is a slave; the master to which it is connected is programmed using version 8.01 or later of Rabbit Semiconductor's Dynamic C. If you are using a BL2500 or an OP7200 as your master with an earlier version of Dynamic C, Rabbit Semiconductor recommends that you upgrade your Dynamic C installation. Contact your authorized Rabbit Semiconductor distributor or your Rabbit Semiconductor Sales Representative for more information on Dynamic C upgrades.
5.2 Connections
Use a straight-through CAT 5/6 Ethernet cable to connect the Relay Card's RJ-45 RabbitNet jack to a RabbitNet port on the master. You may use either port if you are connecting to a master such as the BL2500 that has more than one RabbitNet port.
NOTE The RJ-45 RabbitNet jacks are serial I/O ports for use with a master and a network of peripheral cards. The RabbitNet jacks do not support Ethernet connections. ![]()
You will also have to provide a separate +5 V DC power supply to your Relay Card. This power supply is connected via the polarized friction-lock terminal at header J7. You may assemble a suitable cable using the friction-lock connectors from the Connectivity Kit described in Section 1.1.3. If you are using a BL2500 as your master, you may draw this power from the BL2500 as shown in Figure 35. See Section 5.2.1 for detailed wiring diagrams.
At the present time, the number of peripheral cards you can use with one master is limited by the number of RabbitNet ports on the master.
5.2.1 Power Supply
Figure 36 illustrates the assembled friction-lock connector wiring diagram for the power supplies used to supply power to the Relay Card.
![]()
It is best to use a type of cable where the wires for the ground and positive(s) of any power supply are bound together or twisted, and ideally the power-supply wires should not be bundled with other wires.
Large transient currents flow in the ground and positive supply wires when the relay output drivers are switched on/off, and it is imperative that any ground differential resulting from resistive or inductive loss in the ground wire be kept as low as possible (<4 V). Use the GND pin on header J7 on the Relay Card if you have separate power supplies. Rabbit Semiconductor also recommends that you have a physical ground connection between the Relay Card and the master, which you will have if the power to header J7 on the Relay Card already comes from the master.
5.3 Pinout
The Relay Card pinouts are shown in Figure 38.
![]()
5.3.1 Headers
Relay Cards are equipped with six screw-terminal headers (J1-J6), a 1 × 4 friction-lock terminal (J7--DCIN and +5 V power supplies), and an RJ-45 RabbitNet jack.
No header is installed at J9, which is used to program the Relay Card at the factory.
5.3.2 Indicator LEDs
An indicator LED (DS7) located below the RabbitNet connector at J8 turns on when the Relay Card is powered up, then goes off when the Relay Card has completed its initialization process and is running. The LED will be on while the Relay Card is receiving a transmission from the master.
Additional indicator LEDs (DS1-DS6) located near each relay will turn on while the corresponding relay (Relay 1 - Relay 6) is energized.
5.4 Relay Outputs
The Relay Card has six SPDT relays, each of which is rated to handle up to 250 V AC, 1200 V·A (max. 10 A) or up to 30 V DC, 240 W (max. 8 A). Each relay draws approximately 83 mA from the +5 V power supply when energized. This current draw can be reduced by approximately a factor of two by using the
rn_RelayPwr()function call to engage the power-save mode once a relay is energized.Figure 39 illustrates one of the six relay output circuits. An LED is associated with each relay, and is on while the relay is energized.
![]()
Each relay has built-in snubbers, which consist of a resistor and a capacitor in parallel with the contacts to reduce arcing. Although the original role of the snubbers was to preserve the life of the relay contacts by reducing arcing, snubbers are particularly beneficial in circuits driving inductive loads, where they limit voltage transients and reduce electromagnetic interference.
Depending on the reactive load you plan to operate with the Relay Card, you may want to change the resistor and capacitor values used for the built-in snubber circuit. This can be done easily since all the resistors and capacitors used in the snubber circuits are through-hole parts.
5.5 Software
This section provides the libraries, function calls, and sample programs related to the Relay Card.
5.5.1 Dynamic C Libraries
In addition to the library associated with the master single-board computer such as the BL2500 or OP7200, one other library is needed to provide function calls for the Relay Card.
RNET_RELAY.LIB--provides functions unique to the Relay Card. Function calls for this library are discussed in this chapter.Functions relevant to RabbitNet peripheral cards in general are described in Section 1.3.4. Other functions applicable to all devices based on Rabbit microprocessors are described in the Dynamic C Function Reference User's Manual.
5.5.2 Sample Programs
Sample programs are provided in the Dynamic C
SAMPLESfolder.The various folders contain specific sample programs that illustrate the use of the corresponding Dynamic C libraries. For example, the sample program
PONG.Cdemonstrates the output to the STDIO window.To run a sample program, open it with the File menu (if it is not still open), then compile and run it by pressing F9 or by selecting Run in the Run menu. The RabbitNet peripheral card must be connected to a master such as the BL2500 with its Demonstration Board connected as explained in the Coyote (BL2500) User's Manual or other user's manual. The BL2500 or other master must be in Program Mode, and must be connected via the programming cable to a PC.
The
SAMPLES\RABBITNET\RN1400subdirectory contains the following sample programs. When running these sample programs, the Relay Card may be connected to either RabbitNet port on a master such as the BL2500 that has two RabbitNet ports. The sample program will usern_find()and the product RN1400 as the search criteria to first find any Relay Cards connected to the master. The first Relay Card found will run the sample program.
RELAY_ALL.C--Demonstrates how to activate all the relays in parallel using thern_RelayAll()function call.
- Once you have compiled this sample program and it is running, use F2 to set a breakpoint on either of the following two statements in
mainlinefor a given relay to verify the relay connections:
printf("All Relays COM is connected to its NO contact\n");
- or
printf("All Relays COM is connected to its NC contact\n");
- Once you hit the breakpoint use an ohmmeter to verify that the contacts are connected, the ohmmeter reading should be ~0 W for contacts that are connected and high impedance for the contacts that are not connected.
NOTE When the relays are toggled, the LED for the given relay will also be toggled.
RELAY_LOW_PWR.C--Demonstrates how to configure the relays to operate in the power-save mode. A relay is first activated normally for 50 ms, and is then pulsed every millisecond with a 50% duty-cycle square wave, which essentially cuts the power required to keep the relay energized in half. Since the operation of a relay in the power-save mode will reduce the relay-holding force, this mode is not recommended when the relay may be subject to shock and vibration.
- The normal relay-activation current is ~80 mA, which is reduced to ~40 mA for a given relay with the power-save mode.
- Before you run this sample program, place an ammeter in series with the power-supply GND lead going to the Relay Card to verify that current drawn by the relay is in fact reduced in the power-save mode.
- Now compile and run this program. Watch the ammeter and the Dynamic C STDIO window to view the current readings for the various relay states.
RELAY_SEQUENCE.C--Demonstrates how to activate the relays sequenually to keep the peak power surges to a minimum while the relays are being activated.5.5.3 Relay Card Function Calls
int rn_Relay(int handle, int relay, int value, int reserved);
- Sets the state of a given relay by connecting the relay common contact to either the relay normally closed contact or to the relay normally open contact.
Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
- relay is the selected relay (0-5).
valueis used to set a given relay connection as follows:
- 0 = common connected to normally closed contact
1 = common connected to normally open contact
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command. -1 means that device information indicates the Relay Card is not connected to the master.
See Also
rnRelayAll, rnRelayPwr
int rn_RelayAll(int handle, int control, int reserved);
- Sets the state of all the relays with the given bitwise control value. Connects the relay common contact to either the relay normally closed contact or to the relay normally open contact.
Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
- control establishes the bitwise control of Relays 0-5. The bit positions 0-5 correspond directly to Relays 0-5, with the bit value controlling the relay as follows:
- 0 = common connected to normally closed contact
1 = common connected to normally open contact
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command. -1 means that device information indicates the Relay Card is not connected to the master.
See Also
rnRelayPwr, rnRelayExample
rn_RelayAll(handle, 0x05, 0);
// Sets the relays to have the following connections:
Relay0...Common connected to Normally Open contact
Relay1...Common connected to Normally Closed contact
Relay2...Common connected to Normally Open contact
Relay3...Common connected to Normally Closed contact
Relay4...Common connected to Normally Closed contact
Relay5...Common connected to Normally-Closed contact
void rn_RelayPwr(int handle, int control, int reserved);
- Sets the specified relays to be in a power reduction/save mode. The power-save mode is activated after the relay has been active for at least 50 ms, after which the relay will be pulsed every 1 ms with a 50% duty cycle square wave, which should provide a power reduction of 50% for the given relay.
- If this function isn't called, the relays will operate without going into the power-save mode of operation.
Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
- control establishes the bitwise control of Relays 0-5. The bit positions 0-5 correspond directly to Relays 0-5, with the bit value controlling the relay as follows:
- 0 = set relay for normal operation
1 = set relay for power-save mode
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command. -1 means that device information indicates the Relay Card is not connected to the master.
See Also
rnRelayAll, rnRelayExample
rn_RelayPwr(handle, 0x05, 0);
// Sets the relays for the following operation:
Relay0.....Set to power-save mode
Relay1.....Set for normal operation
Relay2.....Set to power-save mode
Relay3.....Set for normal operation
Relay4.....Set for normal operation
Relay5.....Set for normal operation5.5.4 Status Byte
Section 1.3.5 provides information on the status bytes returned by various function calls.
5.6 Specifications
5.6.1 Electrical and Mechanical Specifications
Figure 40 shows the mechanical dimensions for the Relay Card.
![]()
NOTE All diagram and graphic measurements are in inches followed by millimeters enclosed in parentheses. Table 10 lists the electrical, mechanical, and environmental specifications for the Relay Card.
5.6.2 Physical Mounting
Figure 41 shows position information to assist with interfacing other boards with the Relay Card.
![]()
| Rabbit Semiconductor www.rabbit.com |