4.4 RAM [T-Series Datasheet] | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver

Saturday/Sunday, March 28th&29th, 2020
Support: LabJack engineers available through email and chat.
Shipping: We are processing and shipping all orders.
Stock: 55/56 products in stock. More details.
Supply Chain: Some disruptions. More details.

4.4 RAM [T-Series Datasheet]


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 AIN#(0:149)_EF_INDEX

RAM-Allocating Registers

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

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             When STREAM_OUT#_ENABLE is enabled, the stream out target is generally updated by one value from the stream out buffer per stream scan. For example, there will generally be one instance of e.g. STREAM_OUT0 in the stream scan list, which will cause one STREAM_OUT0_BUFFER value to be consumed and written to STREAM_OUT0_TARGET for every stream scan. The stream scan list could also contain two instances of STREAM_OUT0, in which case two values from STREAM_OUT0_BUFFER value would be consumed and written for every stream scan.

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.

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.<br>0 = VM fully unloaded.<br>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.

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:<br>0=None(disabled);<br>1=Offset and Slope;<br>3=Max/Min/Avg;<br>4=Resistance;<br>5=Average and Threshold;<br>10=RMS Flex;<br>11=FlexRMS;<br>20=Thermocouple type E;<br>21=Thermocouple type J;<br>22=Thermocouple type K;<br>23=Thermocouple type R;<br>24=Thermocouple type T;<br>25=Thermocouple type S;<br>30=Thermocouple type C;<br>40=RTD model PT100;<br>41=RTD model PT500;<br>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

Name Start Address Type Access

SPI_GO             Write 1 to begin the configured SPI transaction.

5007 UINT16 W

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