Quick Start
Requirements
In order to operate your RT Box you need
a host computer (with Microsoft Windows, Mac OS X or Linux),
PLECS Blockset or Standalone 4.5 or newer and
PLECS Coder.
If you have not done so yet, please download and install the latest PLECS release on your host computer.
Install the Target Support Package
Download the appropriate ZIP archive from the web page https://www.plexim.com/download/rt_box/, extract it and move the folder PLECS_RT_Box e.g. to HOME/Documents/PLECS/CoderTargets. In PLECS, choose the entry Preferences… from the File menu (PLECS menu on macOS) to open the PLECS Preferences dialog.
On the Coder tab click on the Change button and select the folder HOME/Documents/PLECS/CoderTargets. The RT Box Target should now be listed under Installed targets.
Set up Zeroconf
The RT Box uses the Zero Configuration Networking (Zeroconf) protocol to facilitate network communication without the aid of additional network servers. To use Zeroconf, the corresponding software components are required on your host computer (which runs PLECS). It is also possible to use the RT Box without Zeroconf, but this requires additional steps for assigning an IP address, see Network Configuration.
On macOS, Zeroconf is integrated into the operating system.
On Linux, the avahi daemon and the libdnssd compatibility library must be installed. On Debian/Ubuntu Linux, the corresponding packages are named avahi-daemon and libavahi-compat-libdnssd1.
On Windows, Zeroconf is available through Apple’s Bonjour drivers, which may already be installed on your computer. Alternatively, you can install the appropriate mDNSInstaller package that is bundled with the Target Support Package. You find the 32-bit and 64-bit installer packages in the folder PLECS_RT_Box/bin/win.
Connect the RT Box
Use an Ethernet cable to connect the RT Box to your local network or – if your host computer supports Zeroconf – directly to an Ethernet port on your host computer.
Turn on the RT Box by flicking the power switch on the rear panel. The green Power LED at the front panel will turn on. When the RT Box has acquired a dynamic IP address from a DHCP server on the network, it will turn on the green Ready LED to indicate that it is ready to communicate.
Note
The Ready LED will not turn on if you have connected the box directly with your host computer so that it uses a self-assigned IP address.
To test the network connection, open a web browser on the host computer and enter the address http://rtbox-0123456789ab.local, where 0123456789ab is the MAC address of the RT Box (without colons), which you find on a sticker below the SD card slot on the back.
Upload a Model
In PLECS, choose the entry Demo Models from the Window menu to open the PLECS Demo Model Library. Open the demo model Basic Topologies / Boost converter and save it e.g. as HOME/Documents/PLECS/Boost-RT.plecs.
In order to generate code for the complete model, open the Coder Options dialog by choosing the entry Coder options… from the Coder menu. In the General tab set the Discretization step size parameter to e.g. 1e-5.
Now select the Target tab and switch the Target selector from Generic to either PLECS RT Box 1, PLECS RT Box 2, PLECS RT Box 3 or PLECS RT Box 4 depending on which target the model should later run. If this option is not available, the RT Box Support Package has not been installed correctly (see Install the Target Support Package).
In the Target device field, enter the address of your RT Box. If your host computer supports Zeroconf, a button marked … appears next to this field. A click on this button opens a browser that shows the RT Boxes that are visible in the network.
Click on the Build button at the bottom of the Coder Options dialog to start the build process. This will generate the C code for the model, compile it and upload it to the RT Box. After the successful upload, the blue Running LED on the front panel of the RT Box will turn on to indicate that the real-time application is running.
Start the External Mode
Select the External Mode tab of the Coder Options dialog and click on the Connect button. Set the Number of samples parameter to e.g. 200 and click on the Activate autotriggering button. PLECS will now capture the real-time signals of the Ammeter and Voltmeter in the model running on the RT Box and display them on the Scope in your PLECS model.
You can synchronize the data capture to a specific trigger event. To do so, set the Trigger channel selector from Off to the desired signal. The Scope will now show a small square indicating the trigger level and delay. If the level or delay are outside the current axes limits, a small triangle will be shown instead. Drag the trigger icon to change the trigger level; drag it with the left mouse-button pressed to change the trigger delay. Both parameters can also be set in the External Mode dialog.
Note
While a trigger channel is active, the Scope signals are only updated when a trigger event is detected.
While the PLECS model is connected to the RT Box, the model is locked against modifications. To disconnect from the RT Box, click on the Disconnect button or close the Coder Options dialog.
Shutdown
To turn off the RT Box, simply flip the power switch on the rear panel.
Next Steps
To connect the real-time application with real-world I/O signals, use the blocks from the PLECS RT Box library in the PLECS Library Browser. For instance, to use a digital input channel as the gate signal for the FET, replace the Pulse Generator with a Digital In block. To feed the current and/or voltage measurement back to an external controller via an analog output channel, use an Analog Out block and connect it to the desired meter.