Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get simultaneous scalar values in a single read session

Hi All

Who know how to get a multiple scalar measurement values at a single reading session . In ScopeSingleRecordMeasurementReader class there is FetchScalarMeasurementFromSingleChannel which one of the parameter is measurement type ( Enum type) . But this Enum type seem to be able to put one value type at the time ( can't Binary ORed as their constant integer value seems to not support ORed operation, at least in documentation didn't mention that they can be ORed , I observed that it would be confusing for their value if we ORed between 1 "FallTime" and 2 "Frequency " which would equal to 3 "Period" thus would be incorrect ). I used to worked with a function that take Enum type as its argument and its value can be ORed which would give you a capable to get every single value the you ORed together at the single call of the method. But FetchScalarMeasurementFromSingleChannel  as I understand need to be called multiple time to get each scalar value , thus meant time consuming operation . If there is noway to get multiple value from a single reading then I need to work out a custom method that would extract those value from Wave form data which would be more complex .

Please share your idea with me if some one know to get those values more efficiently.

Regards

0 Kudos
Message 1 of 7
(4,415 Views)

Hello,

 

Have you installed NI-SCOPE .NET Class Library 1.1.1?  Assuming you have, there is a help topic at a specific location, which I will provide below:

 

Start » Programs » National Instruments » Measurement Studio (year) for Visual Studio (year) » Measurement Studio Documentation

 

Here, you will find the help files for Measurement Studio, including help for SCOPE .NET and others.  There is a topic in the help which describes how to fetch a scalar measurement or an array measurement.  The array measurement sounds like what you are asking for with the multiple scalar measurement fetch in one read session.  Here is the path in the help to get to the place that gives you example code for how to do this:

 

First, click Search » Expand NI Measurement Studio Help » NI Measurement Studio .NET Class Library » Using the Measurement Studio .NET Class Libraries » Using the NI-SCOPE .NET Library » Using Scope Readers » Using Scope Single Record Measurement Reader » Configuring ScopeSingleRecordMeasurementReader Programmatically

 

Let me know if you have trouble finding this.  I believe this should help answer your question.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 7
(4,397 Views)

Hi Kyle A

Thank for reply . Yes I can allocate this topic in the documentation but I still don't understand how could we get a multiple scalar value from FetchArrayMeasurementFromSingleChannel method as bellow method signature:

 scopeSingleRecordMeasurementReader.FetchArrayMeasurementFromSingleChannel("0", recordNumber, numberOfMeasurementSamples, measurementType, PrecisionTimeSpan.FromSeconds(5)). First of all this method return an AnalogWaveform of double, though each scalar value is of type double and they could be copied into AnalogWaveForm data type. But how do we know which value were put to which sequence or index in its raw data array? More importantly an argument measurementType which I high light with a red color is an Enum Type of  ScopeArrayMeasurementType, but none of its constant exhibit a key word that we could gather all scalar values .I don't know that we are in the same page or not . Scalar values that I talking about are listed in Enum type ScopeScalarMeasurementType but no need all values listed there rather a group of them .

Any suggestion , alternative or explanation how could we get a group of scalar value .

Regards

0 Kudos
Message 3 of 7
(4,391 Views)

So if I understand correctly, you want to know the corresponding scalar values in the enum type ScopeArrayMeasurementType and ScopeScalarMeasurementType?  I have attached these values as I have seen them through a LabVIEW control for the ScopeArrayMeasurementType.

 

These values should be accurate, but it would take some experimenting to see if the value entered is going to change the way the Measurement fuction works. 

 

Let me know if these work, or if I am still misunderstanding your question.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 4 of 7
(4,371 Views)

Hi Kyle A

It seems that we are in different page of the bible . The attached file you sent I can see it in a class object browser .

My question in my first post is how could we read a multiple scalar values in a single reading e.g. Voltage Low,Voltage Hight ,Voltage amplitude ,Over shoot , Pre shoot and so on . Suppose that the method you suggest work with what value of ScopeArrayMeasurementType Enum we could get the above mentioned values at once in a single reading  (what Enum value that we should pass into FetchArrayMeasurementFromSingleChannel as a parameter to get those Scalar values listed above).

Regards

0 Kudos
Message 5 of 7
(4,358 Views)

Sorry for the confusion, but I think I am on the same page with you now.  Typically, this would be done with multiple function calls of the measurement reader (as you have noted) so that you can do different measurements on a single fetch read session.  While you only have to call this function multiple times per session reference to a record fetch, I don't believe there will be a way to have this single call do multiple readings within itself.  On the flip side, calling the function multiple times should not be too processor intensive since it is post processing on the data after a record has been fetched off of the Scope memory.  The only downside is the repeatability on the code if you plan on taking many multiple measurements.

 

The only suggestion I would have is to have a while loop with a condition that if a certain enum value is selected by the user, to run that measurement reader on the particular scalar value, then check for other values selected by the user.  You can use a drop down menu or ring control or check boxes that will allow the user to select which values he wishes to read, then have the while loop iterate through all selected values.  Otherwise, there is not yet a coded way to achieve the particular functionality out of the measurement reader function.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 6 of 7
(4,311 Views)

Hi Kyle A

Seems we are in the same page nowSmiley Happy

Did you tried before how long it take for each value to read out , the time is very important to us as we do a test program for ATE not for manual test. The shorter test time the better . During this time I have an idea to read those value from a waveform data but I don't have a hardware on hand to test this idea yet.

What I doing is to create a structure name ScalarValue as code in Attachment ScalarValue.txt.

Then create a Function to read these values from a Waveform data as code in attachment GetScalar.txt

 

 

In this function I have a private method GetPeriod that would calculate a Period,GetRiseFallTime that would calculate RiseTime and FallTime which pass

ByRef (<OUT> keyword in C#)  and get out the result from calculation  and similary GetPreOverShoot would calculate PreShoot and OverShoot which also pass ByRef  . Thus I just read WaveForm only one time and call GetDataFromWaveForm I will be able to get all Scalar value in one shot. 

I don't know which approach would be faster as I didn't test it yet due to I don't have a hardware on hand .

If NI did a posprocess the scalar value ( on a hardware layer and not take CPU resource) why NI don't expose these values through such method as I try to describe above , it would be very useful for the end user. My method has a computation involve , in a fast computer we may gain otherwise it would take time compare to gather a data from memory .

 

Regards

 

Download All
0 Kudos
Message 7 of 7
(4,301 Views)