To RTDX - Add RTDX output channel

Library

rtdxBlocks in Target Support Package TC2 software

Description

When you generate code from Simulink in Real-Time Workshop software with a To RTDX block in your model, code generation inserts the C commands to create an RTDX output channel on the target. Output channels transfer data from the target to the host.

The generated code contains this command:

RTDX_enableOutput(&channelname)

where channelname is the name you enter in the channelName field in the To RTDX dialog box.

To use RTDX blocks in your model, you must do the following:

  1. Add one or more To RTDX or From RTDX blocks to your model.

  2. Download and run your model on your target.

  3. Enable the RTDX channels from MATLAB or use Enable RTDX channel on start-up on the block dialog.

  4. Use the readmsg and writemsg functions in MATLAB to send and retrieve data from the target over RTDX.

Dialog Box

Channel name

Name of the output channel to be created by the generated code. The channel name must meet C syntax requirements for length and character content.

Enable blocking mode

Enables blocking mode (selected by default). In blocking mode, writing a message is suspended while the RTDX channel is busy, that is, when data is being written in either direction. The code waits at the RTDX_write call site while the channel is busy. Any interrupt of the higher priority will temporary divert the program execution from this site, but it will eventually come back and wait until the channel stops writing.

When blocking mode is not enabled (when the check box is cleared), writing a message is abandoned if the RTDX channel is busy, and the code proceeds with the current iteration.

Enable RTDX channel on start-up

Enables the RTDX channel when you start the channel from MATLAB. With this selected, you do not need to use the enable function in Embedded IDE Link CC software to prepare your RTDX channels. This option applies only to the channel you specify in Channel name. You do have to open the channel.

See Also

From RTDX

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS