08-22-2006 04:56 PM
08-23-2006 08:03 AM
08-23-2006 09:08 AM
08-23-2006 11:27 AM
Bilal,
Thank you. I got some code to work that creates a new custom scale, but I couldn't figure out how to get/set the old custom scale values. The custom scale I made manually with the assistant is called "MyScale". It shows up in MAX as well. The test code that works to create a new scale, "MyNewScale" is shown below. It is in DaqTask.vb generated by the assistant.
Public Overridable Sub Configure() Dim PreArray() As Double = {-0.1, -0.08, -0.06, 0, 0.06, 0.08, 0.1} Dim PostArray() As Double = {-160, -130, -90, 0, 80, 120, 140} Dim MyNewScale As New TableScale("MyNewScale", PreArray, PostArray)AIChannels.CreateVoltageChannel(
"Dev1/ai1", "Voltage", AITerminalConfiguration.Differential, -1, 1, "MyNewScale")Timing.ConfigureSampleClock(
"", 1000, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 1000) Dim oldPreArray() As Double Dim oldPostArray() As Double 'How do I create a TableScale object that references the existing custom scale called "MyScale"?oldPreArray = MyScale.PreScaledValues
oldPostArray = MyScale.ScaledValues
End SubThe "MyNewScale" gets created fine. Your e-mail implied that I could create a reference to it in code? How do I do that?
08-24-2006 04:28 PM
08-25-2006 11:36 AM
Dan,
Could you give me a line(s) of code that returns a list of the local scales in some variable? The way to set up the object declarations and reference everything isn't clear, I get hard to decipher error messages. (New to VS2005, programmed a lot in VB6). It would be nice if the MS online documentation included some examples. I looked thru the example directory and they all made things from scratch.
Thanks,
Steve
08-28-2006 12:37 PM
08-28-2006 01:41 PM
Terry,
I must not be clear. The custom scale exists and the scales() array gives me a string array that holds all the names. So, knowing the name of an existing scale made by MAX or my own code, how do I access the prescaled and scaled arrays AFTER the fact? Once I pick NationalInstruments.DAQmx.DaqSystem the only useful choice is Local and then I cannot get to PreScaledValues or ScaledValues.
I need to get the PreScaledValues and ScaledValues of a named, existing custom scale. In addition, once I have the TableScale object I may need to change some of the arrrays by the program. (One simple example is that I may need to change the offset so I would add it to the custom scale ScaledValues array.)
I must be dense or something. Thanks for your patience.
Steve
08-29-2006 09:21 AM