TECHNICAL NOTES - DT8


APPLICATION NOTE - DAS8/DGR33A

Generic-Binary Data Types for Pseudo-Trace Creation

Generic-binary data types for creation of pseudo-traces were introduced in MCM firmware revision RMS1551-01-C. They are primarily intended to handle binary data from RMS Instruments' AADCII, and take advantage of the support of BiSync-like protocols by the SIM in revisions RMS1527-01-C and RMS1356-02-H [1].

The new data types introduced can be defined as 1-, 2-, 3- or 4-byte binary (2's complement, least-significant-byte (LSB) first) values. In particular, in the case of the AADCII 4-byte values are used.

Since the internal data representation in the system is 2-bytes wide, a scaling factor must be specified in the syntax that defines the pseudo-trace. In addition to this basic scaling, it is also possible to further process the data by the application of a 3% hysteresis-like transfer function, or the Fourth-Difference algorithm; this leads to several variations of the basic generic-binary data type, which will be explained in the following sections.

I. Definition and scaling of pseudo-traces

The syntax to specify a pseudo-trace with one of the generic-binary data types is as follows:

    BUFF yyyyH xxnnH ,

where BUFF is the named buffer, y represents an offset from BUFF (16-bit integer, in hexadecimal notation), and the second argument indicates scaling factor and number of bytes as follows:

    x = scaling factor; 8-bit integer in hexadecimal notation

    n = number of bytes; 8-bit integer, in hexadecimal notation.

For correct syntax, the values of x and n must satisfy the relationships shown in Table 1. The reason for these limits will become clearer when the interpretation of the scaling factor x is discussed below. If the syntax employed violates these restrictions, the conversion routines will assume default values of n = 2 bytes, x = 14.

Table 1 - Acceptable values for scaling factor and number of bytes.
Default is n = 2, x = 14

The scaling factor indicates the bit position at the input which is to correspond to the most-significant-bit [msb], excluding the sign bit, at the 2-byte output (bit position 0 = least-significant-bit [lsb]).

For an (n-byte integer) input value Ni, scaling results in a (2-byte integer) output value No, with the same sign, such that:
 
|No| = (|Ni|. 214-x mod 215
(1)

The internal representation of No in units of [volts] is given by Vo = 10 No / 215. One unit (or one "lsb") of Ni would then correspond to 10 (214-x)/215 volts, from which we define the scaling factor S:
 
S =10/2x+1 [volts/unit] . 
(2)

Example 1:

As an example, in Fig. 1 we show the interpretation of the syntax using n = 4 bytes and x = 16, which assuming a zero offset would be entered as

      BUFF 0H 1004H .

Notice how x simply specifies the group of bits in Ni that will be assigned to the 15 least-significant bits of No; the sign of the original number is conserved.

Input number: Ni
n = 4 bytes
x = 16

Output number: No

Figure 1 - Interpretation of scaling for syntax using n = 4, x = 16.

Example 2:

In practical cases it is useful to define scaling in terms of engineering units per distance, i.e., [units/cm] or [units/inch]. Assume we are dealing with data from the AADCII, 4 bytes long, encoded in units of [pT]. The desired scaling for the trace(s) in the chart is Seng = 1000 [pT/cm]. We must select the scaling factor x and the channel sensitivity Sv (in the chart recorder), such that the desired scaling is achieved.

Using (2) we can write:

       10/2x+1 [volts/ pT] = Sv [volts/cm] / Seng [pT/cm] .

With Seng = 1000 [pT/cm], we have:
 
  Sv [volts/cm] = 10000/2x+1 [volts/cm]
(3)

In (3) x is an integer in the range [0 - 30], and we can determine Sv as a function of it. Table 2 shows the resulting values of Sv for different values of x. Recalling that channel sensitivities in the Data System are limited to the range 0.1 volts/cm to 10.0 volts/cm, one can see from the table that only values in the range 9  < x < 15 result in acceptable sensitivities.

Although for all the acceptable values of x we will obtain the same scaling on the chart (i.e., 1000 [pT/cm]), the actual value to use must be selected so as to achieve the optimum dynamic range for the application at hand. For example, given that from either (1) or (2) it is clear that we have 2x+1 [units/full-scale] (full-scale = 9.9997 volts), then for x = 15 we would have 65.536 [nT/full-scale], whereas for x = 8 we would have 1.024 [nT/full-scale].

Table 2 - Scaling factors and sensitivities for Example 2.

II. Generic-binary data types

Three variations of the generic-binary data type are supported: generic-binary (GB), generic-binary with hysteresis (GBH), and generic-binary with fourth difference (GB4D).

The different types differ from each other in the kind of processing applied to the scaled data. Type GB is the simplest since no extra processing is involved, and it can be seen simply as a scaling routine with the characteristics described in Section I. Types GBH and GB4D do involve extra processing, and they are explained in detail in the following subsections.

For practical purposes a good "rule of thumb" is that the execution times of GB and GB4D have a ratio of 1:4, and those of GB and GBH a ratio of 2:3.

A) Generic-binary-with-hysteresis data type

This is intended for signals which often wrap-around between values of '0' and '+ full-scale' (7FFFH). When the signal value is oscillating between these two points, multiple lines will be plotted across the recording channel for that trace, resulting in a record which is very difficult to read. What this data type does is to provide a 3% "over-range" band on both ends of the range 0 to full-scale, so that a hysteresis-like effect may be accomplished, whereby the output is generated taking into consideration the previous history of the signal.

In order to provide the 3% over-range, the range from 0 to 10 volts must be shifted-down to -0.3 to 9.7 volts, thus giving a 3% band between 9.7 and 10 volts, and one between -0.6 and -0.3 volts.

In Fig. 2 we show the block diagram of the processing involved (the notation used assumes the values of signals in "volts", with the conventional scaling used in the system: +9.9997 volts = +full-scale = 7FFFH). First of all, input U is scaled as per the method described in Section I, producing output Uc. A fixed offset of -0.3 volts is then added to Uc resulting in Ui, which is then processed by algorithm 'HYST' to produce the final output Uo.

The transfer function Uo /Ui implemented by 'HYST' is shown in Fig. 3.


Figure 2 - Block diagram of processing involved in generic- binary-with-hysteresis data types.
 

Figure 3 - Transfer function Uo/Ui implemented by HYST.



B) Generic-binary-with-fourth-difference data type

