ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Tank Range.Maximum cannot be changed

I've just started with MS C# (2005) and have developed a "tank" based app.
I set the tank's Range max and min in design.
When I try to change the maximum / minimum Range, it complains about "read-only" property.
I then should set it in the constructor ?

Any help on the code in C# how this can be done ?
Amien
Cape Town

Mogamad Amien Crombie
Senior Software Engineer,
iThemba Labs [TLABS]
Faure
Cape Town.
Western Cape,
South Africa
0 Kudos
Message 1 of 3
(3,702 Views)
Amien,

That is correct.  When assigning the Range values for any of the Numeric Pointer controls you must construct a new Range object.  The Range.Maximum and Range.Minimum are read only properties.

Tank1.Range = new Range(-10.0, 10.0);

Let me know if you have any specific questions.

Regards,

Tyler Tigue
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,688 Views)
Hi Tyler

Thanks a million. It works and I have now a fully functional Measurement Studio application in VS 2005.
This will allow the ranges to be set by our hardware. We have 3 ranges (1 - 9 pA; 10 - 99 pA; 100 - 999 pA);

Thanks again.
Amien
Cape Town : 17h19, Wed 19 Jul
Mogamad Amien Crombie
Senior Software Engineer,
iThemba Labs [TLABS]
Faure
Cape Town.
Western Cape,
South Africa
0 Kudos
Message 3 of 3
(3,683 Views)