PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
void GetOverviewBuffers (short **overviewBuffers,short overflow,unsigned long triggeredAt,short triggered,short auto_stop,unsigned long nValues)
{
if(triggered != 0)
{
std::wcout << "Triggered! " << nValues << std::endl;
}
}
...
if(ps2000_set_channel(_scopeHnd,PS2000_CHANNEL_A,true,true, PS2000_5V) == 0)
{
std::wcout << "Failed to initialise channel A" << std::endl;
return;
}
tPS2000TriggerConditions tConditions;
tPS2000PwqConditions pwConditions;
tPS2000TriggerChannelProperties tchProperties;
tConditions.channelA = PS2000_CONDITION_DONT_CARE;
tConditions.channelB = PS2000_CONDITION_DONT_CARE;
tConditions.channelC = PS2000_CONDITION_DONT_CARE;
tConditions.channelD = PS2000_CONDITION_DONT_CARE;
tConditions.external = PS2000_CONDITION_DONT_CARE;
tConditions.pulseWidthQualifier = PS2000_CONDITION_TRUE;
pwConditions.channelA = PS2000_CONDITION_TRUE;
pwConditions.channelB = PS2000_CONDITION_DONT_CARE;
pwConditions.channelC = PS2000_CONDITION_DONT_CARE;
pwConditions.channelD = PS2000_CONDITION_DONT_CARE;
pwConditions.external = PS2000_CONDITION_DONT_CARE;
tchProperties.hysteresis = 200;
tchProperties.channel = PS2000_CHANNEL_A;
tchProperties.thresholdMode = PS2000_LEVEL;
tchProperties.thresholdMajor = 11794; // 1.8V
tchProperties.thresholdMinor = 0;
if(ps2000SetAdvTriggerChannelConditions(_scopeHnd,&tConditions,1) == 0)
{
std::wcout << "Failed to configure AdvTriggerChannelConditions" << std::endl;
return;
}
if(ps2000SetAdvTriggerChannelDirections(_scopeHnd, enPS2000ThresholdDirection::PS2000_ADV_FALLING,PS2000_ADV_NONE,PS2000_ADV_NONE,PS2000_ADV_NONE,PS2000_ADV_NONE) == 0)
{
std::wcout << "Failed to configure trigger channel directions" << std::endl;
return;
}
if(ps2000SetPulseWidthQualifier(_scopeHnd,&pwConditions,1, enPS2000ThresholdDirection::PS2000_ADV_FALLING ,26,0, PS2000_PW_TYPE_GREATER_THAN) == 0)
{
std::wcout << "Failed to configure pulse width qualifier" << std::endl;
return;
}
if(ps2000_run_streaming_ns(_scopeHnd,1, PS2000_US,1000000,0,1,SCOPE_BUFFER_SIZE) == 0)
{
std::wcout << "Failed to start streaming" << std::endl;
return;
}
Code: Select all
tConditions.channelA = PS2000_CONDITION_TRUE;