Subscribe: Measurement Studio for .NET Languages
http://forums.ni.com/rss/board?board.id=232
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
array  double  graph  main function  measurement studio  measurement  new  plots  property  studio  teststand  visual studio 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Measurement Studio for .NET Languages

Measurement Studio for .NET Languages topics



Measurement Studio for .NET Languages topics



Published: Thu, 18 Jan 2018 18:47:26 GMT2018-01-18T18:47:26Z

 



Problem of waveform access in ToolBox

Thu, 18 Jan 2018 16:47:15 GMT2018-01-18T16:47:15Z

Hello everybody,

I've a problem on Visual Studio C# 2015 which is appeared recently on my project and for which I don't find any solution.

I want to place a waveformGraph on my Form but when I put it on the form, the waveform doesn't appeared (before that was the case). You can see below on my printscreen.

If anybody have an idea, that will be really helpfull.

Best regards

 

(image)




Support for Visual Studio 2017

Fri, 12 Jan 2018 17:12:54 GMT2018-01-12T17:12:54Z

When will National Instruments release versions of DAQmx and Mesurement Studio for Visual Studio 2017?

I had to install Visual Studio 2013 on a new System to get the libraries, examples and help files.

And make the procedure http://digital.ni.com/public.nsf/allkb/F01DDED92E62447286257F5E0071048D

Why we pay Developer Suite subscription and get no update?

 




NI-MAX self-test won't run

Fri, 12 Jan 2018 14:19:56 GMT2018-01-12T14:19:56Z

I have a 64-bit Windows 10 PC with Measurement Studio 2015 and MS Visual Studio 2010 (both Professional edition), and NI device drivers from May 2017.  This PC is in a classified lab and had some security protocols set up on it by our Security department to "harden" it.

 

The PC has an NI PXI-2527 and NI PCI-6110 attached.  When I run NI MAX, these devices show up in the device explorer browser, but nothing happens when I select them and click "Self-Test".  These self-tests ran successfully on an unclassified PC at my desk, which had all the same applications installed but without the extra security.  Also, NI MAX is consistently crashing when being closed down on the classified PC.

 

What could be causing this?  We're thinking it must be related to the extra security somehow, but the technician from our Security department doesn't know what specifically it could be.




TDMS file: Modify custom property DataType

Mon, 08 Jan 2018 16:49:13 GMT2018-01-08T16:49:13Z

Good evening,

I'd like to change a property DataType on a TDMS file from PrecisionDateTime to String, is it feasible? Anybody know how to do it?

I'd like to do that using c# TDMS MeasurementStudio library or a Diadem script.

 

Thank you all for support.




WPF Graph DataSource

Thu, 04 Jan 2018 16:09:41 GMT2018-01-04T16:09:41Z

I don't know how many plots I need to graph at runtime, so I make a WPF Graph DataSource binding to a collection of a collection of points.  The graph binding works fine when I have more than 1 collection of points (i.e. 2 collections and 2 plots), but I cannot get the graph to bind when there is only one collection of points.  Should this work, or is this approach way off base?

 

Binding Object:

 

        private ObservableCollection> _PlotXYData = new ObservableCollection>();
        public ObservableCollection> PlotXYData
        {
            get
            {
                return _PlotXYData;
            }
            set
            {
                _PlotXYData = value;
                RaisePropertyChanged("PlotXYData");
            }
        }

XAML Binding:

 

                
                    
                        

                        
                        

                        
                        
                        
                    
                    
                        
                            
                        
                        
                            
                        
                    


                

 




WPF Graph - exception in NationalInstruments.Controls.Graphs.dll

Thu, 04 Jan 2018 14:03:29 GMT2018-01-04T14:03:29Z

Hello.

I am using NI Graphs in my WPF application. The graphs are binded to ChartCollection object. See following graph:

 

(image)

 

The graph has a lot of plots, so I had to increase capacity of ChartCollection. But when I increase capacity of ChartCollection object for example to 100.000.000, ni:Graph generate following exception when binding data, and application crash down.

 

