Skip to Main Content Skip to Search
Product Documentation

C2000 From RTDX - Add RTDX communication channel for target to receive data from host

Library

Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ RTDX Instrumentation

Description

When you generate code from Simulink in Simulink Coder software with a From RTDX block in your model, code generation inserts the C commands to create an RTDX input channel on the target. Input channels transfer data from the host to the target.

The generated code contains this command:

RTDX_enableInput(&channelname)

where channelname is the name you enter in Channel name.

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 on the MATLAB command line to send and retrieve data from the target over RTDX.

,For more information about using RTDX in your model, see the following demos:

Dialog Box

Channel name

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

Enable blocking mode

Blocking mode instructs the target processor to pause processing until new data is available from the From RTDX block. If you enable blocking and new data is not available when the processor needs it, your process stops. In nonblocking mode, the processor uses old data from the block when new data is not available. Nonblocking operation is the default and is recommended for most operations.

Initial conditions

Data the processor reads from RTDX for the first read. If blocking mode is not enabled, you must have an entry for this option. Leaving the option blank causes an error in Simulink Coder software. Valid values are 0, null ([ ]), or a scalar. The default value is 0.

0 or null ([ ]) outputs a zero to the processor. A scalar generates one output sample with the value of the scalar. If Output dimensions specifies an array, every element in the array has the same scalar or zero value. A null array ([ ]) outputs a zero for every sample.

Sample time

Time between samples of the signal. The value defaults to 1 second. This produces a sample rate of one sample per second (1/Sample time).

Output dimensions

Dimensions of a matrix for the output signal from the block. The first value is the number of rows and the second is the number of columns. For example, the default setting [1 64] represents a 1-by-64 matrix of output values. Enter a 1-by-2 vector 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 increase the speed of your application running on your target. Throughput remains the same in samples per second processed. Frame-based operation is the default.

Data type

Type of data coming from the block. Select one of the following types:

  • Double — Double-precision floating-point values. This is the default. Values range from -1 to 1.

  • Single — Single-precision floating-point values ranging from -1 to 1.

  • Uint8 — 8-bit unsigned integers. Output values range from 0 to 255.

  • Int16 — 16-bit signed integers. With the sign, the values range from -32768 to 32767.

  • Int32 — 32-bit signed integers. Values range from -231 to (231-1).

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 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

ticcs, readmsg, C2000 To RTDX, writemsg.

References

RTDX 2.0 User's Guide, Literature Number: SPRUFC7, available from the Texas Instruments Web site.

How to Write an RTDX Host Application Using MATLAB, Literature Number: SPRA386, available from the Texas Instruments Web site.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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