Test and Measurement Forum

Generating Sine using PS5000

Post your .Net discussions here

Re: Generating Sine using PS5000

Postby Hitesh » Thu May 26, 2016 2:16 pm

Hi Cristian,

Please try the example attached below (it includes the PS5000AImports.cs file as well).

PS5000aSigGen.zip
PS5000a C# Project (VS2010 Express) - updated
(18.69 KiB) Downloaded 21 times


Regards,
Hitesh

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

Re: Generating Sine using PS5000

Postby cmos » Thu May 26, 2016 2:29 pm

Hi,
I tested with both signatures BuiltIn and BuiltInV2 and they do not throw any error anymore when using numbers directly. However, I cannot observe any signall from the Signal Generator output. I have tried choosing different shots/sweep values, diferent frequencies and triggering modes (even calling the software trigger) but I cannot get it to work. Is there a way to test the signal gen in a direct manner? I am using powering the device via USB. This is just a huntch, but could be limited by power consumption? I do not have an AC adaptor (The unit came without one) so I won't be able to test this idea. I have seen issues with USB power before which makes me think it could be also affecting the operation of this output.

It would be great o get it working.

Cheers,

Cristian
cmos
Newbie
 
Posts: 0
Joined: Thu Apr 28, 2016 6:10 am

Re: Generating Sine using PS5000

Postby Hitesh » Thu May 26, 2016 2:51 pm

Hi Cristian,

Are you calling the ps5000aChangePowerSource() function after ps5000aOpenUnit() to tell the driver that you wish to use the device powered by the USB connection?

This is what the example above does.

Edit: I've made an update to the example to handle the power change correctly. It might be useful to know if an error dialog pops up on opening the unit.

Regards,
Hitesh

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

Re: Generating Sine using PS5000

Postby cmos » Fri May 27, 2016 5:55 am

Thank you very much. I found the signature were slightly different as mine returned "short" and yours returned an "uint" value. Not sure if this will make a big difference. Nevertheless, I was able to test your sample code and it works. I will compare all codes this weekend to see if there is any other difference when setting up the signal generator. I won't be able to test my changes but until Monday unfortunately. Thank you again and this was a very important step for me, to ensure the sigGen is working.

Regards,

Cristian
cmos
Newbie
 
Posts: 0
Joined: Thu Apr 28, 2016 6:10 am

Re: Generating Sine using PS5000

Postby cmos » Tue May 31, 2016 3:51 pm

Hi
It worked! The problem was in my end. I was trying to set up my peak to peak values in milivolts. using microvolts, as suggested in the API guide, was the solution.

Thank you for your assistance.

Cristian
cmos
Newbie
 
Posts: 0
Joined: Thu Apr 28, 2016 6:10 am

Re: Generating Sine using PS5000

Postby Hitesh » Wed Jun 01, 2016 8:22 am

Hi Cristian,

Good to hear it's working now! :D

Best wishes,
Hitesh

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

Previous

Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests