Skip to Main Content Skip to Search
Product Documentation

Curtiss-Wright Electronic Systems Shared Memory

xPC Target supports reflective (shared) memory boards manufactured by Curtiss-Wright Electronic Systems (http://www.cwcelectronicsystems.com/data_communications.html) – formerly Systran®.

Before You Start

Create Shared Memory Partitions

The xPC Target software uses a model for reflective memory (also known as shared memory) that includes Simulink blocks for shared memory driver functions and MATLAB structures to define node initialization and shared memory partitions. This topic describes xPC Target support of the Systran SCRAMNet+ SC150 board.

To use the xPC Target Systran SCRAMNet+ SC150 shared memory blocks, you must define shared memory partition structures. A partition structure describes how you want to allocate (partition) the shared memory. The xPC Target software allocates shared memory as segments of data that are packed into memory regions or partitions. Along with the Shared Memory Pack and Shared Memory Unpack blocks, the following SCRAMNet+ SC150 blocks use shared memory partition structures:

After defining the shared memory partitions, you can add SCRAMNet+ SC150 shared memory driver blocks to your Simulink model. See Shared Memory Partition Structure for the complete list of fields in a partition structure.

The following description refers to the completepartitionstruct command. Type

help completepartitionstruct

for more information.

Initialize Shared Memory Nodes

In addition to shared memory partitions, you must also define a node initialization structure before using the SCRAMNet+ SC150 shared memory blocks. A node initialization structure describes the shared memory partitions (see Create Shared Memory Partitions) and the SCRAMNet+ SC150 board configuration, including any interrupt settings if used. The following SCRAMNet+ SC150 block requires a shared memory node initialization structure.

After defining the node initialization structure, you can add SCRAMNet+ SC150 shared memory driver blocks to your Simulink model. See Shared Memory Node Initialization Structure for the complete list of fields in a node initialization.

The following description refers to the completenodestruct command. Type

help completenodestruct

for more information.

Systran Shared Memory Structure Reference

Shared Memory Partition Structure

A shared memory partition structure has the following fields. You do not need to use all the fields of a partition or node initialization structure. However, knowing the possible structure fields will be helpful when you are setting up to use shared memory.

        Address: '0x0'
           Type: 'uint32'
           Size: '1'
      Alignment: '4'
            RIE: 'off'
            TIE: 'off'
    ExtTrigger1: 'off'
    ExtTrigger2: 'off'
          HIPRO: 'off'
       Internal: [1x1 struct]

where

Partition Fields

Description

Address

Specifies the base address (in hexadecimal) of the memory partition within the node's shared memory space. The default value is '0x0', the first location in shared memory. Note that the base address is byte aligned.

Type

Specifies the data type of the memory segment. Specify one of the following types:

  • double

  • float

  • uint8

  • int8

  • uint16

  • int16

  • uint32

  • int32

  • boolean (a single byte represents a boolean value)

The default value is 'uint32'. A minimum partition size is 32 bits.

Size

Specifies the dimension and size of the memory segment. You can enter a scalar value or a value with the [m,n] format. The default value is '1'.

  • scalar — Treats the Size entry as the specification of the length of a non-oriented array or vector

  • [m,n] — Treats the Size entry as an array dimension. The total number of elements in this segment is m*n.

Alignment

Specifies the byte alignment of the next partition (if one is defined). Enter alignment value in bytes: 1, 2, 3, 4. The default value is '4', forcing a double word boundary alignment for all elements. See Alignment Examples.

RIE

Specifies whether or not this partition can receive interrupts (Receive Interrupt Register (RIE)). Specify 'off', 'first', 'all', 'last'. The default value is 'off'.

'off' — Prevents the partition from receiving interrupts

'first' — Allows only the first double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'all' — Allows all memory locations of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'last' — Allows only the last double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

TIE

Specifies whether or not this partition can transmit interrupts (Transmit Enable (TIE)). Specify 'off', 'first', 'all', 'last'. The default value is 'off'.

'off' — Prevents the partition from transmitting interrupts

'first' — Allows only the first double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'all' — Allows all memory locations of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'last' — Allows only the last double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

ExtTrigger1

If this partition receives a write access, specifies whether or not this partition can generate a trigger signal to an external connector. Specify 'off', 'first', 'all', 'last'. The default value is 'off'.

'off' — Prevents the partition from generating signals

'first' — Allows only the first double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'all' — Allows all memory locations of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'last' — Allows only the last double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

ExtTrigger2

If this partition receives a write access, specifies whether or not this partition can generate a trigger signal to an external connector. Specify 'off', 'first', 'all', 'last'. The default value is 'off'.

'off' — Prevents the partition from generating signals

'first' — Allows only the first double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'all' — Allows all memory locations of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

'last' — Allows only the last double word of the memory segment to be marked with the corresponding Auxiliary Control RAM bit.

HIPRO

Specifies whether or not the elements in this partition can be transmitted as one network message. Specify 'off', or 'on'. The default value is 'off'.

'off' — Prevents the partition from transmitting the elements as one message

'on' — Allows the partition to transmit the elements as one message

Internal

Reserved for internal use.

Alignment Examples.  This example shows the shared memory map with default alignment values.

Partition1(1).Type='int32';
Partition1(1).Size='1';

Partition1(2).Type='boolean';
Partition1(2).Size='1';

Partition1(3).Type='uint32';
Partition1(3).Size='1';
Partition1 = completepartitionstruct(Partition1,'scramnet');

This example shows the shared memory map with alignment value changed from 4 to 1 in the second partition.

Partition1(1).Type='int32';
Partition1(1).Size='1';
Partition1(1).Alignment='4';

Partition1(2).Type='boolean';
Partition1(2).Size='1';
Partition1(2).Alignment='1';

Partition1(3).Type='uint32';
Partition1(3).Size='1';
Partition1 = completepartitionstruct(Partition1,'scramnet');

This example shows the shared memory map with alignment value changed from 4 to 2 in the second partition.

Partition1(1).Type='int32';
Partition1(1).Size='1';
Partition1(1).Alignment='4';

Partition1(2).Type='boolean';
Partition1(2).Size='1';
Partition1(2).Alignment='2';

Partition1(3).Type='uint32';
Partition1(3).Size='1';
Partition1 = completepartitionstruct(Partition1,'scramnet');

Shared Memory Node Initialization Structure

A node initialization structure has the following fields:

     Interface: [1x1 struct]
    Partitions: [1x1 struct]

where

Node Structure Fields

Description

Interface

Specifies settings for the board Control/Status Register (CSR). The Interface structure has the following fields. Refer to the SCRAMNet+ SC150 product documentation for a description of the CSR and its operation modes.

  • Mode — Configures board modes (see Board Mode)

  • Timeout — Enables the board to set the timeout value (see Board Timeout)

  • DataFilter — Controls the data filtering operation (see Board Data Filter)

  • VirtualPaging — Controls the board virtual paging operation (see Virtual Paging)

  • Interrupts — Enables the board to generate and receive interrupts from the network (see Board Interrupts)

  • Internal — Reserved for internal use

Partitions

Stores the shared memory segments (see Create Shared Memory Partitions)

Board Mode.  The SCRAMNet+ SC150 board has a number of modes that you can set through the Interface.Mode field. The Interface Mode fields set the corresponding bits in the CSR. To display the board mode fields, type

>> node.Interface.Mode
ans = 
          NetworkCommunicationsMode: 'TransmitReceive'
                         InsertNode: 'on'
          DisableFiberOpticLoopback: 'on'
                 EnableWireLoopback: 'off'
           DisableHostToMemoryWrite: 'off'
                 WriteOwnSlotEnable: 'off'
                 MessageLengthLimit: '256'
    VariableLengthMessagesOnNetwork: 'off'
                        HIPROEnable: 'off'
                   MultipleMessages: 'on'
           NoNetworkErrorCorrection: 'on'
           MechanicalSwitchOverride: 'on'
                     DisableHoldoff: 'on'

These modes have the following values:

Field

Values

Default

CSR

NetworkCommunications Mode

'none', 'receiveonly', 'transmitonly',
'transmit
receive'

'transmit
receive'

CSR3[8..15]

InsertNode

'off', 'on'

'on'

CSR0[0..1]

DisableFiberOptic Loopback

'off', 'on'

'on'

CSR2[6]

EnableWire Loopback

'off', 'on'

'off'

CSR2[7]

DisableHost ToMemory Write

'off', 'on'

'off'

CSR2[8]

WriteOwnSlotEnable

'off', 'on'

'off'

CSR2[9]

Message LengthLimit

'256', '1024'

'256'

CSR2[11]

Variable Length MessagesOn Network

'off', 'on'

'off'

CSR212]

