From RTDX - Add RTDX™ communication channel to send data from MATLAB® software to target

Library

RTDX Instrumentation in Target Support Package™ TC6 software

Description

When you generate code from your Simulink® model in Real-Time Workshop® software with this block in place, code generation inserts the C commands to create an RTDX input channel on the target. The inserted code opens and enables the channel with the name you specify in Channel name in the block parameters. You can open, close, disable, and enable the channel from the host side afterwards, overriding the target side status.

In the generated code, you see a command like the following

RTDX_enableInput(&channelname)

where channelname is the name you enter in Channel name.

In simulations this block does not perform any operations with the exception that the block will generate an output matching your specified initial conditions. From RTDX blocks work only in code generation and when your model runs on your target.

If you are using Embedded IDE Link™ CC software, you need to configure and cleanup RTDX properly before and after executing your model or code. Refer to the Getting Started with RTDX™ in Embedded IDE Link CC documentation in the online help system to see an example of how to do this housekeeping task.

The initial conditions you set in the block parameters determine the output from the block to the target for the first read attempt. Specify the initial conditions in one of the following ways:

Using RTDX in your model involves:

To see more details about using RTDX in your model, refer to the Embedded IDE Link CC documentation.

Dialog Box

Channel name

Defines the name of the input channel to be created by the generated code. Recall that input channels refer to transferring data from the host to the target (input to the target). To use this RTDX channel, you enable and open the channel with the name, and send data from the host to the target across this channel. Specify any name as long as it meets C syntax requirements for length and character content.

Enable blocking mode

Puts RTDX communications into blocking mode where the target processor waits to continue processing until new data is available from the From RTDX block. Selecting blocking mode slows your processing while the processor waits — if your new data is not available when the processor needs it, your process stops. In non blocking mode, the processor uses old data from the block when new data is not available. Non blocking operation is the default and recommended for most operations.

Selecting the Blocking option disables the Initial conditions option.

Initial conditions

Specifies what data the processor reads from RTDX for the first read. This can be 0, null ([ ]), or a scalar. You must have an entry for this option. Leaving the option blank causes an error in Real-Time Workshop software.

Sample time

Specifies the time between samples of the signal. The default is 1 second between samples, for a sample rate of one sample per second (1/Sample time).

Output dimensions

Defines a matrix for the output signal from the block, where the first value is the number of rows and the second is the number of columns in the output matrix. For example, the default setting [1 64] represents a 1-by-64 matrix of output values. Enter a 1-by-2 vector of doubles for the dimensions.

Frame-based

Sets a flag at the block output that directs downstream blocks to use frame-based processing on the data from this block. In frame-based processing, the samples in a frame are processed simultaneously. In sample-based processing, samples are processed one at a time. Frame-based processing can greatly increase the speed of your application running on your target. Note that throughput remains the same in samples per second processed. Frame-based operation is the default.

Data type

Sets the type for the data coming from the block. Select one of the following types:

Enable RTDX channel on start-up

When your application code includes RTDX channel definitions, selecting this option enables the channels when you start the channel from MATLAB software. With this selected, you do not need to use Embedded IDE Link CC software enable function to prepare your RTDX channels. The option applies only to the channel you specify in Channel name. You do have to open the channel.

See Also

ticcs, readmsg, To RTDX, writemsg

  


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