« Close

Datasheets and User Guides

App Notes

Software & Driver

 

4.3.8 - Raw Output/Input

There are two IOTypes used to write or read raw data. These can be used to make low-level function calls (Section 5) through the UD driver. The only time these generally might be used is to access some low-level device functionality not available in the UD driver, or when making OS portable code.


LJ_ioRAW_OUT
LJ_ioRAW_IN

When using these IOTypes, channel # specifies the desired communication pipe. For the U6, 0 is the normal pipe while 1 is the streaming pipe. The number of bytes to write/read is specified in value (1-16384), and x1 is a pointer to a byte array for the data. When retrieving the result, the value returned is the number of bytes actually read/written.

Following is example pseudocode to write and read the low-level command ConfigTimerClock (Section 5.2.4).


writeArray[2] = {0x05,0xF8,0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00};
numBytesToWrite = 10;
numBytesToRead = 10;

//Raw Out.  This command writes the bytes to the device.
eGetPtr(lngHandle, LJ_ioRAW_OUT, 0, &numBytesToWrite, pwriteArray);

//Raw In.  This command reads the bytes from the device.
eGetPtr(lngHandle, LJ_ioRAW_IN, 0, &numBytesToRead, preadArray);