HIPROEnable

'off', 'on'

'off'

CSR2[13]

Multiple Messages

'off', 'on'

'on'

CSR2[14]

NoNetwork Error Correction

'off', 'on'

'on'

CSR2[15]

Mechanical Switch Override

'off', 'on'

'on'

CSR8[11]

Disable Holdoff

'off', 'on'

'on'

CSR8[11]

Board Timeout.  The SCRAMNet+ SC150 board allows you to set the network timeout through the Interface.Timeout field. The Interface Timeout fields set the corresponding bits in the CSR.

To display the timeout fields, type

>> node.Interface.Timeout
ans = 
       NumOfNodesInRing: '2'
    TotalCableLengthInM: '2'

These fields have the following values:

Field

Values

Default

CSR

NumOfNodes InRing

'0'..'255'

'2'

CSR5

TotableCable LengthInM

'0'..'n'

'2'

CSR5

Refer to the SCRAMNet+ SC150 product documentation for a description of these fields.

Board Data Filter.  The SCRAMNet+ SC150 board allows you to set the data filter operation through the Interface.DataFilter field. The Interface DataFilter fields set the corresponding bits in the CSR.

>> node.Interface.DataFilter
ans = 
           EnableTransmitDataFilter: 'off'
    EnableLower4KBytesForDataFilter: 'off'
 >>

