3 using diagnostic parameters, 4 decoding the diagnostic code, 1 excitation strength – Campbell Scientific CDM-VW300 Series Dynamic Vibrating-Wire Analyzer System User Manual
Page 67: 2 low-amplitude warning flag, Using diagnostic parameters, Decoding the diagnostic code, Excitation strength, Low-amplitude warning flag

CDM-VW300 Series Dynamic Vibrating-Wire Analyzers
8.5.1.3 Using Diagnostic Parameters
Although a frequency reading may be provided when an amplitude or
frequency warning flag is true, the measurement should be accepted only with
caution. Rather than risk accepting bad data, consider setting the SysOptions
argument of the CDM_VW300Config() instruction to force the analyzer to
report the frequency measured under these conditions as NAN. A low- or high-
amplitude warning flag can be set for any one measurement, but not both. A
low- or high-frequency warning flag can be set for any one measurement, but
not both. Any one amplitude flag and any one frequency flag can be set
simultaneously.
8.5.1.4 Decoding the Diagnostic Code
To recover the five diagnostic parameters from a diagnostic code, the bit
pattern represented by the twelve least-significant bits of the 32-bit diagnostic
code is decoded.
8.5.1.4.1
8.5.1.4.2
Excitation Strength
The eight least-significant bits (2
0
through 2
7
) of the diagnostic code represent
the excitation strength (0 to 255). When no low- or high-amplitude or
frequency warning flags are true, the diagnostic code has a value between 0
and 255. If amplitude- or frequency-warning flags are set, the integer will be
larger than 255. To strip the warning flags out of the diagnostic code, a bit-
masking operation is performed.
The bit-masking operation uses the AND operator in CRBasic. The following
CRBasic statement decodes excitation strength in volts from the integer:
ExciteStrengthV = (DiagCode AND 255) / 42.5
where DiagCode is the diagnostic code and ExciteStrengthV is assigned a
Float data type. This ensures that only the eight least-significant bits are
considered, resulting in an intermediate value between 0 to 255 and a result
between 0 and 6 V.
Low-Amplitude Warning Flag
The ninth bit (2
8
or 256) corresponds to the low-amplitude warning flag. Use
the following expression to isolate the state of this bit:
(DiagCode AND 256)
This expression results in zero if the bit is not set (in other words, low-
amplitude warning flag is false) and 256 if the bit is set (in other words, low-
amplitude warning flag is set true). Since many diagnostic codes are given each
second, a counter is normally used to track occasional instances of this flag
being set. The following CRBasic statement counts the number of times a low-
amplitude warning flag is set true.
If (DiagCode AND 256) Then LowAmpCount=LowAmpCount + 1
where LowAmpCount is assigned a Long data type. An alternative is to
assign the expression to a Boolean value. However, seeing the warning will be
difficult if it is set and reset too rapidly:
57