SetChannel call on 4224-11

Post your .Net discussions here
Post Reply
staffa
Newbie
Posts: 0
Joined: Tue Feb 26, 2019 2:39 pm

SetChannel call on 4224-11

Post by staffa » Tue Feb 26, 2019 3:11 pm

Hi Chaps,

Scope PS4224-11

Query w.r.t. to the ps4000SetChannel call.

Our original program is in VB.Net.
Here, we use the call above to set the range to 28 = PS4000_ACCELEROMETER_5V (from your ps4000Api.h):
status = ps4000SetChannel(_psHandle, 0, 1, 1, 28)

I am now porting the code to C#. I am using your PS4000Imports.cs file to call ps4000SetChannel:
status = PS4000Imports.SetChannel(_psHandle, PS4000Imports.Channel.ChannelA, 1, 1, PS4000Imports.Range.Range_5V);

However, I cannot set the range value to 28 = PS4000_ACCELEROMETER_5V. I am restricted to the following ranges:

public enum Range : int
{
Range_10MV,
Range_20MV,
Range_50MV,
Range_100MV,
Range_200MV,
Range_500MV,
Range_1V,
Range_2V,
Range_5V,
Range_10V,
Range_20V,
Range_50V,
Range_100V,
}

i.e. the range in the PS4000Imports.cs file is not consistent with the range in the ps4000Api.h file.

Thanks.

Martyn
Site Admin
Site Admin
Posts: 3614
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: SetChannel call on 4224-11

Post by Martyn » Wed Feb 27, 2019 6:32 am

The enum for range needs updating to

Code: Select all

		public enum Range : int
		{
			Range_10MV,
			Range_20MV,
			Range_50MV,
			Range_100MV,
			Range_200MV,
			Range_500MV,
			Range_1V,
			Range_2V,
			Range_5V,
			Range_10V,
			Range_20V,
			Range_50V,
            		Range_100V,
			Range_MAX_RANGES,
			Range_RESISTANCE_100R,
			Range_RESISTANCE_1K,
			Range_RESISTANCE_10K,
			Range_RESISTANCE_100K,
			Range_RESISTANCE_1M,
			Range_MAX_RESISTANCES,
			Range_ACCELEROMETER_10MV,
			Range_ACCELEROMETER_20MV,
			Range_ACCELEROMETER_50MV,
			Range_ACCELEROMETER_100MV,
			Range_ACCELEROMETER_200MV,
			Range_ACCELEROMETER_500MV,
			Range_ACCELEROMETER_1V,
			Range_ACCELEROMETER_2V,
			Range_ACCELEROMETER_5V,
			Range_ACCELEROMETER_10V,
			Range_ACCELEROMETER_20V,
			Range_ACCELEROMETER_50V,
			Range_ACCELEROMETER_100V,
			Range_MAX_ACCELEROMETER,
			Range_TEMPERATURE_UPTO_40,
			Range_TEMPERATURE_UPTO_70,
			Range_TEMPERATURE_UPTO_100,
			Range_TEMPERATURE_UPTO_130,
			Range_RESISTANCE_5K,
			Range_RESISTANCE_25K,
			Range_RESISTANCE_50K,
			Range_MAX_EXTRA_RESISTANCES
		}
Martyn
Technical Support Manager

Post Reply