A simplified block diagram depicting the signal processing is shown in Fig.4. Input signal U is first sign-extended to 32 bits (if the number of bytes specified in the syntax, n, is less than 4). The resulting Ux is the input to the basic fourth difference algorithm, FDIF. The output of FDIF is scaled-down by a factor of 16 to result in a signal Ux4 which has equivalent units to those of the original input. Finally, Ux4 is scaled according to the syntax entered by the user, using the same method described in Section I.
 


Figure 4 - Block diagram of processing involved in generic-binary-with-fourth-difference data types. Numbers in brackets [..] indicate word lengths in bits.
 

To achieve a desired scaling of Uo in terms of engineering-units per distance, given the equivalence in units between Uo and U, the same method described in Example 2 of Section I can be employed to arrive at the needed scaling factor x and channel sensitivity Sv. Below we consider a practical example which can also be used to test for correctness of the conversion routine.

Example 3

As we did in Example 2, let us assume we are dealing with data from the AADCII, 4 bytes long, encoded in units of [pT]. The desired scaling for the trace(s) in the chart is of Seng = 1000 [pT /cm].

Proceeding as we did in Example 2, we select a scaling factor of x = 15, and a sensitivity Sv = 0.1526 [volts/cm]. For testing purposes, one can introduce for example a step of amplitude A = 10,000 pT and check that the resulting output Uo is as shown in Fig. 5. In this figure we assume both the input signal U, and the output Uo are plotted on channels with the same sensitivity, Sv = 0.1526 [volts/cm].


Figure 5 - Example showing input/output waveforms for step-input applied to generic-binary-with-fourth-difference data type.



REFERENCES
[1] G.N., "SIM - Operational (Vers. 1527-01-C, 1356-02-H)", Aug21/91.



 
Return to Technical Notes
Bulletin Board
E-Mail  Need more info?
Return Home
Employment Opportunities