ConfigU3 (U3 Only)
Writes and reads various configuration settings. Although this function has many of the same parameters as other functions, most parameters in this case are affecting the power-up values, not the current values. There is a hardware method to restore bytes 9-20 to the factory default value of 0x00: Power up the U3 with a short from FIO6 to SPC (FIO2 to SCL on U3 1.20/1.21), then remove the jumper and power cycle the device again.
If WriteMask is nonzero, some or all default values are written to flash. The U3 flash has a rated endurance of at least 20000 writes, which is plenty for reasonable operation, but if this function is called in a high-speed loop with a nonzero WriteMask, the flash could eventually be damaged.
Note: If the stream is running, you cannot update any of the values (WriteMask must equal 0).
Command: |
|
|
Byte |
|
|
|
|
|
0 | Checksum8 |
|
1 | 0xF8 |
|
2 | 0×0A |
|
3 | 0×08 |
|
4 | Checksum16 (LSB) |
|
5 | Checksum16 (MSB) |
|
6 | WriteMask0 |
|
|
| Bit 5: CompatibilityOptions Defaults |
|
| Bit 4: TimerClockConfig and Divisor Defaults |
|
| Bit 3: LocalID |
|
| Bit 2: DAC Defaults |
|
| Bit 1: Digital I/O Defaults |
|
| Bit 0: Reserved |
7 | WriteMask1 (Reserved) |
|
8 | LocalID |
|
9 | TimerCounterConfig |
|
|
| Bits 4-7: TimerCounterPinOffset |
|
| Bit 3: Enable Counter1 |
|
| Bit 2: Enable Counter0 |
|
| Bit 0-1: Number of timers enabled |
10 | FIOAnalog |
|
11 | FIODirection |
|
12 | FIOState |
|
13 | EIOAnalog |
|
14 | EIODirection |
|
15 | EIOState |
|
16 | CIODirection |
|
17 | CIOState |
|
18 | DAC1Enable |
|
19 | SWDT DAC0 RESPONSE |
|
20 | SWDT DAC1 RESPONSE |
|
21 | TimerClockConfig |
|
22 | TimerClockDivisor ( 0 = ÷256) |
|
23 | CompatibilityOptions |
|
24 | 0×00 |
|
25 | 0×00 |
|
|
|
|
|
|
|
Response: |
|
|
Byte |
|
|
0 | Checksum8 |
|
1 | 0xF8 |
|
2 | 0×10 |
|
3 | 0×08 |
|
4 | Checksum16 (LSB) |
|
5 | Checksum16 (MSB) |
|
6 | Errorcode |
|
7 | Reserved |
|
8 | Reserved |
|
9-10 | FirmwareVersion |
|
11-12 | BootloaderVersion |
|
13-14 | HardwareVersion |
|
15-18 | SerialNumber |
|
19-20 | ProductID |
|
21 | LocalID |
|
22 | TimerCounterMask |
|
23 | FIOAnalog |
|
24 | FIODirection |
|
25 | FIOState |
|
26 | EIOAnalog |
|
27 | EIODirection |
|
28 | EIOState |
|
29 | CIODirection |
|
30 | CIOState |
|
31 | DAC1Enable |
|
32 | DAC0 |
|
33 | DAC1 |
|
34 | TimerClockConfig |
|
35 | TimerClockDivisor (0 = ÷256) |
|
36 | CompatibilityOptions |
|
37 | VersionInfo |
|
WriteMask: Has bits that determine which, if any, of the parameters will be written to flash as the reset defaults. If a bit is 1, that parameter will be updated with the new passed value. If a bit is 0, the parameter is not changed and only a read is performed. Note that reads return reset defaults, not necessarily current values (except for LocalID). For instance, the value returned by FIODirection is the directions at reset, not necessarily the current directions.
LocalID: If the WriteMask bit 3 is set, the value passed become the default value, meaning it is written to flash and used at reset. This is a user-configurable ID that can be used to identify a specific LabJack. The return value of this parameter is the current value and the power-up default value.
TimerCounterConfig: If the WriteMask bit 1 is set, the value passed becomes the default value, meaning it is written to flash and used at reset. The return value of this parameter is a read of the power-up default. See ConfigIO.
FIO/EIO/CIO: If the WriteMask bit 1 is set, the values passed become the default values, meaning they are written to flash and used at reset. Regardless of the mask bit, this function has no effect on the current settings. The return value of these parameters are a read of the power-up defaults.
DAC: If the WriteMask bit 2 is set, the values passed become the default values, meaning they are written to flash and used at reset. Regardless of the mask bit, this function has no effect on the current settings. The return values of these parameters are a read of the power-up defaults.
TimerClockConfig & TimerClockDivisor: If the WriteMask bit 4 is set, the values passed become the default values, meaning they are written to flash and used at reset. The return values of these parameters are a read of the power-up defaults. See ConfigTimerClock.
CompatibilityOptions: If the WriteMask bit 5 is set, the value passed becomes the default value, meaning it is written to flash and used at reset. The return value of this parameter is a read of the power-up default. If bit 0 is set, Timer Counter Pin Offset errors are ignored. If bit 1 is set, all DAC operations will use 8-bit mode rather than 10-bit mode. Once this value has been changed the U3 will need to be restarted before the new setting will take affect.
FirmwareVersion: Fixed parameter specifies the version number of the main firmware. A firmware upgrade will generally cause this parameter to change. The lower byte is the integer portion of the version and the higher byte is the fractional portion of the version.
BootloaderVersion: Fixed parameter specifies the version number of the bootloader. The lower byte is the integer portion of the version and the higher byte is the fractional portion of the version.
HardwareVersion: Fixed parameter specifies the version number of the hardware. The lower byte is the integer portion of the version and the higher byte is the fractional portion of the version.
SerialNumber: Fixed parameter that is unique for every LabJack.
ProductID: (3) Fixed parameter identifies this LabJack as a U3.
VersionInfo: Bit 0 specifies U3B. Bit 1 specifies U3C and if set then bit 4 specifies -HV version.