These fields have the following values:

Field

Values

Default

CSR

Enable TransmitData Filter

'off', 'on'

'off'

CSR0[10]

EnableLower4KBytesFor DataFilter

'off', 'on'

'off'

CSR0[11]

Virtual Paging.  The SCRAMNet+ SC150 board allows you to set the bits of the Virtual Paging Register operation through the Interface.VirtualPaging field. The Interface VirtualPaging fields set the corresponding bits in the CSR.

>> node.Interface.VirtualPaging
ans = 
    VirtualPagingEnable: 'off'
      VirtualPageNumber: '0'

These fields have the following values:

Field

Values

Default

CSR

VirtualPagingEnable

'off', 'on'

'off'

CSR12[0]

VirtualPage Number

'0'..'2047'

'0'

CSR12[5..15]

Board Interrupts.  The SCRAMNet+ SC150 board allows you to specify the interrupt sources transmitted and received between the nodes of the network. You can set these bits through the Interface.Interrupts field. The Interface Interrupts fields set the corresponding bits in the CSR.

>> node.Interface.Interrupts
ans = 
                 HostInterrupt: 'off'
    InterruptOnMemoryMaskMatch: 'off'
      OverrideReceiveInterrupt: 'off'
              InterruptOnError: 'off'
              NetworkInterrupt: 'off'
     OverrideTransmitInterrupt: 'off'
            InterruptOnOwnSlot: 'off'
      ReceiveInterruptOverride: 'off'

These fields have the following values:

Field

Values

Default

CSR

HostInterrupt

'off', 'on'

'off'

CSR0[3]

InterruptOn MemoryMask Match

'off', 'on'

'off'

CSR0[5]

Override Receive Interrupt

'off', 'on'

'off'

CSR0[6]

InterruptOn Error

'off', 'on'

'off'

CSR0[7]

Network Interrupt

'off', 'on'

'off'

CSR0[8]

Override Transmit Interrupt

'off', 'on'

'off'

CSR0[9]

InterruptOn OwnSlot

'off', 'on'

'off'

CSR2[10]

Receive Interrupt Override

'off', 'on'

'off'

CSR8[10]

  


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