User Manual
4.27 WriteMem
Writes 4 bytes to the LabJack's 8,192 byte nonvolatile memory at a specified address. The data
is read back and verified after the write. Memory 0-511 is reserved for configuration and
calibration data. Memory from 512-1023 is unused by the LabJack and available for the user
(this corresponds to starting addresses from 512-1020). Memory 1024-8191 is used as a data
buffer in hardware timed AI modes (burst and stream). Execution time for this function is 20
milliseconds or less.
Declaration:
long WriteMem ( long *idnum,
long unlocked,
long address,
long data3,
long data2,
long data1,
long data0 )
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
• *idnum – Local ID, serial number, or -1 for first found.
• unlocked – If >0, addresses 0-511 are unlocked for writing.
• address – Starting address for writing (0-8188).
• data3 – Byte for address.
• data2 – Byte for address+1.
• data1 – Byte for address+2.
• data0 – Byte for address+3.
Outputs:
• *idnum – Returns the local ID or –1 if no LabJack is found.
4.28 BuildOptionBits (ActiveX only)
This function is only in the OCX, and is used to build the optionBits parameter for
AIBurst and AIStreamStart.
The parameter optionBits is made up of the following bits and can often just be set to 2 (normal
operation with the LED on):
• bit 0 => demo
• bit 1 => ledOn
• bit 2 => disableCal
• bits 3,4 => transferMode
• bit 5 => updateIO
• bit 6 => stateIOin(0)
• bit 7 => stateIOin(1)
• bit 8 => stateIOin(2)
• bit 9 => stateIOin(3)
Declaration:
long BuildOptionBits ( long demo,
long ledOn,
long disableCal,
long transferMode,










