Graphical Controls for XCP External Mode Simulations
You can control an XCP external mode simulation through:
The Hardware tab on the Simulink® Editor toolbar. To display the Hardware tab, from the Apps tab on the Simulink toolstrip, click Run on Custom Hardware.
The External Mode Control Panel. To open this dialog box, on the Hardware tab, in the Prepare section, click . Then, under Signal Monitoring & Tracing, click Control Panel.
Equivalent Controls on Hardware Tab and External Mode Control Panel
This table lists external mode actions that you can perform by using controls that are available in the Hardware tab and the External Mode Control Panel.
External Mode Action | Hardware Tab | External Mode Control Panel |
---|---|---|
Build target application. | Run on Hardware > Build for Monitoring | N/A |
Run application on target hardware. | Run on Hardware > Deploy | N/A |
Connect Simulink to a waiting or running target application. | Run on Hardware > Connect | Connect |
Start real-time execution of generated code in the target environment. | Run on Hardware > Start | Start Real-Time Code |
Disconnect Simulink from the target environment, but do not stop real-time execution of code. | Run on Hardware > Disconnect | Disconnect |
Stop target application execution and disconnect Simulink from the target environment. If you want to reestablish the external mode connection after stopping the target application, you must perform the Deploy step. | In Run on Hardware section, Stop button . | Stop Real-Time Code |
Tune batch of block parameters. You can modify values of tunable parameters in Simulink, and then update the parameters in the target application simultaneously. See Monitor Signal and Tune Parameter. | In Prepare section, Hold Updates and Update All Parameters buttons. | Batch download and Download |
XCP External Mode Control Panel
The External Mode Control Panel provides these controls for XCP external mode simulations.
Section | Control | Description |
---|---|---|
Connection and triggering | Connect | Connect Simulink to a waiting or running target application. When Simulink is connected to the target application, Connect changes to Disconnect. |
Start Real-Time Code | Start real-time execution of generated code in the target environment. When the generated code starts executing, the button changes to Stop Real-Time Code. | |
Arm Trigger | Arm the trigger that you specify through the External Signal & Triggering dialog box. If Simulink is not connected to the target application, the button appears dimmed. If Simulink is connected to the target application and the trigger is armed, the button becomes Cancel Trigger. | |
Cancel Trigger | Disarm the trigger. Once the trigger is disarmed, the button changes to Arm Trigger. | |
Floating scope | Enable data uploading | Selecting the check box arms the trigger for uploading target application data to Floating Scope blocks. |
Duration | Not supported. | |
Parameter tuning | Batch download | To tune a batch of block parameters:
|
Download | If the Batch download check box is not selected, the button appears dimmed. | |
Configuration | Signal & Triggering | Open the External Signal & Triggering dialog box. |
Data Archiving | XCP external mode simulations do not support this button, which appears dimmed. |
XCP External Signal & Triggering Dialog Box
For an XCP external mode simulation, you can use the External Signal & Triggering dialog box to:
Specify the logged signals that you want to monitor.
Configure a trigger that starts the uploading of data from the target application.
The External Signal & Triggering dialog box provides these controls.
Section | Control | Description |
---|---|---|
Signal selection | Select all | The Signal selection view lists top-model and referenced-model signals that are configured for logging. Simulink uploads a logged signal for monitoring only if the signal is selected in the Signal selection view. By default, this check box is selected, which enables monitoring of all logged signals. |
Clear all | Deselect the signals that are selected for monitoring. If the Select all check box is selected, this button appears dimmed. | |
on, off | If you select a row, clicking on selects the
corresponding signal for monitoring. The Selected column
displays the letter | |
Trigger Signal | If you select a row, clicking this button sets the corresponding signal
as the trigger for uploading target application data. The
Trigger column displays the letter If the configuration parameter
If the configuration parameter
| |
Go To Signal | To locate a signal in the model, select the corresponding row in the Signal selection view and then click this button. | |
Trigger options | Source | Specify how the trigger is armed:
|
Mode | Specify trigger rearming after a trigger event is complete:
| |
Duration | Specify the number of base rate steps for which the external mode simulation uploads data after a trigger event (default is 1000). For example, if Duration is set to 1000, and the base (fastest) rate of the model is one second:
If Send multiple contiguous samples in same packet is also selected, on the target hardware, the target application:
The Duration value, say
numOfSamplesSent = durationFieldValue/n n = (base rate)/(sample rate)When the sample
rate is the base rate ( | |
Delay | Apply a delay to data collection, which is the time between a trigger event and the start of data collection expressed in base rate steps. You can specify a positive value or zero (default). An XCP external mode simulation does not support a negative delay (pretriggering). | |
Arm when connecting to target | This check box is selected by default. Connecting Simulink to the target application arms the trigger.
If you clear the check box, you can arm the trigger by clicking the Arm Trigger button on the External Mode Control Panel. | |
Send multiple contiguous samples in same packet | This check box is not selected by default. If you select the check box, the XCP server uses the XCP DAQ packed mode for streaming signals to Simulink, which improves the ratio of useful data to control data in streamed signals. The target application sends samples from multiple time steps in a packet. The Duration value determines the number of samples in the packet. | |
Trigger signal | Direction | To enable the uploading of data from the target application when the trigger signal crosses the threshold value (specified by Level), specify the required direction of the signal:
|
Level | Specify the threshold value that the signal must cross to start the uploading of target application data. Default is 0. | |
Hold-off | Specify, in base rate steps, the time between the termination of one trigger event and the rearming of the trigger. Applies only when Mode value is normal. Default is 0. |