DI-1000HS-1K Output Formats
Commands
If you are writing your own software to read sensor values from the DI-1000HS-1K interface unit, two commands are available to read the values. The commands are case insensitive. Both commands will stream the output continuously - simply send a carriage return (<CR>) to stop the output.
'WC' Command
About 575 readings/sec of data output.
This command outputs the load values in decimals according to the calibrated units (the calibration units are obtained using the UNITS command. The output format is:
%12.4f
A sample screen shot is shown below.
'H' Command
Above 1000 readings/sec of data output
This command outputs the raw counts in hexadecimal format. These are the A2D values, not load values. To convert raw counts to load To decode the hexadecimal values easily when writing your own programs,
- The negative hexadecimal values are multiplied by -1 and resulting positive values are simply output with a prefix of -1
- Positive values are prefixed with a space character and then output.
For each value, a print width of 7 is used
- One for the -ve sign if needed, otherwise a space character
- Six for the hexadecimal value
- In order to maintain as high an output rate as possible, a line feed is not printed after each value, only a carriage return.
For example, the raw counts of -193 will be displayed as
-0000C1
In Microsoft Excel, you can use the formula DEC2HEX and HEX2DEC to convert between the 2 formats. Take care to exclude the –ve sign when applying these formulas and only then to multiply the converted values by -1.
In Microsoft.NET (C# or Visual Basic.NET) you can use the following statement:
decimal_value = Convert.ToInt32(hex_value_string,16)
To convert the raw count values to load values:
- Issue the SWC command (Show Weight per Count) to display the Weight/Count in calibrated units. (Of course, you need to issue this command only once at the start of your application.)
- Multiply the Weight/Count value by the counts (obtained by sending the H command above) to obtain the loading in calibrated units.
- Perform your own unit conversion as necessary.
Occasionally, the DI-1000HS-1K will output a -1 as the raw count. Just ignore this value.
A sample screen shot is shown below.
Zeroing the sensor.
Send CT0 or TARE zero the sensor at any point.