« Close

Datasheets and User Guides

App Notes

Software & Driver

 

5.2.6 - ReadMem (ReadCal)

Reads 1 block (32 bytes) from the non-volatile user or calibration memory. The available memory is different for different versions of the U3.

Hardware version 1.30 & 1.21:
Command number 0x2A accesses the user memory area which consists of 512 bytes (block numbers 0-15). Command number 0x2D accesses the calibration memory area consisting of 512 bytes (block numbers 0-15). Do not call this function while streaming. Note that there are 512 Bytes of user memory available, but only 256 Bytes are accessible when using the LJ_chUSER_MEM function in the UD driver.

Hardware version 1.20:
Command number 0x2A accesses the user memory area which consists of 256 bytes (block numbers 0-7). Command number 0x2D accesses the calibration memory area consisting of 256 bytes (block numbers 0-7). Do not call this function while streaming.

Table 5.2.6-1. ReadMem command response

Command:  
Byte  
0 Checksum8
1 0xF8
2 0×01
3 0×2A (0×2D)
4 Checksum16 (LSB)
5 Checksum16 (MSB)
6 0×00
7 BlockNum
   
Response:  
Byte  
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

3 comments

I am writing a function that will call ReadMem, EraseMem, and then WriteMem.  The language that I am using is C#, and I am interfacing with LJUDDotNet.dll.  Whenever I try to call any low level function, I receive an Invalid Raw In/Out parameter error.  This error is consistent regardless of the low level command that I call.  I even tried the ConfigTimerClock sample command that is provided with the documentation and received the same error.

Below is my code for ConfigTimerClock in C#.

 

byte[] tArray = new byte[] { 0x05, 0xF8, 0x02, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
double numBytesWrite = 10;
double numBytesRead = 10;
LJUD.eGet(eLabJackDevice.ljhandle, LJUD.IO.RAW_OUT, LJUD.CHANNEL.HARDWARE_VERSION, ref numBytesWrite, tArray);
LJUD.eGet(eLabJackDevice.ljhandle, LJUD.IO.RAW_IN, LJUD.CHANNEL.HARDWARE_VERSION, ref numBytesRead, tArray);

 

The exception is thrown on the second call, however the value of numBytesWrite is set to 0 after the first call, so I would not be surprised if the first call was incorrect.  Am I doing something obviously wrong?

Also, I apologize if I am posting this under the wrong section.

Thanks,

I think the issue is passing LJUD.CHANNEL.HARDWARE_VERSION.  The value passed there should be 0 for what you wish to accomplish.

LJUD.CHANNEL.HARDWARE_VERSION is only used with LJUD.IO.GET_CONFIG to read the hardware version.

That fixed the issue.  Thank you.