

Table 5.4-3.PureGDK was created to bring the power of the DarkBasic Professional engine to the PureBasic language. Following are some examples of fixed point arrays and the associated floating point double values. Calibration Constants Block #Įach value is stored in 64-bit fixed point format (signed 32.32 little endian, 2's complement).
PUREBASIC 4.20 WINDOWS
The high level Windows DLL (LabJackUD) does this automatically. This information can then be used to convert all analog input readings to voltages. Generally when communication is initiated with the U6, ten calls will be made to the ReadMem function to retrieve the first 10 blocks of memory. Temp (K) = (Volts * TemperatureSlope) + TemperatureOffsetīelow are the various calibration values are stored in the Mem area. Internal Temperature can be obtained by reading channel 14, applying the proper voltage conversion then using the following formula. To convert the desired voltage to binary select the Slope and Offset calibration constants for the DAC being used and plug into the following formula. Writing to the U6's DAC require that the desired voltage be converted into a binary value. The simple formula is: Volts = (Slope * Bits) + Offset When using the simple formula negative values will be off by a few bits (up to 5 bits in testing, but this value has not been characterized). The offset calibration has been provided so that the same simple formula used on the U3 and UE9 can be used on the U6. Most applications will use the actual calibrations constants (PositiveSlope, Offset, Center, NegativeSlope) stored in the internal flash. The actual nominal constants are provided in the tables below, and should be used if the actual calibration constants are not read for some reason. Where span is the maximum voltage minus the minimum voltage from the tables above. Volts(uncalibrated) = (Bits/65536)*Span – Span/2 (Differential)īinary readings are always unsigned integers. The approximate nominal conversion from binary to voltage is: Volts(uncalibrated) = (Bits/65536)*Span (Single-Ended) To justify a 24-bit value to 16-bits divided it by 256 and store it as floating point, so that the information in the lower 8-bits is retained. This means that 24-bit values must be justified to 16-bit values before applying a calibration. All readings and the calibration constants are 16-bit aligned. The voltage of any analog input pin, compared to ground, must be in the range -10.58 to +10.10 volts.ĭepending on how an analog reading is obtained either 16 or 24 bits are returned. Note that the minimum differential input voltage of -10.58 volts means that the positive channel can be as much as 10.58 volts less than the negative channel, not that the positive channel can be +10 and the negative -10 as this results in a +20V signal which is outside the range that the U6 can measure. Internal Temperature: This calibration is applied to a reading from channel 14 (internal temp) after the binary has been converted to Volts. These are just a number there is no related formula. The calibrations are the number of amps measured during calibration. The U6 uses multiplexed channels connected to a differential input amp so, single ended and differential readings use the same calibration.Īnalog Output: Only two calibrations are provided, one for DAC0 and one for DAC1.Ĭurrent Source: Two calibrations are provided, one for Iout0 and one for Iout1.
PUREBASIC 4.20 PRO
The calibration constants stored on the U6 can be categorized as follows:Īnalog Input: The U6 has 4 gains and the pro has a 24-bit sigma-delta converter, so total of eight calibrations are provided: one for each gain for each converter. When using Modbus the U6 will apply calibration automatically, so voltages are sent to and read from the U6, formatted as a float. Converting between binary and voltages requires the use of calibration constants and formulas. The majority of the U6's analog interface functions return or require binary values. The UD driver, for example, normally returns voltage readings unless binary readings are specifically requested. Readings in volts already have the calibration constants applied. This information is only needed when using low-level functions and other ways of getting binary readings.
