How to get actual voltage reading in PicoScope 3424?

Post your C and C++ discussions here
Post Reply
bikashrdas
User
User
Posts: 9
Joined: Fri Dec 19, 2008 8:26 am

How to get actual voltage reading in PicoScope 3424?

Post by bikashrdas »

Hi,
I am using a picoscope 3424 in fast streaming mode. The call back function called from ps3000_get_streaming_last_value() is returning pointers to the data buffer. From there I am reading the data and puting them into log file. If I am not wrong, then the collected data in the buffer are ADC counts (Please correct me, if I am wrong).

My doubt is how can I convert the buffer data in to actual voltage format.

I am a new use of PicoScope. Please help me in solving the problem.

Thanks & Regards,
Bikash

gruntman
Advanced User
Advanced User
Posts: 109
Joined: Thu Sep 28, 2006 3:50 pm

Post by gruntman »

Bikash,

Yes, you are correct. All of our units return the values from the driver in ADC counts. The PS3424 will return the values normalized to 16 bits readings also. This is to make use of oversampling when you have it enabled. To convert the readings to voltage readings you can use the following formula:

(raw adc count * (input_ranges[ch])) / (PS3000_MAX_VALUE-1)

To give you a example, say the driver returns a reading of 13000 on a ±20V scale.

(13000 x 20)/32766 = 7.93V

Let me know if you have any other questions...

Regards,

Richard Boyd
Crag Technologies, Inc
http://www.pc-oscilloscopes.com

bikashrdas
User
User
Posts: 9
Joined: Fri Dec 19, 2008 8:26 am

Post by bikashrdas »

Hi Rechard,
Thanks a lot for your help. My code is working now.

I have another samll doubt. Every channel is assigned with two buffer pointer.
e.g. for accessing channel-A Channel_buffer[0][] and Channel_buffer[1][]
and for accessing channel-B Channel_buffer[2][] and Channel_buffer[3][]
and so on..

Why there are two pointers for a channel? I am getting correct values from the second pointer for each channel. Then what is the first one?


Again thank you very much for your help.


Thanks & Regards,
Bikash

gruntman
Advanced User
Advanced User
Posts: 109
Joined: Thu Sep 28, 2006 3:50 pm

Post by gruntman »

Bikash,

You are using the fast streaming mode of the PicoScope unit. In this mode the values are returned from the driver aggregated based on the number of aggregation that you passed to the ps3000_run_streaming_ns function. The two buffers are the min and max aggregated values. Since the min buffer in null I imagine that you are passing 1 value to the no of aggregation parameter. When you start aggregating the data the minimum values will go into the first buffer and the maximum values will return in the second buffer. After you have stopped the scope and want to return the full set of unaggregated values simply call the ps3000_get_streaming_values_no_aggregation and the values will be passed to one buffer per channel.

Regards,

Richard Boyd
Crag Technologies, Inc
http://www.pc-oscilloscopes.com

bikashrdas
User
User
Posts: 9
Joined: Fri Dec 19, 2008 8:26 am

Post by bikashrdas »

Hi Rechard,
Thanks for your help. I have some more doubt. Please help me.

1. Is there any use of ps3000_get_timebase () in fast streaming mode.
a. I configured the oscilloscope to read data from channel A with following data.
ps3000_set_channel (Handle, 0, TRUE, TRUE, 7); /* Actual values that I am setting for channel A */
b. Then I am calling ps3000_get_timebase (), which is returning time interval of 200 and time unit 2 (PS3000_NS) and max_sample as 130599.
c. I am calling the ps3000_run_streaming_ns () with the time interval and time unit obtained in above step, the function is returning error (0).
d. With time interval = 10 and time unit = PS3000_US (3) the code is working. Is there any dependency on no. of samples?


2. With time interval of 10 and time unit = PS3000_US (3), when I am trying to read 10000 samples from Channel A, after reading 9152 samples ps3000_get_streaming_last_values () is returning error (0).

3. Can I get time-stamp for the samples (for each sample)?


Thanks & Regards,
Bikash

gruntman
Advanced User
Advanced User
Posts: 109
Joined: Thu Sep 28, 2006 3:50 pm

Post by gruntman »

Bikash,

No, you do not use the ps3000_get_timebase for fast streaming mode. For fast streaming mode you configure and call the functions like so:

1. Open the oscilloscope using ps3000_open_unit().
2. Select channel ranges and AC/DC switches using ps3000_set_channel().
3. Set the trigger using ps3000_set_trigger().
4. Start the oscilloscope running using ps3000_run_streaming_ns().
5. Get a block of data from the oscilloscope using ps3000_get_streaming_last_values().
6. Display or process the data.
7. If required, check for overview buffer overruns by calling
ps3000_overview_buffer_status().
8. Repeat steps 5 to 7 as necessary or until auto_stop is TRUE.
9. Stop fast streaming using ps3000_stop().
10. Retrieve any part of the data at any time scale by calling
ps3000_get_streaming_values().
11. If you require raw data, retrieve it by calling
ps3000_get_streaming_values_no_aggregation().
12. Repeat steps 10 to 11 as necessary.
13. Close the oscilloscope by calling ps3000_close_unit().

So, as you can see after you turn on channel A you would call immediately ps3000_run_streaming_ns function.

The unit has already captured the 10,000 samples that you requested. The auto_stop flag would return true if you requested the ps3000_get_streaming_values function.

The streaming buffers will store the start time and the actual values. To find out the times simply figure out which value it is in the buffer and multiply it by the sample interval.

Regards,

Richard Boyd
Crag Technologies, Inc
http://www.pc-oscilloscopes.com

bikashrdas
User
User
Posts: 9
Joined: Fri Dec 19, 2008 8:26 am

Post by bikashrdas »

Hi Richard,
Sorry in advance for writing such a big mail. I just want to know, “Is there any restriction in using “time unitsâ€

Post Reply