ps2000_run_streaming_ns triggering more than expected

Post your .Net discussions here
Post Reply
davidpruitt
Advanced User
Advanced User
Posts: 0
Joined: Tue May 17, 2016 6:45 pm

ps2000_run_streaming_ns triggering more than expected

Post by davidpruitt »

I am attempting to use the ps2000_run_streaming_ns function with my Pico 2204A scope.

I initialize the scope and set up a trigger like so:

Code: Select all

//Open the oscilloscope
scopeHandle = Imports.OpenUnit();

//Define a channel and a trigger to be used.
Imports.SetChannel(scopeHandle, Imports.Channel.ChannelA, 1, 1, Imports.Range.Range_20V);
Imports.SetTrigger(scopeHandle, (short)Imports.Channel.ChannelA, 0, (short)Imports.ThresholdDirection.Rising, 0, 0);
I then have a loop that reads the data from the stream, assuming that a trigger occurred of course. Code:

Code: Select all

while (!done)
{
	unsafe
	{
		//Retrieve new data
		Imports.ps2000_get_streaming_last_values(scopeHandle, StreamingCallbackFunction);

		if (_triggered > 0)
		{
			//do some logic

                       this.Stop();
                       Imports.SetTrigger(scopeHandle, (short)Imports.Channel.ChannelA, 0, (short)Imports.ThresholdDirection.Rising, 0, 0);
                       this.Run();
		}
	}
}
_triggered is a property of the class that this code is in. The "StreamingCallbackFunction" sets the variable:

Code: Select all

unsafe void StreamingCallbackFunction(short** overviewBuffers,
				  short overFlow,
				  uint triggeredAt,
				  short triggered,
				  short auto_stop,
				  uint nValues)
{
	_triggered = triggered;
	//more logic follows
}
Anyway, what I have found is that "_triggered" is set to true more often than expected. Or in other words, when there isn't actually any kind of signal other than minimal noise on the scope. Any clue as to why this is?

I have also found that if I want to keep receiving "triggered" streams of data, I have to stop the stream, set the trigger again, and then start the stream again. Is this by design, or am I doing something wrong?

Thanks for any help!

Hitesh

Re: ps2000_run_streaming_ns triggering more than expected

Post by Hitesh »

Hi David,

Which version of the ps2000.dll are you using?

We are aware of an issue where a trigger would be incorrectly reported resulting in 2 trigger indications but this should be fixed.

When collecting data in streaming mode, you can only have one trigger event. To capture another trigger event you will need to stop and restart data collection.

Regards,

Post Reply