A first chance exception of type 'System.OutOfMemoryException' occurred in NationalInstruments.Controls.Graphs.dll
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at NationalInstruments.Controls.Internal.ChartDataStore`1.UpdateCapacity(Int32 newCapacity)
   at NationalInstruments.Controls.ChartCollection`2.set_Capacity(Int32 value)
   at DeratingEvaluation.Test.LoadFiles(String path) in ...

 

What is the maximum of the capacity I can use? The ChartCollection object capacity is limited by Int32, i.e. up to 2.147.483.647.

Unfortunately I need to show many plots with many points so I need to increase the capacity so much.

 

Thank you for help.

 




Delete Custom Property

Wed, 03 Jan 2018 11:28:52 GMT2018-01-03T11:28:52Z

Hi all,

I need to remove/delete a custom property from an already existing TDMS file but seems it's not allowed, i've not found any methods to do it.

Someone here know how to fix this issue?

 

Thanks a lot in advance




IntensityGraph alternative for webforms?

Tue, 02 Jan 2018 20:14:35 GMT2018-01-02T20:14:35Z

MStudio webform controls include every type of graph (WaveformGraph, ScatterGraph, DigitalWaveformGraph, ComplexGraph) as winforms except for the IntensityGraph. We utilize this type of graph for almost every application and have inquired with NI support if this will ever be added in the future, but it remains unclear. 

 

I'm interested to see if there's any work-around or alternative to displaying intensity data in a C# web application. I've looked at a few third-party libraries but have not been able to find what I'm looking for. Any help would be much appreciated.




Thermometer Control not displaying realtime values in Winforms

Thu, 28 Dec 2017 15:57:15 GMT2017-12-28T15:57:15Z

Hi,

 

I am using a Thermometer control to display real time temperature on a winform. I am not able to display the temperature value as it changes frequently at runtime. Below is the code which I am assigning to Thermometer value property. This values keeps changing at runtime, but the Thermometer control is not displaying the changed temperature values. Though I see the value is getting updated with updated temperatures.

 

thermometer1.Value = cameraStatus.ImageSensorTemperatureThermistorInC;

 

 




How can teststand call a C# Main function with variables by teststand

Mon, 25 Dec 2017 16:03:17 GMT2017-12-25T16:03:17Z

Hey,

 

Is there any solution for teststand call C# main function with variables which configed by teststand? Because I want teststand call C# main function and let Main function return exact result by C# exe operation with user. 

 

As far as I know,C# Main function only can not input any variables format but String Arrray. I think this variables format is not easy fior user to config teststand because user cannot regonize the meaning of each variables in String Array.  If teststand can call Main function like a sub functiuon, for example, functionname (String resourcename, String CardNum), if teststand call this function, it will show each variables meaning, just like "Resourcename" and CardNum. When teststand call C# main function, user can only config the String Array in one input texbox, not easy to config. 

 

Is there any solution for this calling variables issue?

 

Thanks in advance with my appreciate.




Integrating Measurement Studio 2015 to Microsoft Visual Studio 2010

Fri, 22 Dec 2017 19:51:21 GMT2017-12-22T19:51:21Z

How does one Add the Measurement Studio Template (tab) to Visual Studio 2010?

 

I have search the internet and NI site for this particular item without success, I can only find how to add the tool box items.

 

I recently brought on a new computer to my lab and installed Visual Studio and Measurement Studio Enterprise (BW Platform Bundle - Fall 2015).  I do not remember the sequence of installation.

 

I notice that the Measurement Studio Menu (template) is not present in Visual Studio 2010.  I have no issues building my application, which was created on an older computer, and one in which the Measurement Studio Menu tab is shown.

The problem with the new computer is, without the Measurement Studio Tab, I cannot create NI-DAQmx applications, and I must create them on the older development platform.

 

I hope this information gives you enough information to help in this matter.

 

 

Regards

Craig Byrd

Automated Integrated Solutions

 

 




Memory leak in vector mode

Thu, 21 Dec 2017 10:24:08 GMT2017-12-21T10:24:08Z

Hi,

when I add plots in the "Vector" mode I see a leak in the VectorRenderTarget object.
When the app start, there are 4 instances of VectorRenderTarget. After adding plots, the number of this objects increases, and when clearing the data the number of objects is same and not decreases, and when I add plots again, the number of objects increases again.
When I switch to a "Raster" mode ,it has been resolved.

