Please enable JavaScript to view this site.

Waijung 2 User Guide

How this block appears in a Simulink model?

volatile_data_storage_block_1

What can be configured?

Volatile Data Storage Setup block

vol_data_storage

Configuration Parameter

Selectable Option/Value

Description

Storage name

 

Specify the name of the variable. It should be unique.

Define as volatile storage

Check--Uncheck

Declare the variable as a volatile or non-volatile

Data type

double--single--uint32--int32--uint16--int16--uint8--int8--char

Select the data type

Define as array

Check--Uncheck

Check to declare the variable as an array. Otherwise the array size will be 1

Array size

 

Specify the size of the array. This will show once the Define as array is checked

Initialize the storage

Check--Uncheck

Check this parameter to initialize the variable.

Initial value

 

Specify the value to initialize the variable

For char array: e.g 'Test string'

For other data type arrays: e.g {1,2,3,4,5}

Volatile Data Storage Read block

volatile_data_storage_block_3

Configuration Parameter

Selectable Option/Value

Description

Storage name

All available storage names in the current Simulink model

Select the storage name

Data type

 

Display the data type of the selected storage name which configured in the Volatile Data Storage Setup block

Data count

 

Number of elements to be read from the variable if it is declared as an array

Enable offset port

Check--Uncheck

This will enable the offset input port in the block. This offset port is used to specify the starting index of the array to be read. If the offset is specified, the data will be read from the offset to (offset + count) index.  

Sample time

-1 by default

Specify sample time

INPUT Port

Port Name

Port Type

Date Type

Description

Offset

Scalar

Any

This input port is used to specify the offset index if it is an array

 

OUTPUT Port

Port Name

Port Type

Date Type

Description

Data

Scalar/Vector

Depends on the data type of the variable which is configured in the Volatile Data Storage Setup block

This will output the stored data

Volatile Data Storage Write block

volatile_data_storage_block_4

Configuration Parameter

Selectable Option/Value

Description

Storage name

All available storage names in the current Simulink model

Select the storage name

Data type

 

Display the data type of the selected storage name which configured in the Volatile Data Storage Setup block

Data count

 

Number of elements to be write to the variable if it is declared as an array

Enable offset port

Check--Uncheck

This will enable the offset input port in the block. This offset port is used to specify the starting index of the array to be written. If the offset is specified, the data will be written from the offset to (offset + count) index.  

INPUT Ports

Port Name

Port Type

Date Type

Description

Offset

Scalar

Any

This input port is used to specify the offset index if it is an array

Data

Scalar/Vector

Depends on the data type of the variable which is configured in the Volatile Data Storage Setup block

 

When to use this block?

This block can be used to set up, read from, store to a volatile or non-volatile variable in Waijung 2. For convenience, it is implemented on three blocks. Namely,

Volatile Data Storage Setup

Volatile Data Storage Read

Volatile Data Storage Write

It is mandatory to have the Volatile Data Storage Setup block present in the model whenever the other blocks are used.

Demo

SPIFFS demo

Copyright 2024 Aimagin Co.,Ltd. Rev.1659