DDC TR122 User manual

TR122 CPCI MODULE
2 CHANNEL 100 MHz, 200 MS/S
TRANSIENT RECORDER
January 2005
Data Design Corporation
7851-A Beechcraft Avenue
Gaithersburg, MD 20879
WWW.DATADESIGNCORP.NET
(301) 670-1157

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 2
CONTENTS
1.0 Introduction ............................................................................................................... 3
1.1 Specifications Summary ....................................................................................... 4
1.2 Setup and Installation ........................................................................................... 5
1.3 Front Panel ........................................................................................................... 6
2.0 Using TR122 Software .............................................................................................. 7
2.1 Customizing The Display ....................................................................................... 8
2.2 Oscilloscope Mode ................................................................................................ 9
2.2.1 Vertical Settings .............................................................................................. 9
2.2.2 Horizontal Settings ........................................................................................ 10
2.2.3 Trigger Settings............................................................................................. 11
2.2.4 Saving Waveforms And Settings................................................................... 13
2.3 Transient Recorder Mode .................................................................................... 14
2.3.1 Configuring Transient Record Memory ......................................................... 15
2.3.2 Performing A Transient Recording................................................................ 17
2.3.2 Saving A Transient Record ........................................................................... 18
3.0 TR122 Software Source Code ................................................................................ 20
3.1 TR122 Software Architecture............................................................................... 21
3.2 The TR122 API.................................................................................................... 23
3.2.1 Calibration Functions .................................................................................... 25
3.2.2 Abstract Instrument Functions....................................................................... 26
3.2.3 Display Functions.......................................................................................... 28
3.2.4 The Auto Thread ........................................................................................... 30
4.0 Calibration ............................................................................................................... 31
4.1 Using Calibration Features Of The TR122 Software............................................ 32
4.1.1 Analog Frequency Compensation Alignment ................................................ 33
4.1.2 Stored Calibration Controls ........................................................................... 34
4.1.3 Adjusting The Calibration Data...................................................................... 35

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 3
1.0 Introduction
The TR122 is a high performance two channel transient waveform digitizing instrument
designed in a single slot CPCI module and capable of digitizing to 12 bits at rates up to 200
million samples per second (MS/s) on both channels. Each channel includes an independent
analog front end and analog-to-digital converter providing superior interchannel isolation and
full bandwidth availability on all channels. The TR122 segmented memory architecture and
internal timer allow multiple sequential events to be captured and time stamped without the need
to read data between events. A two million sample static memory is provided for each channel
and is divisible into smaller data segments.
The TR122 analog inputs have nine 1 volt to 500 volt full scale ranges selectable in 1,2,5
steps. A full scale input offset adjustment is also available. The effective sample rate is
adjustable from 1 MS/s to 200 MS/s in eight steps. Each TR122 unit is always an independent
instrument, but can coexist in hardware and software with additional units and other instruments
in the same CPCI system.
The TR122 can respond to trigger events from either channel, from an external trigger
input, or from software. A trigger event stops the continuous recording of a circular buffer of
samples when a specified number of samples after the trigger have been recorded. The number
of samples recorded after the trigger is adjustable. This approach allows the user to select an
appropriate number of pre trigger samples to be left in memory when the record is complete.
A binary status recorded with the data indicates whether each sample was taken before or after
the trigger event. The TR122 software automatically sorts the data to chronological order,
making the intricate details of the records transparent to the user.
The sample memory can be segmented in multiples of 64K samples. A 32-bit (4 billion
count) internal timer is used to record a count with each trigger event which can be used to
determine the relative time of multiple trigger events with microsecond accuracy. These time
stamps are saved in a first-in-first-out (FIFO) memory which can be accessed through the TR122
software to determine how many triggers events are present in the sample memory and when
they occurred with respect to each other.
While the TR122 is not an oscilloscope, the software is designed with much of the look
and feel of an oscilloscope for the benefit of instant user familiarity. The instrument and
connected devices can be configured in an oscilloscope mode and then switched to transient
recorder mode to take advantage of powerful transient recorder features.
Finally, the TR122 software source code is provided as open source. In a world of data
acquisition now muddied by thousands of semi-standard and custom solutions it makes sense
to provide a properly layered design accessible to the user for unique needs. The principles of
the software design are defined in this manual and are intended to allow the advanced user to
peel back the layers and snap in other front end software. Such efforts are always underway
and popular additions will be published on the Data Design website as they become available.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 4
1.1 Specifications Summary
Dataway Interface Ambient Temperature Range
Compact PCI at 32 Bits and 33 MHz 0 To 70 C
Compliant with PICMG 2.0 R3.0
Single Width 3U Compact PCI Card
SampleRate Memory
200 MS/s All Channels 2 MSample Per Channel
100 MHz Bandwidth 64 KSample Minimum Block Size
ConfigurableSegmenting
Input Channel Architecture Input Sensitivity
2 Independent Analog Signal Inputs 12-Bit Resolution
1 External Trigger Input 1-500 Volts Full Scale In 9 Ranges
0.05% Accuracy (10 LSB)
80 dB Minimum Interchannel Isolation
Analog Input Characteristics Input Withstand Rating
Single Ended DC Or AC Coupled 1 MΩInput ±250 VDC
Full Scale Offset 10-Bit Resolution 50 ΩInput 4 Watts (14 Volts RMS)
1 MΩ20 pF Or 50 ΩImpedance
External Trigger Input Trigger Input Sources
Single Ended DC Coupled Channel Greater Than Full Scale Range
1 KΩ20 pF External
±10V 10-Bit Resolution
Rising Or Falling Edge

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 5
1.2 Setup and Installation
The TR122 is a single width 3U CPCI module. To insert the TR122 in the CPCI crate,
choose any convenient slot and slide the module into the crate with its top and bottom mated to
the guide rails. Be sure that the module is properly aligned with the connector at the back of the
crate. Push the module toward the back of the crate with gentle pressure. When the card pushes
back, push the locking lever down and press the card firmly into the crate with firm pressure on
the top and bottom of the front panel. The locking lever will raise and lock into place. Fasten
the retaining screws at the upper end of the front panel and at the bottom of the front panel below
the lever. To remove the card, reverse the process by removing the retaining screws and pressing
down firmly on the locking lever to disengage the card from the connector at the rear
of the crate.
NOTE: The module should be inserted in the crate only after turning off the power
to the crate. Otherwise, damage to the module or system is possible due to momentary
misalignment of pins on the connector. CPCI hot swap operation is not supported.
It is recommended that the TR122 module and a controller be installed alone in
the crate until the user is familiar with TR122 operation enough to integrate it with other
modules in an instrumentation system. When the TR122 is installed in a slot where it has not
been before, the CPCI system will detect it as a new device at which point it will need access to
driver software. The software supplied with the TR122 is designed to operate on platforms with
Microsoft Windows 2000 and newer operating systems. To install drivers on these systems,
point the installation wizard to the location of the included CD. A CD drive may be located on
the crate controller or it may be mounted over a network connection using the wizard’s “specify
a location” option. The files the installation wizard will need are located in the root directory of
the CD. Follow the steps displayed by the installation wizard at the end of which the wizard
should indicate that a “TR122 Transient Recorder” has been installed.
To install the TR122 software, use the Windows explorer or similar tool to locate the
software CD. Point to the directory on the CD identified as \TR122\Install. Run the program
SETUP.EXE and follow the on screen instructions for the familiar software installation process.
When any new software has just been installed, it is usually best to reboot the crate controller
before attempting to use the software, even when this is not strictly necessary. At this point the
installation is complete and the TR122 and turnkey software are ready to be used.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 6
1.3 Front Panel
The TR122 front panel provides three standard BNC connections to the instrument
electronics. These are labeled for the two channels and the external trigger. There is also a serial
number label on the card ejector lever. This number will be presented by the TR122 software to
indicate which TR122 is being used, which may be important when there are multiple such
instruments in the system.
While the instrument has some immunity from typical connection mistakes, care should
be still used when connecting external devices. Always observe the maximum ratings indicated
in the specifications. Also note that some of these ratings indicate particular settings. For
example, the 50 ohm termination is only capable of handling 4 watts, thereby limiting the
peak voltage that can be handled with this setting.
The external trigger input is limited to +/-10V peak. While slightly higher voltages will
not damage the unit, they will operate a protection mechanism. It is recommended that care be
taken to keep this input within its specified range. This input is typically used to provide an
effective third input which may carry only binary trigger information or to provide some ability
to synchronize multiple instruments.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 7
2.0 Using TR122 Software
The TR122 comes with a turnkey software package which allows the user to quickly take
advantage of all instrument features in a standalone configuration. This software is designed to
coexist with other instruments as well as to allow multiple TR122 instruments to be installed and
operated in the same CPCI crate. Installation of the software is discussed in section 1.2 above.
The software is designed to have the look and feel of an oscilloscope to take advantage of user
familiarity with such instruments, while supporting features unique to a transient recorder. This
discussion assumes that the user is familiar with the operation of an oscilloscope.
Upon starting the TR122 software, a splash screen will be displayed while the software
searches for and configures a TR122 device in the system. The software will locate a TR122
which is not already in use and complain if one can not be found. Assuming a TR122 is found, a
clicking of relays can be heard as the software configures the unit to default settings. The control
panel screen shown in Figure 2.1 will appear and its title bar will indicate the serial number of
the TR122 which is being operated. This serial number corresponds to that found on the card
ejector lever of the instrument. To reconnect this instance of the control panel to another TR122
instrument in the system use the Select item under the Device menu. The software prevents more
than one control panel instance from addressing a single TR122 instrument.
Figure 2.1 TR122 Control Panel

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 8
The TR122 starts in the oscilloscope mode and returns to default settings for all controls.
This will also be the case any time a new card, or the same card, is found using the Select menu
item. This gives the user a practical starting point from which to configure the measurement
environment. With the factory default display configuration, a real time display of data from
both channels will immediately appear in the oscilloscope window and a vertical white line will
indicate the time location of the trigger event for each record.
2.1 Customizing The Display
Data from the TR122 are displayed in an oscilloscope display format. The colors and
amounts of information displayed can be adjusted with a high degree of freedom. It is useful
to review the configuration at this point to become familiar with what is being displayed.
To configure the display, double click the left mouse button on the oscilloscope screen. The
dialog window in Figure 2.2 will appear. Changing any item in the dialog will immediately
affect the display.
Figure 2.2 Display Configuration Dialog
The Display Items list represents all of the information which can be displayed on the
oscilloscope screen. The check boxes indicate which items are being displayed and the color
bars are the colors in which they are being displayed. Some items can be removed from the
display. For example, to view only one channel simply uncheck the other channel by clicking on
the check box. To change the color, click on the color bar for an item to display a standard color
selection dialog. Clearly, if the background and the gradicule are the same color, the gradicule
will effectively disappear. The same would be true for any other item.
The options list allows for selection of optional display features. The Show Tick Marks
control toggles the display of the tick marks on the center gradicule lines. Draw Lines Betweens
Samples places a best fit line between each sample on the screen making the display bright and
easy to read. In some cases it may be advantageous to see the discrete sample points by
unchecking this option.
Use Save As Defaults to cause these settings to be loaded each time the software is
started. These settings are saved in a file called TR122disp.cfg in the same directory as the
software executable. This file is not human readable. To restore the factory defaults, this file
should be deleted. The Restore Defaults button will cause the contents of this file to be loaded or
the factory defaults will be loaded if this file is not present. The Ok button just closes the dialog.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 9
2.2 Oscilloscope Mode
Keep in mind that a transient recorder is not an oscilloscope. Although the TR122
software makes a valiant effort at imitating an oscilloscope, the user is bound to be disappointed
in comparison to instruments designed for this purpose. A transient recorder is somewhat like a
deep memory oscilloscope restricted to operate in the single shot trigger mode. The TR122
oscilloscope mode uses an independent software thread to record and display transient records
of the entire two million sample memory at a rate dependant on the selected horizontal time base.
To achieve slower timebases the software must lower the sample rate and compress the data. At
faster horizontal settings this is fairly undetectable, while at slower settings the transient recorder
characteristics can be seen as full memory records are collected and displayed. On the other
hand, significant time frames of data are always available, making it easier to capture activity
well before or after the trigger.
The oscilloscope mode is intended to be used to establish the settings required to perform
a transient measurement. Vertical and horizontal selections along with trigger source selections
have an immediate effect on how the data is being acquired and displayed. The user is likely
familiar with most of the controls and settings provided. The typical vertical, horizontal, and
trigger menus of an oscilloscope are accessed by clicking the tabs at the upper left of the
window. The following discussion provides some additional insight into how these controls
are used.
2.2.1 Vertical Settings
The vertical controls for each channel are under the tabs marked CH1 and CH2 as shown
in Figure 2.1 above. The oscilloscope screen in any mode always displays only 8-bits of the
12-bit data stream provided by the TR122. The Volts/Div 8-Bit setting assumes that the software
will be concerned with only the upper 8 bits. Of course, when data are eventually saved to disk
in transient mode, all 12 bits will always be represented.
To allow the user to examine what is happening within the lower bits, the software
provides a setting called Bit Mag. This can magnify the image to 1,2,4,8,or16 by sliding the
visible bits down the sample by 0 to 4 bits. It should be noted that the offset and trigger settings
are calibrated to be valid with the 8-bit display and will not be coherent with the Bit Mag set to
greater than 1. The volts per division display below the oscilloscope screen will always display a
value taking the Bit Mag into account. The volt per division display at either location can be
used to adjust the front end attenuator of the TR122.
All controls in the TR122 software can be adjusted by clicking on them with the mouse
buttons. For most, though not all, controls the left mouse button will increase the value
of the control and the right mouse button will return its value.
The coupling, input impendence, and probe settings are as they would be on an
oscilloscope. The probe setting has no physical effect on the instrument, but simply multiplies
the displayed values for volts per division for ease of use when an oscilloscope probe is
connected to the instrument.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 10
The analog offset is typically adjusted as part of the vertical controls of an oscilloscope,
known generally as vertical position. With a transient recorder it is more typical to discuss
offset. The term offset will be used in the context of the TR122. The offset allows a DC value
to be added to the input signal, typically to bring a signal with a DC offset within range of the
instrument; but also to allow for separation of multiple signals on a display, such as would be a
typical use of an oscilloscope vertical position control. Within TR122 software the offset is
controlled directly on the screen with the mouse. The arrow icons at the left of the screen
indicate where the offset is for each channel by color. Move the mouse cursor to the left most
horizontal division of the oscilloscope screen and click the left mouse button to move the offset
for the nearest channel to the screen position of the mouse. Holding the left mouse button and
moving the mouse will drag the location of the offset. The position of the icon represents the
display location of a zero volt DC signal input. The data behind the value, such as that stored to
disk, will include the DC offset.
2.2.2 Horizontal Settings
Selecting the HORIZ tab in the controls dialog at the left of the oscilloscope screen will
display the horizontal settings controls as shown in Figure 2.3 below. In oscilloscope mode the
horizontal Sec/Div control is the only enabled control. This control is similar to the control of
the same name on an oscilloscope. The setting can also be adjusted by clicking on the status line
copy of this value located below the oscilloscope screen.
Figure 2.3 TR122 Control Panel Horizontal Controls

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 11
The horizontal menu includes a status display value in Time At Mid Screen. This box
will display the time represented at the horizontal center line of the gradicule with respect to the
trigger location. The units and resolution will depend on the Sec/Div setting and the magnitude
of the value. This display can be quite useful when the trigger location is not displayed or is
beyond the horizontal bounds of the screen. Because the full size of the memory is quite large,
it is possible to view events substantially on either side of the trigger and know where they are in
time. This feature is available in transient recorder mode as well. For oscilloscope users, this
feature starts to show the strengths of a transient recorder design for certain types of
measurements within the same price/performance class of instrument.
The horizontal location at which the trigger bar is displayed can be adjusted by clicking
and holding the left mouse button on the display and dragging the display in either direction.
The position can also be adjusted in steps with the < and > buttons at the bottoms of the screen.
These controls are similar to the horizontal position control of an oscilloscope.
The horizontal menu in the oscilloscope mode also shows the ghosted values of the
transient recorder settings being used. The memory geometry will be constant in oscilloscope
operation, but the sample rate will change with certain ranges of the Sec/Div setting. This
display can be useful in determining what sample rate setting may be required to perform
transient measurements on a given input.
2.2.3 Trigger Settings
Selecting the TRIG tab in the controls dialog at the left of the oscilloscope screen will
display the trigger settings controls as shown in Figure 2.4 below.
Figure 2.4 TR122 Control Panel Trigger Controls

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 12
In oscilloscope mode the trigger controls mirror those on an oscilloscope. The trigger
Source can be either channel or the external trigger input. The trigger Slope can be rising or
falling edge. The trigger system can operate in a Mode of AUTO, NORMAL, or SINGLE which
mirror their oscilloscope equivalents. The NORMAL mode will record and display new
information only after receiving a trigger event and again after each subsequent trigger event
following complete display of the data from the previous event. The SINGLE mode will display
information only from the first such event after which the Run/Stop control in the lower right
corner of the screen will be set to STOP. Data from an additional trigger event can only be
recorded by clicking on the Run/Stop control to set it back to RUN. The AUTO mode behaves like
the NORMAL mode except that the software will inject a trigger if one is not received in an
internally determined time. This trigger will of course not be synchronous with any event in the
input signal but the resulting display can be useful in the event that it is not clear how the trigger
source should be prepared. If a trigger event does occur before the internal timeout on each
cycle, the display will be properly synchronized to this event.
The Run/Stop control can be set to STOP in any trigger mode to cause the software to
ignore any additional trigger events. The display will be a static representation of the last
captured data. When the trigger system is set to STOP in the oscilloscope AUTO or NORMAL
modes, only the data already on the screen will be available. When the SINGLE trigger mode sets
the control to STOP, the entire memory is available for review. This distinction relates to the
ongoing recording operations in the other modes. That is, the SINGLE mode does not record pre
trigger samples for an anticipated subsequent trigger while the other modes do, which would of
course overwrite data from any previous trigger. When switching between trigger modes, the
Run/Stop control is automatically returned to RUN to avoid the typical need to do this manually.
The analog voltage threshold at which a trigger is detected is called the trigger level. For
the external trigger input, this level is adjustable in an absolute range of –10V to +10V using the
Ext Level control. If the trigger source specifies that one of the channels should be used, the
range becomes somewhat larger than the full scale analog input range. The location of the
trigger threshold will be indicated in an abstract way with an arrow on the right side of the
oscilloscope display with the color of the selected source channel. The level can be adjusted by
clicking the left mouse button on the oscilloscope screen within the far right horizontal division.
The trigger threshold will be moved to the location of the mouse cursor. The location can be
dragged by holding the left mouse button down while moving the mouse. If the offset were to be
adjusted, the trigger location will be further adjusted with it to keep the intended trigger
threshold with respect to the new zero volt line. This may force the trigger location off the
screen, which will be indicated by a vertical pointing arrow at the far left top or bottom of the
screen. This is the benefit of a trigger range greater than the full scale analog input range.
The Force Trigger button allows the user to issue a software trigger at any time in any
mode. This function is independent of anything else in the software. If the instrument and
software are configured to respond to a trigger, clicking this control will cause it to act the same
as if the trigger had come from the specified source. Of course there is no way to synchronize
this action to any event, but this control can be useful in performing setup operations,
particularly in transient recorder mode.
Finally, the Center Trigger button automatically returns the display settings so that the
trigger event is displayed at the horizontal center line of the gradicule. This can be useful when
exploring the outer reaches of the recorded time in any mode and it is desired to return to time
zero, the time of the trigger event.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 13
2.2.4 Saving Waveforms And Settings
In the oscilloscope mode there is generally not a known set of data in memory, except
perhaps as the result of a single shot trigger operation. The transient recorder mode handles the
recording to known data sets in memory somewhat like a sophisticated single shot trigger
operation. Therefore, saving of sample data to disk is not supported in oscilloscope mode.
However, there is always a waveform image on the display and saving this image to disk is
supported. Select the menu item Save Image in the File menu. A standard file dialog will ask
for a file name under which to store a bitmap image of the oscilloscope display. This bitmap can
be used in any document such as shown in Figure 2.5 below. When the image is saved to disk,
the Run/Stop control is set to STOP. If the control was set to RUN, it is returned to RUN when the
file save is complete. This time will be very brief.
Figure 2.5 Captured TR122 Oscilloscope Screen Image
Generally, the oscilloscope mode is used to setup the TR122 instrument for transient
recording operations. Some setting can not even be changed once transient recorder mode is
entered. For this reason, if settings are to be saved to disk to preserve a given setup, the
oscilloscope mode would be the right place to do it. The menu items Save Settings and Load
Settings are available in the File menu in the oscilloscope mode. The Save Settings item will
prompt for a file name under which to save the current settings of the user controls. When the
TR122 software is started, default settings are always installed. Stored settings can be retrieved
using the Load Settings menu item.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 14
2.3 Transient Recorder Mode
Changing between oscilloscope and transient recorder mode is performed by selecting a
mode from the Mode menu item. This menu indicates the current mode with a check mark.
Starting the transient recorder mode will result in a blank display screen and the Run/Stop control
indicating STOP. The status display of Sec/Div will be missing as this value does not have
meaning until a recording is made and displayed.
The vertical controls under CH1 and CH2 perform the same as they do in the
oscilloscope mode. The trigger controls under TRIG also perform much the same except that
the trigger modes of the oscilloscope do not have any meaning in transient recorder mode. As a
result the trigger Mode control is disabled.
The offset and channel source trigger level controls are not adjustable in the transient
recorder mode. These settings are generally adjusted while the user has a good look at incoming
data in the oscilloscope mode and then are not to be changed while a transient measurement is
taken. All other controls can be adjusted. However, adjusting any control will invalidate any
previous transient record and the display screen will be cleared. It is important to recognize that
a transient record is a once and done event with a very specific set of parameters on the
instrument. By operating in this manner, the user can be sure that any transient records displayed
or written to disk were in fact taken with the settings shown. In contrast, the oscilloscope mode,
which also clears the screen on a setting change under most conditions for the same reason, will
generally refresh the data with a new record following shortly after the setting change. The
transient recorder mode requires user intervention to collect and display each record.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 15
2.3.1 Configuring Transient Record Memory
Beyond the basic setup which matches that of an oscilloscope, configuring the transient
recorder mode involves selecting a sample rate and memory geometry. Defining this
information is a rather manual step which is unique to a transient recorder, but it allows the user
to control and be aware of specific parameters of the recording. These parameters are critical
knowledge for some types of measurements and are generally not reported by an oscilloscope.
To allow control of these parameters, the HORIZ tab control in transient recorder mode will
appear as in Figure 2.6 below.
Figure 2.6 TR122 Memory Geometry Controls
The all important Sample Rate control is self explanatory to transient recorder users.
This control will generally be adjusted based on the frequency characteristics of the input signal
being viewed and by trading off recorded signal detail with the length of time which can be
stored in the instrument sample memory. When selecting a sample rate (measured in MHz or
Million Samples Per Second (MS/s)), keep in mind that the bandwidth of the TR122 analog
circuitry is always 100 MHz, and the roll off of the pass band is not steep. Any incoming signal
with a frequency component greater than half the sample rate can potentially appear misleading
when displayed due to aliasing, an important digital signal processing mathematical concept
which must be understood for successful use of a transient recorder or a digital oscilloscope.
Because the input bandwidth is 100 MHz, the potential for aliased information in the display is
limited when the full 200 MS/s sample rate is used. However, the effect can become pronounced
at lower sample rates.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 16
The time recorded in memory will be equal to the number of samples stored in memory
(samples) divided by the sample rate (samples/second). The full depth of the memory is two
million samples. Therefore, at the full sample rate of 200 MS/s the memory will hold
2M/200MS/s or 0.01 seconds of time. At the slowest sample rate of 1 MS/s this expands to 2
seconds of time. The user is probably aware that both times can be considered fairly long
transient events.
In some cases it may not be necessary to record so much time. It may also be the case
that several events are expected to occur in rapid succession. It is possible to configure the
TR122 memory to capture multiple trigger events by dividing its full memory into smaller
segments. The Segment Size is measured in thousands of samples (K samples). The smallest
available segment size can be referred to as a block of memory. The block size of the TR122 is
64K samples. Note that all dimensions suffer from the binary number system employed by the
modern computer, so block and segment sizes will be powers of 2. For example, 64K samples
is 65536 samples. A segment in the TR122 can be sized as a power of 2 times the block size, up
to the size of the full memory. That is, the segment size can be selected as 64K, 128K, 256K,
512K, 1024K, or 2048K samples. The memory can therefore be divided into 32, 16, 8, 4, 2,
or 1 segments respectively. Thus, for short rapidly occurring transient events, up to 32 such
events can be stored in memory before the data must be read or a new recording started.
When a recording is started, the TR122 will immediately begin recording data in the first
segment of memory, filling the segment with samples and returning to the beginning of the
segment to start again in a continuous loop. When a trigger event is detected, the TR122 will
begin counting samples to be recorded after the trigger event, as defined by the user in the
control Post Trigger Samples. When this number of samples has been recorded, the TR122
moves on to the next segment and begins again recording pre trigger samples.
Clearly for sample data in this circular buffer architecture to be sensible, the segment
must be fully written with pre or post trigger samples related to the trigger event. To guarantee
that this happens, the TR122 will not be sensitive to a trigger event until the segment has filled at
least once with pre trigger samples. Once a trigger is received, the TR122 will not be sensitive to
another trigger until all post trigger samples have been recorded and the next segment has been
filled with pre trigger sample data. Therefore, the minimum time between trigger events will be
defined by the memory geometry selected as
Minimum time between trigger events = (segment size / sample rate) + (post trigger samples / sample rate)
Internally to the TR122 software and hardware, the number of Post Trigger Samples can
be defined to any multiple of 2. However, this resolution is rarely needed. The TR122 control
panel allows the Post Trigger Samples control to be adjusted in steps of 512 samples. The limits
will require there to remain at least 1K (1024) pre trigger samples and at least 1K post triggers
samples within the segment. When selecting a segment size, the Post Trigger Samples control is
automatically adjusted to half the segment size. The shortcut buttons under the control allow
setting commonly used values for Post Trigger Samples with one click.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 17
2.3.2 Performing A Transient Recording
To prepare the TR122 to capture a transient record, set the Run/Stop control to RUN. At
that point the memory geometry controls are frozen and the TR122 begins recording pre trigger
samples and waiting for a trigger event. The other controls remain available to the user, however
it should be kept in mind that adjusting controls after the first trigger is received could cause an
inconsistency in the data between one segment and the next.
The TR122 will continue to record data until enough trigger events have occurred to fill
all segments, at which point it will automatically stop recording and display the data from the
first segment. To stop the recording and display data before all segments have been filled,
manually set the Run/Stop control to STOP. The data from the first segment will be displayed
on the oscilloscope screen with the trigger event at the center of the gradicule.
When a transient record is displayed, the dark bar below the display will be filled with
red and green bands. This bar is referred to as the sample memory profiler. The green band
covers the portion of the memory which is filled with valid samples. The red band lays over top
of the green band and indicates which segment of memory is currently being displayed. The size
of these bands is relative to the segment size, and of course for geometry consisting of a single
full memory segment, the sample memory profiler will be entirely red. This display provides a
clear visual indication of how many trigger events were received in a transient record, the
relative size of the data for each segment, and which trigger event is being examined. Figure 2.7
below shows the display of a transient record in which four trigger events filled 64K segments
before the record was discontinued by the user. The second segment is displayed.
Figure 2.7 Displaying A Transient Record

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 18
When a transient record is being displayed, the software will generate a seconds per
division status indication in its traditional place. This number is not adjustable. While the
oscilloscope mode is designed to compress or expand samples on the screen to reach a specific
time gradicule, the transient recorder mode strictly presents 25 samples per division. It is
intended to be crystal clear what the pure sample data looks like when graphed at one vertical
axis point to one horizontal axis point. Therefore, the seconds per division value will only
change based on the sample rate of the transient record.
An additional time point is displayed on the status bar along with the seconds per
division. This is the absolute time at which the trigger event for the currently displayed segment
occurred with respect to the first trigger event, based on a microsecond counter in the TR122.
The display of the first trigger event will always show zero microseconds (0uS) in this location.
Of course, the timer could lapse during a transient record and thereby provide strange results, but
it is good for over an hour – an eternity in the world of transient recording.
To move the display between segments use the << and >> buttons on either side of the
sample memory profiler. This action will set the display to show the trigger location of the new
segment at the center of the gradicule. To move the trigger location and explore the reaches of
the memory segment before or after the trigger, use the same mouse screen control or the < and >
buttons as in the oscilloscope mode display. The Time At Midscreen display under the HORIZ
tab will represent the time at the middle of the display gradicule with respect to the trigger event
in the currently displayed segment.
2.3.2 Saving A Transient Record
The sample data in a transient record can be saved in one of three formats. The current
displayed image can be saved as a bitmap as in the oscilloscope mode, or the data can be saved
in binary or comma separated text format. A bitmap image may be useful for a brief report about
a recorded signal. The binary format would typically be used by some form of custom post
processing software. The text form is somewhat human readable or it may be used for
processing in spreadsheets or other standard post processing software.
Saving a bitmap image follows the same procedure discussed for the oscilloscope mode.
Saving data is completed using the Save Data item under the File menu. This item is only
available in transient recorder mode. It will also only work if there is a valid transient record
to save. Otherwise it will report an error. A standard file save dialog box will appear with the
file type selectable as binary or text in the Save As Type selection box of the dialog.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 19
The text data file format will contain a line of text for each sample. The samples are in
chronological order from oldest to newest. The resulting file will be quite large and will
probably need to be reduced for use in most data analysis programs. Some users may also find
it easier to understand this format than the binary format for use in custom post processing
software. Each line of the text file is formatted as follows.
<Segment>,<Post Trigger>,<Channel 1>,<Channel 2>
Where: <Segment> is the memory segment in the range 0 to 31 dependant
on the current memory geometry settings
<Post Trigger> is 0 if the sample was taken before the trigger event
and 1 if the sample was taken after the trigger event
<Channel x> is the absolute value of the sample over the current full
scale range as an offset binary value of 0 to 4096 – that is, with the zero
volt level of input signal plus offset being 2048. This value includes any
effect of the instrument offset settings.
The binary file format contains sequential samples in a six byte equivalent to the line of
text in the text file format. It is written as a data structure from the C programming language and
stored with no padding between samples. Post processing software will need to be aware of this
structure’s format and will generally read data from the file into an equivalent structure to
preserve the byte ordering. The structure is as shown below, assuming the Windows software
conventions that a BYTE is an unsigned 8-bit number and a WORD is an unsigned 16-bit
number. The descriptions of the elements are equivalent to corresponding items in the text
format above.
typedef struct binary_data_record_st
{
BYTE segment;
BYTE trigger_valid;
WORD sample_ch1;
WORD sample_ch2;
} T_BINARY_DATA_RECORD;
Note that these data file formats do not contain any information about the settings of the
instrument from which they were written. Some information about the sample memory
geometry may be inferred, but other potentially important settings information must be recorded
separately if needed. The objective of the Save Data function is to save raw data for post
processing in its simplest possible format. Many post processing programs will require no more
data than this, while still others may require little else. Most will require a knowledge of the
sample rate or other basic points that the user might consider recording in the file name. All will
be affected in complexity and processing time by the size of the data file and anything other than
uniformity in its content. This is the logic behind the simple format given.

Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved. 20
3.0 TR122 Software Source Code
Instruments such as the TR122 are only as useful as the software which runs them.
While the software provided with the TR122 makes the instrument very functional in a wide
variety of applications, it is impossible to predict the full range of possible user needs or the
software environment in which the instrument may be installed. Data Design has decided that
the best way to meet as many user needs as possible is to provide a window into the workings of
the instrument. To accomplish this, the source code for the software is published with the
software distribution.
This open source approach provides the user with nearly infinite flexibility. It also
provides the opportunity for many bad headaches. The inner workings of the software are not
for the novice user. Complex tricks and traps exist at every corner with an advanced instrument
such as the TR122. Concepts of multistage pipelines, direct memory address, advanced data
structures, threads, and other complexities must be understood. It is a challenge even for the
most skilled programmer. The good news is that the design is carefully structured and this
section of the manual provides a roadmap to the advanced user.
IMPORTANT NOTICE Information on source code and the source code itself is provided
AS IS and without warranty or support. Data Design is not able to provide technical
assistance to those attempting to modify the source code. It simply would not be possible to
provide the instrument at reasonable cost if such support were included in the price.
Please review the source code license agreement at the end of this manual before using the
source code. That said, however, Data Design does offer design services for hire. Information
can be found on the website at the front of this manual. Also, from time to time, additional
applications and source code will be posted on the website for free download.
It should be noted that this section of the manual covers the workings of a particular code
base for a particular instrument. Any such software works with a hardware-software interface
defined in part by the hardware itself. At the simplest level this interface amounts to writing
various command and configuration registers and reading various data and status registers. Still,
understanding many of the complexities found internal to the code base might require a working
knowledge of the hardware. The hardware itself is not discussed in this manual and is
considered somewhat proprietary to Data Design. While it will become evident in this
discussion that the hardware could also be modified to meet additional unique and complex
requirements, this is substantially beyond the scope of most users’ needs and abilities. As such,
to maximize the usability of the open source environment, the interface to hardware is left
somewhat abstract in order to simplify the discussion. This understanding should be kept in
mind when reviewing the source code and deciding what should or should not be modified.
While there is some discussion of hardware details within the source code itself, the
discussion in this manual is aimed at common reasons why an advanced user would require
access to the source code. These include such tasks as interfacing to a custom top level
application, connecting the instrument to an existing software environment, or using the
instrument in another operating system. As such, the discussion of the top level application
presented in section 2 is also limited, though the source code for that application is also provided.
Table of contents