User`s manual

Writing Custom Applications
void ApplicationIo::StartStreaming()
{
if (!FStreamConnected)
{
UI->Log("Stream not connected! -- Open the boards");
return;
}
//
// Make sure packets fit nicely in BM region.
if (FBmSizeWords/8 < (unsigned int)Settings.StreamPacketSize)
{
UI->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();
if (Settings.TestEnable)
{
Module.Output().TestEnable(Settings.TestEnable);
Module.Output().TestMode(Settings.TestMode);
Module.Output().TestFrequency(Settings.TestFrequency);
}
if (SampleRate() > Module->Output().Info().MaxRate())
{
UI->Log("Sample rate too high.");
StopStreaming();
UI->AfterStreamAutoStop();
return;
}
FBlockCount = 0;
FBlockRate = 0;
FTriggered = -1;
The first difference is that we configure the Output() sub-object instead of Input(). The X5 Family divides the interface
functions for Input and Output devices into separate configuration sub-objects. This allows Input and Output to be
independently configured.
//
// Channel Enables
Module.Output().Info().Channels().DisableAll();
for (int i = 0; i < Channels(); ++i)
if (Settings.ActiveChannels[i]==true)
Module.Output().Info().Channels().Enabled(i, true);
int ActiveChannels = Module->Output().Info().Channels().ActiveChannels();
if (!ActiveChannels)
{
UI->Log("Error: Must enable at least one channel");
UI->AfterStreamAutoStop();
return;
}
FStreaming = true;
// Set Decimation Factor
int factor = Settings.DecimationEnable ? Settings.DecimationFactor : 0;
X5-GSPS User's Manual 62