Getting probe type

Post your LabVIEW discussions here
Post Reply
cbfsystems
Newbie
Posts: 0
Joined: Wed Nov 27, 2019 7:49 pm

Getting probe type

Post by cbfsystems »

I am using a Picoscope 4444 with Picoconnect probes and LabView. My LabView application should be able to determine what type of probe is connected to each channel so that it can use appropriate range parameters with the ps4000aSetChannel function. I have tried using the getUserProbeTypeInfo function in ps4000aWrap.dll. I am using a call library function node to call the function. The function has a probe number parameter, which I set to 0 (first probe, channel 1?). The function returns code 13. Maybe I am not setting the right probe number, but I couldn't find any description of what the probe number is, so I assumed values 0 - 3 correspond to the four channels of the scope. Any help figuring this out or pointing me at some documentation that shows how to do this would be appreciated.

AndrewA
PICO STAFF
PICO STAFF
Posts: 401
Joined: Tue Oct 21, 2014 3:07 pm

Re: Getting probe type

Post by AndrewA »

Hi,
Yes the 4444 supports our PicoConnect Probes which can be detected by the scope, as done in the PicoScope 6 software.
This can be done via API/SDK, but requires the use of callback functions which are not supported in LabVIEW so you need to use the wrapper functions. The steps are described in the programmers guide-
See page 115- https://www.picotech.com/download/manua ... -guide.pdf
I did find this LabVIEW code in the github repo - \PicoScope4000a.llb\PicoScope4000aProbeInteraction.vi
And tried it, (called it before Setting vi) it works and returns picoconnect probe information.
Yes the channel field values 0 - 3 correspond to channels A - D of the scope.

There are enum ranges (enPicoConnectProbeRange) for each different type of probe when passing to ps4000aSetChannel function.
(see PicoConnectProbes.h in C:\Program Files\Pico Technology\SDK\inc (64-bit SDK))
You will also see the enum PicoConnectProbe which is returned in the PicoScope4000aProbeInteraction.vi code example.

As LabVIEW is using the wrapper you have less control. The C code for the wrapper is here, if you are interested-
https://github.com/picotech/picosdk-c-w ... 000aWrap.c
If you see the error returned PICO_WARNING_PROBE_CHANNEL_OUT_OF_SYNC you are using the wrong enum probe range value for the probe connected.
The probe information is updated via a callback with separate driver thread, so it is possible getting the 'SetChannel()' error code above before your application's main thread has realised that the probe has arrived.
Also note that the interactions returned via the callback are an incremental update, not the current status. Looking at the wrapper code the callback retrieves all probes information at once and then sets the flag used in hasProbeStateChanged().

A few things about the steps on pages 116-117 ( 4.71.3 Probe interactions ) of the https://www.picotech.com/download/manua ... -guide.pdf .

relating to the code in PicoScope4000a.llb\PicoScope4000aProbeInteraction.vi

1. Call setProbeInteractionCallback() after opening a connection to the device (ensure any
power status codes are processed) and before calling ps4000aSetChannel().

This function above should be moved into say the ...Open.vi, as it should only be called once after opening the scope.

2. Poll hasProbeStateChanged().

I don't think you need to poll this function as the callback in the wrapper sets the flag once it copied all the probe information, then you must clear it via 'clearProbeStateChanged()'

3. Retrieve the initial probe information after a short delay of a few milliseconds:

I'm not sure why there needs to be delay, I modified the code PicoScope4000aProbeInteraction.vi, adding/removing a delay made no difference.

Also note that the following things are different once the probe is connected:

-Analogue offsets are interpreted in the units of the probe (e.g. amps for a current clamp), and the available range of values is given by calling ps4000aGetAnalogueOffset, once again in probe units
-Trigger thresholds and analogue offsets are scaled such that ps4000aMinimumValue and ps4000aMaximumValue represent the minimum and maximum of the enPicoConnectProbeRange bounds (usually, the last part of the enum tag, so PICO_CURRENT_CLAMP_200A_2kA_1000A would be +/- 1000A on the 200A / 2000A clamp, but for asymmetric ranges like PICO_HT_NEG5_TO_50KV for the 4x25A BNC HT Pickup lead, that doesn't quite apply) and readings are linearly scaled in-between.

The above items mean a lot of addition and possible changes to existing 4000a vi's for PicoConnect probes to be used correctly.
This is something that we could do as example in the future as we now have other scopes with intelligent probes like our 6000E series and new automotive 4425A/4225A scopes.

One thing you could do is add probe(s) values(enums) to 'Range' in Channel cluster.
Then control the selectable range for the connected probe using the 'Data Entry limits'. Using the information from the PicoScope4000aProbeInteraction.vi.
See 'How to change range of control programmatically' video; https://www.youtube.com/watch?v=wtyB-IMmj8s
(You will also need to set the 'Data Entry' tab (right click properties) to use Coerce for both max and min values)
I tried the setup as above in the video but have not tried applying this to one of our examples.
Regards Andrew
Technical Specialist

AndrewA
PICO STAFF
PICO STAFF
Posts: 401
Joined: Tue Oct 21, 2014 3:07 pm

Re: Getting probe type

Post by AndrewA »

Regards Andrew
Technical Specialist

Post Reply