October 24, 2012

Getting started with Speedgoat platform

We will be using Speedgoat Performance real-time target machine for our experiments. It is running under FreeDOS and is aimed to be used together with xPC Target package from Mathworks, which means that one creates a Simulink model, which is afterwards executed in external mode (i.e. it is compiled into an executable code and launched on the target machine). The target machine can either run in standalone mode, or be connected to a host PC during execution of the target application. We are using the second mode of operation, because one needs a licence for xPC Target Embedded Option to be able to deploy standalone applications.
The target machine is connected to the host PC via Ethernet cable (it can be connected to the LAN as well, but we are using a direct connection with dedicated Network Adapters).

Settings

The easiest way is to use the graphical interface of the xPC Explorer. To launch the explorer, type 'xpcexplr' in Matlab command line window. Through the xPC Explorer, you can connect/disconnect target machines, launch/stop target applications, monitor/trace/log signals from the target application when it is running etc. Various settings of the target machine including the target-host communication settings are available through graphical interface of xPC Explorer. To communicate successfully, you have to set the host and target IP addresses according to your real network configuration. (The default settings are 192.168.7.1 for target and 192.168.7.2 for host PC)
To make the settings persistent, save the settings in the xPC Explorer, insert a USB stick into the host PC (will connect e.g. as drive 'E:') and then type 'speedgoatmachineboot('E:')' in Matlab command line window. This will generate boot files on the USB stick. Then disconnect the USB stick from the host PC, plug it into the target machine and boot the target machine. It should load the new core including all your settings. Then you are asked to remove the USB stick and re-boot the target machine, this time already with the new settings.
The settings can be checked using a pre-implemented configuration test which is launched by command 'xpctest'.

Timeout during the initialization of the target application

With a more complex target application, it can happen that a timeout occurs during its initialization on the Target PC and the Target disconnects from the Host as a result. Even though it is possible to reconnect to the Target with initialized target application, it is annoying. Fortunately, it is quite easy to fix this issue by setting the communication timeout in the Model Configuration Parameters of the target model in Simulink (choose pane Code Generation > xPC Target options).
Setting the communication timeout to avoid problems during initialization of the target application

1 comment: