I have a picoscope 4444 connected with a TA300 current probe and an 442 differential probe ,to be able to make current and voltage measurements.
On the programmers-guide PDF it is specified that the range is defined in the header file :
PICO_STATUS ps4000aSetChannel
(
int16_t handle, PS4000A_CHANNEL channel,
int16_t enabled, PS4000A_COUPLING type,
PICO_CONNECT_PROBE_RANGE range,
float analogOffset
)
page74____________________________________________________________
range, specifies the measuring range. The original set of values defined in
ps4000aApi.h is shown in the table below. The PicoScope 4444 supports all
of these ranges plus an additional set defined in PicoConnectProbes.h
Now if I specify the channel range as PICO_1KV_500V or PICO_CURRENT_CLAMP_40A_1A I will get an error PICO_INVALID_VOLTAGE_RANGE. I can only use the value ranges between PS4000A_10MV and PS4000A_50V, which are established inside ps4000aApi.h.
My question is: how can I indicat the ranges that are 500V and 1A , which are inside PicoConnectProbes.h.
I did not find a solution, ps4000aSetChannel() does not accept values like PICO_1KV_500V or 6010.
I kind of hardcoded the range so when I make a plot from the csv values the signal has the same shape as the one from the software.
For example to use the 500V for the 442 differential probe i set the range to PS4000A_20V and for the TA300 current probe i set the range to PS4000A_200MV
The problem is now to find a way to convert from adc to V and A.
Have you used ps4000aSetProbeInteractionCallback as this will setthe driver up to allow you to use the correct ranges for the probe that it detects. Otherwise it will only allow standard ranges as you have found.
Yes, the ps4000aSetProbeInteractionCallback function populates the values of userProbeInfo.userProbeInteractions. I can get access to them and obtain for example rangeFirst_ which in this case returns 6003 but can not be established as a value range inside ps4000aSetChannel.
Also when the call to ps4000aSetProbeInteractionCallback is made, ps4000aSetCannel returns twice this status:
SetDefaults:ps4000aSetChannel------ 0x00000157
// the channel range limits have changed due to connecting or disconnecting a probe
// the channel has been enabled
which means PICO_WARNING_PROBE_CHANNEL_OUT_OF_SYNC
If I don't use ps4000aSetProbeInteractionCallback than ps4000aSetChannel returns no message.
The first problem is that I was just setting the range but with the old example of ps4000aSetChannel() and the second problem was that theuserProbeInfo.userProbeInteractions.enabledby default is set to "FLASE" and channel was never activated so i used userProbeInfo.userProbeInteractions.connected
I think that the online example needs a updated becuase the probes are not taken into consideration.
Thank you Martyn and hope it helps to improve the code on github.