PicoScope3207B - Info

Post your .Net discussions here
mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

PicoScope3207B - Info

Post by mosine » Thu Feb 09, 2017 2:12 pm

Hi,
I'm new user (I used physical oscilloscope..) of this device. I installed PicoScope6 and it works fine.
Now, I need some information because I'm developing a c# application. I read about ps3000.dll, but I think that's old method...
Is it possible to have ps3000 library? or similar?

Thanks in advance

Martyn
Site Admin
Site Admin
Posts: 3301
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope3204 - Info

Post by Martyn » Thu Feb 09, 2017 2:50 pm

Please click Downloads tab at top of page, if your exact device model is not listed under the Product Series column, change this to "Discontinued"

You can then chose the appropriate SDK, 32bit or 64bit, depending upon your development requirements.
Martyn
Technical Support Manager

mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

Re: PicoScope3204 - Info

Post by mosine » Thu Feb 09, 2017 5:22 pm

Thank you Martin for reply.
I read to download SDK in other posts on this forum. I take example and now I'm developing sample application.
I developed some functions, but I have some questions:

1. Is timeBase rappresented only in ns?

2. My target is: read a square wave and get period, duty cycle. Is there an example in c#? Or can you suggest me some informations?

Thanks in advance.

Martyn
Site Admin
Site Admin
Posts: 3301
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope3204 - Info

Post by Martyn » Fri Feb 10, 2017 1:15 pm

timeBase is an integer where 0 represents the fastest sampling rate for a device. If you use GetTimebase you can read the actual sample interval, and interval units related to a particular timebase.

We don't have any examples for pulse width, and duty cycle, although I would expect this to be relatively straightforward. You will need to be looking through your data for mid point crossings (zero point if you signal goes positive and negative) and just count the samples until it goes back the other way. Remember to add a bit of hysteresis to ensure a true crossing not a one caused by a bit of noise.
Martyn
Technical Support Manager

mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

Re: PicoScope3204 - Info

Post by mosine » Mon Feb 13, 2017 8:54 am

Thank you Martin for reply.
I need to read a pwm signal to understand the target of my application and I think that PicoScope is perfect for my needs, because Picoscope is equipped with GEN output.
I read Programmer's guide, but there are many many options.

Have you got a sample example of Generation of PWM in c#?

Thank you.

Martyn
Site Admin
Site Admin
Posts: 3301
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope3204 - Info

Post by Martyn » Mon Feb 13, 2017 9:32 am

Can you open the device with our PicoScope 6 software and go to Help->About and post back the details in the box. I need to know exactly which model and driver versions are installed.
Martyn
Technical Support Manager

mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

Re: PicoScope3207B - Info

Post by mosine » Mon Feb 13, 2017 9:46 am

Info that you required:

PicoScope 6 - Oscilloscope PC Software: 6.9.12.3

Model: PicoScope 3.207B
Serial Number: CO130/007
Driver Version: 1.4.1.24
Firmware version: 1.0.2.0/0.9.15.0

Thanks in advance.

mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

Re: PicoScope3207B - Info

Post by mosine » Mon Feb 13, 2017 1:50 pm

Hi Martin,
I solved with pwm generation (I generate a pwm with 2msec of period and 50% duty cycle).

Now, I need a sample c# application to read data (RunBlock or Streaming mode)...
Can you help me??


Thanks

Martyn
Site Admin
Site Admin
Posts: 3301
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope3207B - Info

Post by Martyn » Mon Feb 13, 2017 3:13 pm

There is a C# console application in the SDK that includes code for both Streaming and Block captures.
Martyn
Technical Support Manager

mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

Re: PicoScope3207B - Info

Post by mosine » Tue Feb 14, 2017 11:19 am

Hi Martin,
finally, I develop my application starting from c# console example.
It works, but I have a question/problem.
I must read a square wave with period = 1msec.
My application read period = 500us (I see it in column Time of block.txt file)

Can you help me?

Thanks

Martyn
Site Admin
Site Admin
Posts: 3301
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope3207B - Info

Post by Martyn » Tue Feb 14, 2017 12:07 pm

You will need to check the sample interval you have chosen (or timebase), and the number of samples you are collecting, as this will define the time span for your data.
Martyn
Technical Support Manager

mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

Re: PicoScope3207B - Info

Post by mosine » Tue Feb 14, 2017 1:55 pm

Hi Martin,
thanks for reply, but I don't understand your reply. I explain you.
This is my block.txt file:
For each of the 1 Channels, results shown are....
Time interval Maximum Aggregated value ADC Count & mV, Minimum Aggregated value ADC Count & mV

Time Ch Max ADC Max mV Min ADC Min mV
0 ChA 16384 5039 0 0
100000 ChA 16128 4960 0 0
200000 ChA 8064 2480 0 0
300000 ChA -256 -78 0 0
400000 ChA -256 -78 0 0
500000 ChA 16384 5039 0 0
600000 ChA 16384 5039 0 0
700000 ChA 8064 2480 0 0
800000 ChA -256 -78 0 0
900000 ChA -256 -78 0 0
1000000 ChA 16256 5000 0 0

