A2C-SG2-M12
WWW.LILLIESYSTEMS.COM
36 of 44
15
Calibrating
The strain gauge amplifier is calculated with unitless values. A high and low value is required. This can be a strain gauge excitation,
a millivolt signal etc.
The easiest way is to use the U2C and the A2C Sensor Utility. For most accurate calibration, the signal should be held steady for 1
second, before and after the measurement is taken by the sensor.
15.1.1
Command: Calibrate input channels using floating point data
Command
Sub
Command
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
0x20
Channel
Data MSB
Data
Data
Data LSB
High/Low
0x80
DLC = 0x08
Channel:
0x00 = Calibrate channel 1
0x01 = Calibrate channel 2
High/Low:
0x00 = Low value of calibration data
0x01 = High value of calibration data
Example 1
Using 2-point calibration on channel 1, low value of 0.0f and high value of 500.0f
A float with a value of 0.0f will be all zeroes (data bytes 2-5)
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0x20
0x00
(channel 1)
0x00
0x00
0x00
0x00
0x00 (low)
0x80
DLC = 0x08
Now we need to set the high value. A float of 5000.0f will in bytes be: 0x45 0x9c 0x40 0x00
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0x20
0x00
(channel 1)
0x45
0x9C
0x40
0x00
0x01 (high)
0x80
DLC = 0x08
Other examples of float to byte conversions:
A float of 1000.12f will in bytes be: 0x44 0x7A 0x07 0xE6
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0x20
0x00
(channel 1)
0x44
0x7a
0x07
0xe6
0x01 (high)
0x80
DLC = 0x08
A float of -
123.987f will in bytes be: 0xC2 0xF7 0xF9 0x58
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0x20
0x00
(channel 1)
0xC2
0xF7
0xF9
0x58
0x01 (high)
0x80
DLC = 0x08
Compared to some converters from float to bytes, it may be required to reverse the array.
For an online converter please try: https://gregstoll.com/~gregstoll/floattohex/