« Close

Datasheets and User Guides

App Notes

Software & Driver

 

4.4 RAM [T-Series Datasheet]

Overview

Maximum system RAM: 64 KB

When enough RAM is allocated, the next attempt to allocate RAM will fail with the error SYSTEM_MEMORY_BEREFT (errorcode: 2400).

If SYSTEM_MEMORY_BEREFT is occurring, your application must either use smaller amounts of RAM or free previously allocated RAM. Some common things to try:

  • To free allocated stream RAM, stop stream. To use less stream RAM, use a smaller STREAM_BUFFER_SIZE_BYTES and/or smaller STREAM_OUT#(0:3)_BUFFER_ALLOCATE_NUM_BYTES
  • To free other allocated RAM:
    • Write 0 LUA_RUN
    • Write 0 USER_RAM_FIFO#(0:3)_ALLOCATE_NUM_BYTES
    • Write 0 AIN#(0:149)_EF_INDEX

RAM-Allocating Registers

The below registers allocate system RAM (and may return SYSTEM_MEMORY_BEREFT):

Stream
Name Start Address Type Access

STREAM_ENABLE             Write 1 to start stream. Write 0 to stop stream. Reading this register returns 1 when stream is enabled. When using a triggered stream the stream is considered enabled while waiting for the trigger.

4990 UINT32 R/W

STREAM_OUT#(0:2)_ENABLE             Write 1 to enable, 0 to disable. When enabled, you get 1 update per target per stream scan, so a stream must be active for updates to happen.

4090 UINT32 R/W

STREAM_BUFFER_SIZE_BYTES does not allocate RAM, but it does set the amount of RAM allocated by STREAM_ENABLE. LJM_eStreamStart writes to STREAM_ENABLE.

Similarly, STREAM_OUT#(0:3)_BUFFER_ALLOCATE_NUM_BYTES does not allocate RAM, but sets the amount of RAM allocated by STREAM_OUT#(0:3)_ENABLE.

Lua
Name Start Address Type Access

LUA_RUN             Writing 1 compiles and runs the Lua script that is loaded in RAM. Writing zero stops the script and begins cleaning up memory. Users may poll the register after writing a value of 0 to verify that the VM is unloaded, and garbage collection is complete. 0 = VM fully unloaded. 1 = Running/in-progress

6000 UINT32 R/W

LUA_SOURCE_SIZE             Allocates RAM for the source code.

6012 UINT32 R/W

LUA_DEBUG_ENABLE             Write 1 to this register to enable debugging.

6020 UINT32 R/W

Lua scripts dynamically allocate RAM.

User
Name Start Address Type Access

USER_RAM_FIFO#(0:2)_ALLOCATE_NUM_BYTES             Allocate memory for a FIFO buffer. Number of bytes should be sufficient to store users max transfer array size. Note that FLOAT32, INT32, and UINT32 require 4 bytes per value, and UINT16 require 2 bytes per value. Maximum size is limited by available memory. Care should be taken to conserve enough memory for other operations such as AIN_EF, Lua, Stream etc.

47900 UINT32 R/W

AIN Extended Features
Name Start Address Type Access

AIN#(0:148)_EF_INDEX             Specify the desired extended feature for this analog input with the index value. List of index values: 0=None(disabled); 1=Offset and Slope; 3=Max/Min/Avg; 4=Resistance; 5=Average and Threshold; 10=RMS Flex; 11=FlexRMS; 20=Thermocouple type E; 21=Thermocouple type J; 22=Thermocouple type K; 23=Thermocouple type R; 24=Thermocouple type T; 25=Thermocouple type S; 30=Thermocouple type C; 40=RTD model PT100; 41=RTD model PT500; 42=RTD model PT1000.

9000 UINT32 R/W

AIN#(0:148)_EF_READ_A             Function dependent on selected feature index.

7000 FLOAT32 R

File I/O
Name Start Address Type Access

FILE_IO_PATH_WRITE_LEN_BYTES             Write the length (in bytes) of the file path or directory to access.

60640 UINT32 W

SPI
Name Start Address Type Access

SPI_GO             Write 1 to begin the configured SPI transaction.

5007 UINT16 W

Serial
Name Start Address Type Access

ASYNCH_NUM_BYTES_TX             The number of bytes to be transmitted after writing to GO. Max is 256.

5440 UINT16 R/W

ASYNCH_ENABLE             1 = Turn on Asynch. Configures timing hardware, DIO lines and allocates the receiving buffer.

5400 UINT16 R/W