I have looked at your PS4000ABlockMode example for C# on your github page. I want to set up 3 channels where a and b are voltage channels and c is a current channel using the ta301 current probe.
I have tried setting up the current clamp range by using nearly all of the options in the PicoConnectProbeRange namespace and I cannot manage to set the channel up from my C# app. the moment I make it a voltage channel then the channel setup is fine and I can sample the data from the channels. Problem is that I see nothing on channel C if I set it up as a voltage channel (for example using: PicoConnectProbes.PicoConnectProbes.PicoConnectProbeRange.PICO_X1_PROBE_10V) I would expect at least 300mV (assuming 1mV/A as stated in the datasheet) because when I use my PicoScope oscilloscope app, the current clamp auto detects and I can see readings on that channel of up to 300A.
I am just wondering how should I set the channel up so that I can measure the same 300A measurement when I run the block?
How ever I get a runtime exception here on the return statement:
/****************************************************************************
* mv_to_adc
*
* Convert Scaled value (voltage or Probe units) to ADC value
* Inputs:
* - double - "scaled" value
* - ChannelRangeInfo (Used to scale the raw data)
* - Scopes "maxADCValue" used
****************************************************************************/
public static short mv_to_adc(double scaled, uint ChannelRange, short maxADCValue)
{
return (short)((scaled / (double)(inputRanges[ChannelRange])) * maxADCValue);
}
Saying:
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
My input arguments to the function are:
scaled = 300, ChannelRange = 4008, maxADCValue = 32767.
Is there something I am missing for the channel setup to set the trigger up on the current clamp channel?