5.2.6 - ReadMem (ReadCal) [U6 Datasheet] | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver

Friday April 3rd, 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.

5.2.6 - ReadMem (ReadCal) [U6 Datasheet]

Reads 1 block (32 bytes) from the non-volatile user or calibration memory. Command number 0x2A accesses the user memory area which consists of 512 bytes (block numbers 0-7). Command number 0x2D accesses the calibration memory area consisting of 512 bytes (block numbers 0-15), of which the last 6 blocks are not used. Do not call this function while streaming.

Note that the U6 has 512 Bytes of user memory, but only 256 Bytes are accessible when using the LJ_chUSER_MEM function in the UD driver.

Table 5.2.6-1. ReadMem command response

0 Checksum8
1 0xF8
2 0×01
3 0×2A (0×2D)
4 Checksum16 (LSB)
5 Checksum16 (MSB)
6 0×00
7 BlockNum
0 Checksum8
1 0xF8
2 0×11
3 0×2A (0×2D)
4 Checksum16 (LSB)
5 Checksum16 (MSB)
6 Errorcode
7 0×00
8-39 32 Bytes of Data



I am using a U6 to stream two channels of analogue reads at 10 kSa/sec (ioSTART_STREAM command in MATLAB).  Now I would like to use one digital channel to output a 64 bit binary sequence of pseudo-random 0s and 1s at a maximum bit refresh rate of 1 kHz.

So I envisage something like this:

Load 64-bit MLS sequence into memory

Start stream

Set digital output to value stored in MLS(0) (and hold value)

pause 1ms 

Set digital output to value stored in MLS(1)

pause 1ms


...Set digital output to MLS(63)

and repeat indefinitely.  Is there a way of doing this, given that ReadMem cannot be called while streaming?  So a possible digital output may be [0 1 0 1 1 1 1 0 0 0 1 0 1 0 0 0 1 1 ... 0 ] for example, with each bit held for 1 ms, while streaming two analogue inputs at 10 kHz.

Thanks for your time.

The memory areas related to the function above will not help, but sounds like SPI will do what you want.  Check out Section 4.3.10.  One thing with SPI, though, is that it will not repeat.  You will have to call it each time, so in between each group of 64 bits the gap might be a few milliseconds rather than 1 ms.