You can see (bold font line) that picoscope read rising peak interval = 500us.
The input square ware has rising peak interval of 1 msec.

I don't understand your reply because I don't think that problem depends on number of sample, timebase and time span.

Picoscope6 Application works fine (read correctly).

Thanks in advance.

Martyn
Site Admin
Site Admin
Posts: 3301
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope3207B - Info

Post by Martyn » Wed Feb 15, 2017 7:25 am

I would need to see the values you are passing into the API calls. Maybe if you can post the example code that gives this data we can understand where the error is.
Martyn
Technical Support Manager

mosine
Newbie
Posts: 0
Joined: Thu Feb 09, 2017 2:03 pm

Re: PicoScope3207B - Info

Post by mosine » Wed Feb 15, 2017 8:25 am

Hi Martin,
thank you for reply. I write my source code (I follow example Console...):

1 INIT

Code: Select all

 
            _timebase = 1;
            _firstRange = Imports.Range.Range_100MV;
            _lastRange = Imports.Range.Range_20V;
            _channelSettings = new ChannelSettings[2];

            for (int i = 0; i < 2; i++)
            {
                _channelSettings[i].enabled = true;
                _channelSettings[i].DCcoupled = true;
                _channelSettings[i].range = Imports.Range.Range_5V;
            }
Open device (I choose 5V power supply):

Code: Select all

            if (deviceOpen(out _handle) == 0)
            {
                label1.Text = "OK";
            }
            else
            {
                label1.Text = "KO";
            }
I set channel A:

Code: Select all

            _channelSettings[0].range = (Imports.Range)9;
            _channelSettings[0].enabled = true;
            SetDefaults();
            label2.Text = " = {0} mV" + inputRanges[9];

I set TimeBase to 100usec:

Code: Select all

            int maxSamples;
            _timebase = 12502;
            while (Imports.GetTimebase(_handle, _timebase, BUFFER_SIZE, out timeInterval, 1, out maxSamples, 0) != 0)
            {
                label3.Text = "KO";
                _timebase++;
            }
            label3.Text = "Timebase index:" + _timebase + " - TimeInterval ns " + timeInterval;
            _oversample = 1;
I choose Immediate Block:

Code: Select all

label4.Text = "START.....";
            short triggerVoltage = mv_to_adc(1000, (short)_channelSettings[(int)Imports.Channel.ChannelA].range); // ChannelInfo stores ADC counts
            Imports.TriggerChannelProperties[] sourceDetails = new Imports.TriggerChannelProperties[] {
                new Imports.TriggerChannelProperties(triggerVoltage,
                                                         256*10,
                                                         triggerVoltage,
                                                         256*10,
                                                         Imports.Channel.ChannelA,
                                                         Imports.ThresholdMode.Level)};

            Imports.TriggerConditions[] conditions = new Imports.TriggerConditions[] {
              new Imports.TriggerConditions(Imports.TriggerState.True,
                                            Imports.TriggerState.DontCare,
                                            Imports.TriggerState.DontCare,
                                            Imports.TriggerState.DontCare,
                                            Imports.TriggerState.DontCare,
                                            Imports.TriggerState.DontCare,
                                            Imports.TriggerState.DontCare)};

            Imports.ThresholdDirection[] directions = new Imports.ThresholdDirection[]
	                                        { Imports.ThresholdDirection.Rising,
                                            Imports.ThresholdDirection.None, 
                                            Imports.ThresholdDirection.None, 
                                            Imports.ThresholdDirection.None, 
                                            Imports.ThresholdDirection.None,
                                            Imports.ThresholdDirection.None };

            SetDefaults();

            /* Trigger enabled
             * Rising edge
             * Threshold = 1000mV */
            SetTrigger(sourceDetails, 1, conditions, 1, directions, null, 0, 0, 0);

            BlockDataHandler("Ten readings after trigger", 0, Imports.Mode.ANALOGUE);

            label4.Text = "END";
in the BlockDataHandler:

Code: Select all

                status = Imports.RunBlock(_handle, 0, (int)sampleCount, _timebase, _oversample, out timeIndisposed, 0, 
                                                        _callbackDelegate, IntPtr.Zero);

                short overflow;
                uint startIndex = 0;
                uint downSampleRatio = 2;

                if (mode == Imports.Mode.ANALOGUE || mode == Imports.Mode.MIXED)
                {
                    status = Imports.GetValues(_handle, startIndex, ref sampleCount, downSampleRatio,  
                                 Imports.RatioMode.Average, segmentIndex, out overflow);
                }
Thanks in advance.

Martyn
Site Admin
Site Admin
Posts: 3301
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope3207B - Info

Post by Martyn » Wed Feb 15, 2017 11:23 am

Can you post a psdata file (Save Current Waveform) with the exact setup that you want to replicate.
Martyn
Technical Support Manager

Post Reply