Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved.
26
3.2.2 Abstract Instrument Functions
The abstract instrument functions provide a means to perform a set of operations which
are recognizable and expected for a transient recorder. There are some subtle differences
between operation in transient recorder and oscilloscope modes which affect these routines.
From the point of view of the API, the oscilloscope mode is defined if the ‘Auto Thread’ is
running and transient recorder mode is defined if it is not. The ‘Auto Thread’ is discussed later
in this manual. This discussion will focus on common functionality. Presented below are the
exported functions with a brief description of their place in the design. They are ordered
differently than in the source code for clarity of discussion.
DCAPI TR122_OpenNext(void);
When the library is loaded, the API will automatically use this function to open and reserve a path to the next
available TR122 instrument in the CPCI crate. Therefore, generally the programmer will not have to call this
function. If there are more than one TR122 instruments present in the crate, this function can be used to close the
current connection and open a connection to the next instrument in the crate as defined by PCI slot number. If no
more instruments are found, a connection to the original TR122 will be opened again. If no TR122 is found at all,
this routine returns 0, which would have caused the library load to fail and a user warning message box to be
displayed.
DCAPI TR122_StartHostServiceMode(void);
DCAPI TR122_StartRecordMode(void);
The TR122 hardware has two distinct operating modes called Host Service Mode and Record Mode. Generally,
to update any configuration or to read the sample memory, the TR122 must be in host service mode. A TR122
in record mode will be recording samples in a segment of sample memory. Calling these routines switches the
hardware between these modes and performs certain software and hardware housekeeping associated with
these changes.
DCAPI TR122_SetSampleRate(DWORD Rate);
DCAPI TR122_GetSampleRate(DWORD *Rate);
The sample rate can be set when in host service mode. The sample rate value in the set routine is an internal control
value and must be one of the SAMPLE_RATE_XX values found in header file. The sample rate returned by
reference in the get routine is a human readable number of megahertz (million samples per second).
DCAPI TR122_SetSampleSegmentSize(BYTE SegmentSize, DWORD PostTriggerSamples);
The sample memory geometry may be set when in host service mode. The segment size sent to the routine is an
internal control value and must be one of the SAMPLE_SEGMENT_XX values found in the header file. The post
trigger samples is just an integer value but must be an even number due to hardware limitations.
DCAPI TR122_GetStatus(BYTE *Status);
The status returned by reference in this function is defined in the header file. It informs the caller if the TR122 is in
host service mode. If the instrument is recording, the status indicates if the memory is full. A caller may poll this
routine periodically to see if a transient recording has stopped on its own due to a full memory.
DCAPI TR122_SoftwareTrigger(void);
This routine issues a trigger without restriction just as if it came from any other source. The software trigger is
logically ORed with any selected trigger source. The trigger will only affect operation if the TR122 is waiting for
a trigger at the time. This trigger source is not synchronous to anything.