How Do I ... ? |
Control an Infrared Device |
|
Almost any device that has an infrared remote control, such as a DVD Player, Plasma screen or satellite set-top box, can be controlled from Stardraw Control using an attached infrared port.
There is a multimedia walk-through of these techniques in the online Technical Resources.
To send remote control commands, you will need an infrared transmitter that your control PC can send the command data to, and you will need to know the make and model of the device you wish to control.
The hardware you will need is:
an infrared emitter or "eye" that can transmit IR remote control frequencies,
a converter device that can output infrared codes from your control PC to the infrared emitter.
Typically, you will need a separate converter (or a converter with multiple IR outputs) for each infrared device you wish to control. There are different types of converters available that use RS232, USB or Ethernet connections from your control PC, and have varying numbers of IR outputs.
Examples of Ethernet to IR converters that are supported by Stardraw Control are:
Global Caché GC-100
Xantech RS232IR
Notes
The infrared port found on many laptops, tablet PCs and UMPCs is usually an IrDA A common term for infrared wireless communication, the IrDA is the "Infrared Data Association" standards body that defines specifications and protocols. port, which is used for short-range wireless communication between portable computers, mobile phones and PDAs, etc. Because IrDA operates at a different frequency from handheld remote controls, you cannot control IR devices directly from your PC: you will require an external infrared emitter.
The devices mentioned above are not specific recommendations; please refer to Manufacturers and Equipment for more information.
Stardraw Control has a large built-in library of manufacturers and products and their remote control codes, however if your device is not listed or a specific function you require is not included in the Stardraw library, you will need to obtain the device's CCF Control Code File: a text file that represents an infrared remote control command for a particular device, represented by a series of hex codes. codes from the manufacturer.
Note
A CCF code (such as the example below) represents a single remote control function, such as Play, Mute or Channel Up. You will need to obtain CCF codes for all of the remote control functions you wish to perform.
A typical CCF code looks like this:
0000 0067 0000 0022 0155 00ac 0016 003f 0016 003f 0016 0015 0016 0015 0016 0015 0016 003f 0016 0015 0016 003f 0016 0015 0016 0015 0016 003f 0016 003f 0016 003f 0016 0015 0016 003f 0016 0015 0016 0015 0016 003f 0016 003f 0016 003f 0016 003f 0016 0015 0016 0015 0016 003f 0016 003f 0016 0015 0016 0015 0016 0015 0016 0015 0016 003f 0016 003f 0016 0015 0016 0597
If the CCF codes cannot be obtained from the device's manufacturer, you could:
check whether your device's remote control codes are compatible with a model that is supported by Stardraw Control,
search the internet for third-party code files that are compatible with your device,
post a message on the Stardraw Forums asking whether anyone has the CFF codes and may be willing to share them with you,
use an IR receiver device and software to capture commands directly from the device's remote control, in the similar way that a learning remote control does. Make sure the software you use can output or save to CCF format.
Tip
Global Caché's GC-IRL receiver device and software can be used with a PC to learn infrared remote control codes. The utility software displays the captured codes, which can be copied to the Windows clipboard as a CCF format code.
Please refer to the Support section for additional assistance.
To add support for infrared remote control, the first step is to add an Infrared Device to your project and connect it to your converter device.
In the Topology View, locate the Infrared Device in the Stardraw Control Products List.
Click and drag the device to add it to your topology.
In the Choose Infrared Device dialog that appears, first select the device manufacturer from the Manufacturer list.
Select the device's model number from the Model Number list.
In the Functions list will appear all of the remote control functions that are supported.
If the functions you wish to use are not listed in the Functions list you can add them easily; please refer to Modifying Infrared Devices below.
If the manufacturer or model number is not listed in the Choose Infrared Device dialog, you may need to create a custom infrared device; please refer to Creating Infrared Devices below.
In the Topology View, locate the serial converter in the Stardraw Control Products List.
Click and drag the device to add it to your topology.
Connect the IR input port of your infrared device to the corresponding IR output of your serial converter.
All the functions for your IR devices appear as callable methods from within the Actions editor. Any IR function can be called in response to any event.
In the Actions Editor, all the remote control functions for an IR device are listed when the device is selected. Even if you add extra functions to the device, the list will automatically update when next viewed.
The following procedure illustrates how to create an Action that calls the Play command on an IR device named "Infrared Device (1)" in your topology.
To call an IR function in response to any device or control Event:
In the Forms View, locate the form or control that fires the Event you wish to capture.
Add the following Action
to call the Play command:
Devices –
Infrared Device (1) –
IR –
Play
Click Ok to close the Actions dialog.
You can easily add, modify or delete infrared remote control functions for any device in either the My Libraries list or the current project's Topology View. This may be necessary if the standard Stardraw library for your device does not include the functions you need.
Notes
For this procedure you will need the CCF Control Code File: a text file that represents an infrared remote control command for a particular device, represented by a series of hex codes. codes for all of the remote control functions you wish to add.
Modifying an infrared device in the Topology View will alter only that copy in the current project. Alternatively you can modify the device from the My Libraries list, which will make your changes available for any project.
In the My Libraries list or Topology View, double-click the infrared device you wish to modify.
In the Product Properties, click Edit: in the Port dialog that appears, click Edit to view the IR Codes list.
Double-check that the function is not already listed: it may have a different name to what you expect.
To add a new remote control function, click Add: the IR Function editor dialog will appear.
The IR Function editor
Specify an appropriate Function Name, e.g. "Play", "Mute", "Channel Up" etc.
Paste the CCF Code from the IR capture software or from your manufacturer's documentation into the box provided.
Click Ok: Stardraw Control will validate the code and, if accepted, the IR Function dialog will close.
Repeat steps 4 to 7 for each function you wish to add.
In the IR Codes list you can edit or delete any existing code.
Note
This should be done with great care, especially if you are modifying the device directly from the Topology View, as it will affect any existing Actions that may use those functions.
Creating new infrared devices is similar to modifying an existing infrared device, as detailed above, but with a few extra steps. This may be necessary if the standard Stardraw library does not include the device you need.
Note
For this procedure you will need the CCF Control Code File: a text file that represents an infrared remote control command for a particular device, represented by a series of hex codes. codes for all of the remote control functions you wish to create.
In the Topology View, click the Add New Product button on the toolbar, press F8 or click the Tools menu and select Add New Product.
Select the device manufacturer from the Manufacturer list: if the manufacturer is not listed, click New to add the manufacturer.
Supply the relevant Model Number and Description, then click OK.
In the Product Properties dialog, the Shared option can be cleared if you do not wish to share your new device driver with other Stardraw Control users; otherwise leave this option set.
Click Add to create a new port: specify "IR" as the Port Name, and select "InfraRed Input" as the Port Type.
Click Edit: the IR Codes list will be displayed.
To create a new infrared function click Add: the IR Function editor dialog will appear.
Specify an appropriate Function Name.
Paste the CCF Code into the box provided.
Click Ok: Stardraw Control will validate the code and, if accepted, the IR Function dialog will close.
Repeat steps 7 to 10 for each function you wish to create.
When you have finished, the new infrared device will appear in the My Libraries list: you can now use the new device by clicking and dragging it onto your topology.
Infrared Drivers