But I want to use Vector mode.

I check the memory with the VS analyze tool, attached my project.




Measuring and comparing an industrial frequency voltage

Wed, 20 Dec 2017 20:33:17 GMT2017-12-20T20:33:17Z

Hello. 

I'm pretty new at working with NI hardware, so I'm sorry if my question would seem silly for you.

 

There are some laboratory benches in our university built on NI DAQmx PCI-6024E hardware. The software provided with benches doesn't satisfy with its functionality, so I decided to develop some of mine.

One of tasks is measuring an industrial frequency voltage, getting its amplitude and current frequency. I could successfully read an AnalogWaveForm from the analoginput channel and even display it. But the trouble is that the wave on the graph is "jumping" all the time, not letting to estimate it. I think that the trouble is in the approach I use:

            public void wave(Task myTask, string channel, out AnalogSingleChannelReader Reader)
            {
                myTask = new Task();
                myTask.AIChannels.CreateVoltageChannel(channel, "",
                        (AITerminalConfiguration.Rse), -3, 3, AIVoltageUnits.Volts);
                myTask.Control(TaskAction.Verify);
                Reader = new AnalogSingleChannelReader(myTask.Stream);
            } 
        private void timer1_Tick(object sender, EventArgs e)
        {
            Wave1 = Reader[1].ReadWaveform(Convert.ToInt32(slide1.Value));
            waveformPlot2.PlotWaveform(Wave1);
        }
        private AnalogSingleChannelReader[] Reader = new AnalogSingleChannelReader[2];
        private NationalInstruments.DAQmx.Task[] myTask = new NationalInstruments.DAQmx.Task[3];
        AnalogWaveform Wave1;

Changing the number of samples with slide1 improves a situation a bit, but doesn't solve the problem.

But visual part of this task is not the most important. 

What I really have trouble with is getting the amplitude and frequency of the wave. Now I use this method to get the amplitude, but I think it's not the best and the fastest way, so I would be really happy if you proposed something better:

            public static void get_ampl(AnalogWaveform Wave, int n, double kt, out double ampl)
            {
                Array rr = Array.CreateInstance(typeof(double), n);
                Array.Copy(Wave.GetScaledData(), rr, n);
                Array.Sort(rr);
                ampl = Math.Abs(Convert.ToDouble(rr.GetValue(0))) * kt;
            }

kt is just a scale index.

Moreover, I have absolutely no idea how to deal with frequency measurement. There are a lot of examples I found that work with frequency measurement task, but my DAQ hardware doesn't support this function. I thought about some algorithm that could detect indexes of the max and min values in raw data read from the device, but couldn't make it work:

            public static void get_freq(AnalogWaveform Wave, int n, out double freq)
            {
                double a, b;
                Array rr = Array.CreateInstance(typeof(double), n);
                Array sorted = Array.CreateInstance(typeof(double), n);
                Array.Copy(Wave.GetScaledData(), rr, n);
                Array.Copy(rr, sorted, n);
                Array.Sort(sorted);
                a = Array.IndexOf(rr, sorted.GetValue(0));
                b = Array.IndexOf(rr, sorted.GetValue(n-1));
                freq = Math.Abs((a - b) / n);
            }

I will be really glad for any help.




Read/Write GPIB protocol in c#

Tue, 19 Dec 2017 14:24:27 GMT2017-12-19T14:24:27Z

Hello everyone,

I have a configuration of a system controller and two instruments connected on a GPIB bus.

Being a c# developer I'm not able to get the full extent of how exactly things needs to be done with GPIB communication. The majority of examples don't follow the full protocol of what need to be the read/write steps between a system-controller and the attached instruments.

Kindly know that the examples that come along with VISA or 488.2 drivers installation are not explicitly pointing at the order that things need to be done.

I'll be so much happy if anyone could point me at an example of how should be a GPIB discussion between the system-controller and at least two instruments. Aspects like passing the control between the entities etc. will be very much appreciated. Thanks in advance.

Oh Yes, C# of course. Thanks




WPF Tank Fill Effect

Thu, 14 Dec 2017 18:55:35 GMT2017-12-14T18:55:35Z

Two issues.

 

