Code File Location: VisualSim/actor/lib/Memory_Init
o Initialize local and global memory locations.
o It can be placed anywhere in the model.
The block is used to define memory locations that can be used in Expression, Decision, Basic Processing (Statement etc.), Smart_Machine and Virtual_Machine blocks. The values of the Global memories are available anywhere in the model. Local memory is available only in the current block-diagram window. All block diagram windows that are, below, above or in parallel cannot access local memory.
To understand the usage and how to initialize the memory, view the Memory Initialize Example in the BDE. To see the current value in a memory location at any time during the simulation, view the Memory Trace Example in the BDE.
The memory is defined with the following format:
Memory Name Type (Local/global) Initial_Value
ArrayMem local 1.0
ÞNote:
ÞAccess:
Parameter
|
Explanation
|
Type
|
Example
|
Block Documentation |
Enter the comments or brief description about the Memory_Init_Text. |
- |
- |
Memory_Init_Text |
The list of memories is defined in this window. Each memory location must be on a separate line and must conform to: MemoryName Type InitialValue |
- |
Memory1 local
1 |
The possible initial values are:
Name
|
Type
|
Value
|
Memint |
global |
1 /* Integer Memory */ |
Memdbl |
global |
1.0 /* Double Memory */ |
Memarray |
global |
{1,2,3,4} /* Array memory. All must be same type. */ |
MemDS |
global |
Processor_DS /* DS Memory. Processor_DS is a Data Structure Template */ |
Memarray1 |
global |
{10:Processor_DS} /*DS Array Memory. 10 Processor_DS */ |
MemDS1 |
global |
{first=1, third="string"} /* Fields defined here */ |
Memstr |
global |
"Destination" /* String Memory */ |
Membool |
global |
TRUE /* Boolean Memory of TRUE or FALSE */ |
Memlong |
global |
1L /* Long memory */ |
MemExpr |
global |
(1+2+ParamName) /* Long memory */ |