ich have a problem with a self written c++ (visual studio) program, that must work with a trigger. without trigger the program works fine.
my triggersetup should work with the ext channel and channel A + signal generator (for testing).
channelproperty1.upperThreshold = 8000;
channelproperty1.lowerThreshold = 0;
channelproperty1.hysteresis = 0;
channelproperty1.thresholdMode = LEVEL;
channelproperty1.channel = PS5000_EXTERNAL;
status = ps5000SetTriggerChannelProperties(handle,&channelproperty1,1,0,0);
conditions.channelA = TriggerConditions::DontCare;
conditions.channelB = TriggerConditions::DontCare;
conditions.channelC = TriggerConditions::DontCare;
conditions.channelD = TriggerConditions::DontCare;
conditions.ext = TriggerConditions::True;
conditions.aux = TriggerConditions::DontCare;
conditions.pwq = TriggerConditions::DontCare;
while (samples < bufferSize)
status = ps5000GetStreamingLatestValues(handle, callBack, NULL);
extern "C" void __stdcall callBack
unsigned long startIndex, //
unsigned long triggerAt,
void * pParameter)
g_autoStop = autoStop;
received = true;
samples += noOfSamples;
one problem is, that the flag triggered is true after the first callback call, although the external trigger is switched off. the second call the triggered flag is flags and will never be true again, although the trigger is switched on.
at the third call the autostop flag is true (dont know why, the max values aren't collected).
and a last failure case: if the triggerchannel is switched on at the beginning of the data collection - the propgram starts correctly (but collect to much data - bufferoverflow)
i hope anybody can help me