![background image](http://html1.mh-extra.com/html/omega/if-006/if-006_user-manual_4024346028.webp)
28 |
P a g e
8.3
Read Command
The Read command accepts the repetition information, the starting register number, the number of elements to
be read and the format of the data. The starting register location
must
be provided while all other fields are
optional. If the number of elements is omitted, it is assumed to be one. If the data format is omitted, it is assumed
to be BYTES. There may be multiple number of elements and related format information contained within a read.
Commas or spaces may be used to separate the individual values.
R(ead) <repetition options> register [<number> <format <.precision>> …]
The simplest form is R 0x????, where 0x???? represents a value between 0x0000 and 0x0fff. The command will
return a single byte from the specified location.
A more complex example would be Read 0x38 1l 4f.2 to read the current time, and the 4 sensor readings. The Time
information is stored in register 0x38 as a 32-bit long value and is then immediately followed by the four sensor
results stored as floating point values at locations 0x003c to 0x004b.
// Location 0x3c represents the sensor readings, stored as floating point values.
// Read a single byte from the start of the sensor values (default count is 1, type byte)
R 0x3c
[Dev: 0x68 Reg: 0x3c Cnt: 0x01 -> 0x41 ]
// Read 2 bytes (the format defaults to BYTE)
R 0x3c 2
[Dev: 0x68 Reg: 0x3c Cnt: 0x02 -> 0x41, 0xb7 ]
// Read 3 ‘long ‘ (4 byte) values, representing 12 (0x0c) bytes
R 0x3c 3l
[Dev: 0x68 Reg: 0x3c Cnt: 0x0c -> 0x41b73333, 0x42483d71, 0x447605c3 ]
// Read 3 ‘float’ ( 4 byte ) values, representing 12 ( 0x0c ) bytes, default precision is 2
R 0x3c 3f
[Dev: 0x68 Reg: 0x3c Cnt: 0x0c -> 22.8, 50.1, 984.0 ]
// Read 3 float values and display with 4 digit precision
R 0x3c 3f.4
[Dev: 0x68 Reg: 0x3c Cnt: 0x0c -> 22.8899, 50.1899, 984.1099 ]
O v d
verbose, Decimal mode, Ignore INTR, I2C Addr: 0x68 @ 50 kbp, Modbus Addr: 0x01
Read 0x38 1l 4f.2
0000367195 23.22, 28.27, 1013.40, 0.00