User`s manual

Writing Custom Applications
{
if (!StreamConnected)
{
UI->Log("Stream not connected! -- Open the boards");
return;
}
//
// Make sure packets fit nicely in BM region.
if (FBusmasterSize/16 < (unsigned int)Settings.PacketSize)
{
Log("Error: Packet size is larger than recommended size");
return;
}
//
// Set up Parameters for Data Streaming
// ...First have UI get settings into our settings store
UI->GetSettings();
Before we start streaming, all necessary parameters must be checked and loaded into option object. UI-> GetSettings() loads
the settings information from the UI controls into the Settings structure in the ApplicationIo class.
if (SampleRate() > Module.Input().Info().MaxRate())
{
UI->Log("Sample rate too high.");
StopStreaming();
UI->AfterStreamAutoStop();
return;
}
We insure that the sample rate specified by the GUI is within the capabilities of the module.
if (Settings.Framed)
{
if (Settings.FrameCount < Settings.PacketSize)
{
UI->Log("Error: Frame count must exceed packet size");
UI->AfterStreamAutoStop();
return;
}
}
The module supports both framed and continuous triggering. In framed mode, each trigger event, whether external or
software initiated, results in the acquisition of a fixed number of samples. In continuous mode, data flow continues whenever
the trigger is active, and pauses while the trigger is inactive. The code above issues a warning if the trigger mode is framed
and ill-formed.
FBlockCount = 0;
FBlockRate = 0;
FTriggered = -1;
The class variables above are used to maintain counts of blocks received, reception rate and whether the module is currently
triggered. These values are initialized prior to each streaming run.
//
// Channel Enables
Module.Output().Info().Channels().DisableAll();
X5-GSPS User's Manual 52