Missing PicoScope 6000E Programmer's Guide

Post general discussions on using our drivers to write your own software here
Post Reply
Siebje
Newbie
Posts: 0
Joined: Tue Mar 13, 2012 1:33 pm

Missing PicoScope 6000E Programmer's Guide

Post by Siebje »

Hi!

I'm trying to write a support driver for the Pico6000E series (PS6000A API, because it's only a few letters away, right?). However, I can't find the programmers guide anywhere. Can somebody help me?

Gerry
PICO STAFF
PICO STAFF
Posts: 1145
Joined: Mon Aug 11, 2014 11:14 am

Re: Missing PicoScope 6000E Programmer's Guide

Post by Gerry »

Hi Siebje,

I assume that you mean, you want to write an API for the PicoScope 6000E using the PS6000A Driver. As mentioned on your other post, unfortunately the Programmers Guide is not yet available, but as soon as we know when it will be I will let you know.

Regards,

Gerry
Gerry
Technical Specialist

Siebje
Newbie
Posts: 0
Joined: Tue Mar 13, 2012 1:33 pm

Re: Missing PicoScope 6000E Programmer's Guide

Post by Siebje »

Is there any guidance you can provide on specific functions? My customers are expecting a functioning device driver. Provided that the entire 6000 series has been marked end-of-life, they are not happy buying an old model.

I'm currently getting stuck on the following functions (64 bit mode):

Code: Select all

PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps6000aGetScalingValues)
(
	int16_t	handle,
	PICO_SCALING_FACTORS_VALUES *scalingValues,
	int16_t nChannels
	);
Whatever I provide as the PICO_SCALING_FACTORS_VALUES, it always fails the call, saying that it can't read the provided struct (0x04).

The reason I'm trying to call this function in the first place is because the call to

Code: Select all

PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps6000aSetChannelOn)
(
	int16_t                       handle,
	PICO_CHANNEL                  channel,
	PICO_COUPLING                 coupling,
	PICO_CONNECT_PROBE_RANGE      range,
	double                        analogueOffset,
	PICO_BANDWIDTH_LIMITER        bandwidth
	);
no longer requires a standard range, but a PICO_CONNECT_PROBE_RANGE, which is a giant enum for which I don't understand the values, and I can't seem to fetch them from the device. Either way, this function will cause a PicoStatus.PICO_WARNING_PROBE_CHANNEL_OUT_OF_SYNC.

Finally, provided I ignore all the previous problems, I end up at

Code: Select all

PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps6000aSetDataBuffers)
(
	int16_t           handle,
	PICO_CHANNEL			channel,
	PICO_POINTER			bufferMax,
	PICO_POINTER			bufferMin,
	int32_t						nSamples,
	PICO_DATA_TYPE		dataType,
	uint64_t					waveform,
	PICO_RATIO_MODE		downSampleRatioMode,
	PICO_ACTION				action
	);
Most of the arguments I've seen before, but I have no clue what the 'waveform' parameter is supposed to do, and I can't find it in any of the other SDK documentation either.

NeilH
PICO STAFF
PICO STAFF
Posts: 267
Joined: Tue Jul 18, 2017 8:28 am

Re: Missing PicoScope 6000E Programmer's Guide

Post by NeilH »

Hi

Which programming language are you using?
We have some examples for the ps6000a driver in C#, Python and Labview available on our github page which show how to call functions for using the new 6000E devices https://github.com/picotech

Neil
Neil
Technical Support Engineer

Siebje
Newbie
Posts: 0
Joined: Tue Mar 13, 2012 1:33 pm

Re: Missing PicoScope 6000E Programmer's Guide

Post by Siebje »

Thanks, that's helpful. I'm using Java, but I'll probably be able to distill the info I need from the examples.

Siebje
Newbie
Posts: 0
Joined: Tue Mar 13, 2012 1:33 pm

Re: Missing PicoScope 6000E Programmer's Guide

Post by Siebje »

I cloned the c# examples, and I'm back on my way for now. Thanks for the help.

Siebje
Newbie
Posts: 0
Joined: Tue Mar 13, 2012 1:33 pm

Re: Missing PicoScope 6000E Programmer's Guide

Post by Siebje »

Never mind that, I'm still stuck. But at least now I have a specific baseline to base my question on. It's still about this function:

Code: Select all

PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps6000aGetScalingValues)
(
	int16_t	handle,
	PICO_SCALING_FACTORS_VALUES *scalingValues,
	int16_t nChannels
	);
This is no included in any of the examples, so I had to add it. I have updated the following files:

ps6000a.DeviceEnums.cs:

Code: Select all

public enum PicoConnectProbeRange 
{
        PICO_X1_PROBE_10MV,
        PICO_X1_PROBE_20MV,
        ...
        PICO_CURRENT_CLAMP_60A_V2_50A,
        PICO_CURRENT_CLAMP_60A_V2_60A
}
ps6000a.DeviceStructs.cs:

Code: Select all

[StructLayout(LayoutKind.Sequential, Pack = 1)]
  public struct PicoScalingFactors {
    public Channel Channel;
    public PicoConnectProbeRange Range;
    public short Offset;
    public double ScalingFactor;

    public PicoScalingFactors(Channel channel, PicoConnectProbeRange range, short offset, double scalingFactor) {
        Channel = channel;
        Range = range;
        Offset = offset;
        ScalingFactor = scalingFactor;
    }
  }
ps6000a.DriverImports.cs:

Code: Select all

[DllImport(DriverName, EntryPoint = "ps6000aGetScalingValues")]
    public static extern StandardDriverStatusCode GetScalingValues(
      short handle,
      PicoScalingFactors[] scalingFactors,
      short numScalingFactors);
Now that we have added the functions as specified in the header file, we should be able to call it. So, I added the following code:

ps6000aDevice.cs :: InitializeChannels

Code: Select all

    var scalingFactor = new PicoScalingFactors();
    var scalingFactors = new List() { scalingFactor };
    status = DriverImports.PS6000a.GetScalingValues(handle, scalingFactors.ToArray(), 1);
This code is more or less a copy-paste from the first few lines of SetTrigger, since that function has a very similar footprint. However, again, as with my Java and C++ attempts, this results in a MemoryAccessViolation. At this point I feel like I've tried everything from giving it a single struct as an argument to giving it a giant empty memory section, giving it memory with some pointers, you can go on.

Currently, it feels like the function call is not correctly interpreting the provided pointer values as a 64 bit value, but somehow using 32-bit values, which then results in an access violation.

Please assist.

Post Reply