1. I have to use the "Fill" property to set the color of the TankDouble bar.  Where are the properties defined in the NI user documentation for the WPF Tank or TankDouble?  I do not see Fill in the list, but it obviously is the property that controls the fill color.

http://zone.ni.com/reference/en-XX/help/375857A-01/html/allmembers_t_nationalinstruments_controls_tank_1/

 

 

2. I use the following styling on a TankDouble.  I want to remove the shading effect on the tank fill.  How can I do that, i.e., what Property controls the shading?

 

 

 

Thanks!!!

 

 




Controlling multiple GPIBs in c#

Thu, 14 Dec 2017 10:17:18 GMT2017-12-14T10:17:18Z

Hi all,

I'm pretty new to GPIB communication but doing well with various programs which I'm running two instruments connected to one controller (CIC).

So I'm trying to write a program that one controller will listen to two GPIB instruments and read the message that was sent by any of the instruments.

I'm writing my code in C# (WPF actually but this is not the point).

So in my controller application I have two threads and two GPIB devices each connected to a different primary address. It looks like that:

        deviceMain = new Device(gpibBrdID, primaryAddress, secAddress);    // PAD - 1, SAD - 0
        if (deviceMain != null)
           mainPSHandle = deviceMain.Handle;
        deviceSec = new Device(gpibBrdID, primaryAddressSec, secAddress);    // PAD - 2, SAD - 0
       if (deviceSec != null)
          secPSHandle = deviceSec.Handle;

Each of the devices is reading the GPIB line for any incoming messages. Each device is in a separate thread - e.g. deviceMain.ReadString()

The point is that when a message is peaked up by lets say deviceMain device I get a GPIB exception  on the other device (deviceSec ) which also tries to read the GPIB line at the same time. I tried to synchronize the threads with locking technics but no help.

My question is - how is it possible to identify the sending device that sent a message prior using the "ReadString()" method? So if I'll know for instance from which primary address the response came I'll know from which thread to activate the "ReadString()"?

I'm really stuck with this case and will greatly appreciate any help, thanks much in advance.




Wpf Graph Binding and defining Axes and Plots only in ViewModel Invalid OperationException

Tue, 12 Dec 2017 10:50:03 GMT2017-12-12T10:50:03Z

Hi,

I am using MVVM pattern and want to create a user control which contains a graph control.

I want to bind my plots and axes as described in Wpf Graph Binding and defining Axes and Plots only in ViewModel.

Everything seems ok when there is a one user control on page.

When I want to put 2 user controls on a page GraphExtension class throws "Child is already registered with a IRenderableGraph'1 parent" exception on a synchronizer.SourceCollection = CollectionViewSource.GetDefaultView( e.NewValue ); line.

 

   // Retrieve existing synchronizer, or create a new one for the target graph. 
            var synchronizer = (CollectionViewSynchronizer)graph.GetValue( PlotsSynchronizerProperty ); 
            if( synchronizer == null ) { 
                synchronizer = new CollectionViewSynchronizer { TargetCollection = graph.Plots }; 
                graph.SetValue( PlotsSynchronizerProperty, synchronizer ); 
            } 

            // Synchronize graph's plots with new source. 
            synchronizer.SourceCollection = CollectionViewSource.GetDefaultView( e.NewValue ); 
        } 

 

How can I correct error ?

Thanks in advance

Hakan




Visa.net DLL installation

Tue, 12 Dec 2017 08:24:09 GMT2017-12-12T08:24:09Z

Hello,

 

Does existing a solution to use the visa.net dll without installation?

 

BR Christian




Internal routing DIO

Thu, 07 Dec 2017 15:21:54 GMT2017-12-07T15:21:54Z

I'm using the NI USB-6216 data acquisition device. I want to measure a frequency on an analog input channel. That part is easy. The signal is not always present so I want to start acquisition (trigger) when the first pulse arrives. I can do this using a "software trigger" but would like to simply use a reference trigger. I understand I need to use a digital pin for that. Is there a way to route the AI channel to a digital pin internally and then designate it as the reference trigger?




Reading Teststand Result in C#

Wed, 06 Dec 2017 06:32:12 GMT2017-12-06T06:32:12Z

Hi Friends,

 

I am New to Teststand, I want to reading Teststand result in C# Program.