Test and Measurement Forum

C# Example in PS4000SDK_r10_1_0_17, Triggered Block problem

Post any questions you may have about our current range of oscilloscopes

C# Example in PS4000SDK_r10_1_0_17, Triggered Block problem

Postby rbreese » Tue Jun 28, 2011 10:10 pm

I am using the C# example in the PS4000SDK (R10_1_0_17) with a Picoscope 4227 under Vista Business 32-bit, Visual Studio 2008.

I am using the Triggered Block mode, and my problem is that it works fine on the first trigger, but then does not trigger after that (the signal input is just a square pulse to test it). I have to restart the program in order for it to trigger again.

The 'immediate block' trigger works fine (well it would, since it disables the trigger).

I have checked all of the status codes from the various API calls, and they are all zero. I have looked at the data being passed to the calls, and its seem that it is duplicated data on the repeated call, so I don't know why just the first call is working.

I also tried the C example (PS4000con.c) and this works fine with no problems. I have not compared the code between the two examples to see if there are structural differences (at first glance the C# seems a direct translation).

It seems to be a C#/.NET problem that should be easily repeatable. I have not tried to look at all of the C# wrappers to see if the arguments are being marshalled correctly.

Has Pico Technology seen this problem?

Thanks.
rbreese
 

Re: C# Example in PS4000SDK_r10_1_0_17, Triggered Block prob

Postby Hitesh » Thu Jun 30, 2011 12:24 pm

Hi,

Thanks for your post.

Are you having issues with the example code i.e. are you trying to press 'T' to capture another triggered block after the first one and subsequent runs? Or, are you trying to write your own code to carry out a repeated trigger?

If you are doing this in a loop, makesure that you set the _ready flag to 'false' at the start of each iteration.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2006
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: C# Example in PS4000SDK_r10_1_0_17, Triggered Block prob

Postby rbreese » Tue Jul 05, 2011 2:06 pm

Thanks for the reply.

I am using your example right out of the box. I press 'T' the first time, and it waits for trigger -- I send a pulse externally, and it is captured (first 10 values are printed). I then press 'T' the second time, and it waits for trigger -- I send a pulse externally, and nothing happens -- I send several pulses, and nothing happens (I have to press a key to abort the capture).

I then added some code to examine status returns from every one of your C# wrapper functions along the way and they are all normal (i.e, zero).

I then tried your 'C' example and it worked fine using the triggered block mode (I have not compared the C and C# examples to see how different they are).

My work around right now is that I added a C# wrapper to the PS4000Imports.cs file for the 'ps4000SetSimpleTrigger' function, wrote my own code to use this, and it works fine. I don't know why the more complex triggering mode in your example is not working, but it should be easy to repeat.

I am using Vista Business 32-bit OS.

Thanks.
rbreese
 

Re: C# Example in PS4000SDK_r10_1_0_17, Triggered Block prob

Postby Martyn » Fri Jul 15, 2011 10:47 am

We have been unable to replicate the problem with the example code and find that it triggers correctly every time.

Can you confirm if this was a clean first time installation of the PS4000SDK or have you installed other Pico products on this PC ?
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2285
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 0 guests