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:
axis  code  cursor  data  double  measurement studio  measurement  net  new  plot  range  string  studio  time  xmlns schemas 
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: Sat, 18 Nov 2017 19:39:25 GMT2017-11-18T19:39:25Z

 



the cursor snaping to plot moves left automatically,in the C# program using measurement studio.

Sat, 18 Nov 2017 09:13:31 GMT2017-11-18T09:13:31Z

        when running the C# spectrum program,on the plot ,the CURSOR is  moved automatically left when the spectrum-graph waves.When the spectrum-graph doesn't wave,the cursor stop at the right fixed position .this is the question:how can I fix the cursor at the position when the spectrum-graph waves

        In the old version measurement studio,the  CWgraph has a option:snap to plot with fixed x,but at the current measurement studio,only the item:snap to plot,how can i fix the cursor at a position on the plot.




on the plot ,the CURSOR is moved automaticly left,this is the question:how can I fix the cursor at the position.

Thu, 16 Nov 2017 07:01:48 GMT2017-11-16T07:01:48Z

on the plot ,the CURSOR is  moved automaticly left,this is the question:how can I fix the cursor at the position. 

on the CWgraph,there is a option:snap to plot with fixed x,but at the current measurement studio,only the item:snap to plot,how can i fix the cursor at a position on the plot.




WPF MeterDouble RangeFill binding in DataTemplate

Wed, 15 Nov 2017 12:54:56 GMT2017-11-15T12:54:56Z

I am loading meters dynamically with an items control panel and formatting the data and style via data template.  The binding for the meter value and range works fine.    I want to highlight a range on the meter scale that works like the WinForms ScaleRangeFill.   I read for the WPF controls, this must be done with nirimitives.  I followed an example shown for a guage.   I can manually code the Baseloine RelativeOffset and RelativeLength values, but they will not bind to a property of the current object handled by the data template.  Below is my XAML.   I cannot dynamically bind the Green range shown in this screen shot.  I can only hard code the values in the XAML.   What am I missing?                       User control:                                                                         &nbs[...]



Bessel Filter code for equiv: LabView "init/cont" for filter pre conditions.

Mon, 13 Nov 2017 12:50:59 GMT2017-11-13T12:50:59Z

Meas.Studio 10: looking for equiv code that's emulates the "init/cont" (T/F) setting in LabView for setting initial conditions or past filter condition for a Bessel Filter application.




Too long runtime on AnalogMultiChannelReader.ReadMultiSample with NationalInstruments

Wed, 08 Nov 2017 12:42:01 GMT2017-11-08T12:42:01Z

When I use this method ReadMultiSample in ReadCcv and ReadOcv its take more then a second of run time. I think its too long What can I do to make it run faster?       My controller class class Controller { public AnalogMultiChannelReader reader; public bool TaskIsRunning { get; set; } public double Current_ { get; set; } public double dTime_ { get; set; } public Single Ocv_ { get; set; } public Single Ccv_ { get; set; } public long OcvtaskHandle { get; set; } private MessageBasedSession mbSession; Task CcvTask; Task OcvTask; ~Controller() { CcvTask.Dispose(); OcvTask.Dispose(); } public Controller() { CcvTask = null; OcvTask = null; } public double ReadCcv() { // Create a new task double frequency = 50000; double TimePerPoint = (1 / frequency); int numSampsPerChannel = (int)((dTime_ / 1000.0) * frequency) + 95; if (CcvTask == null) { InitLoad(); // Initialize Local Variables double rangeMinimum = Convert.ToDouble(GlobalVariables.rangeMinVolt); double rangeMaximum = Convert.ToDouble(GlobalVariables.rangeMaxVolt); CcvTask = new Task(); CcvTask.AIChannels.CreateVoltageChannel(GlobalVariables.voltageSorceInput, "", (AITerminalConfiguration)(-1), rangeMinimum, rangeMaximum, AIVoltageUnits.Volts); CcvTask.Timing.ConfigureSampleClock("", frequency, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, numSampsPerChannel); CcvTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(GlobalVariables.triggerSorcePort, DigitalEdgeStartTriggerEdge.Rising);// ReferenceTrigger.ConfigureDigitalEdgeTrigger( CcvTask.Control(TaskAction.Verify); } try { AnalogMultiChannelReader reader = new AnalogMultiChannelReader(CcvTask.Stream); SendSCPI("PROG:STAT RUN"); double[,] x = reader.ReadMultiSample(numSampsPerChannel); string res = ""; return x[0, numSampsPerChannel - 90]; } catch (DaqException exception) { //startButton.Enabled = true; //myTask.Dispose(); throw exception; } } public bool GetFootSwitch(){ Task myTask = new NationalInstruments.DAQmx.Task(); myTask.DIChannels.CreateChannel(GlobalVariables.footSwitchPort, "FootSwitch",ChannelLineGrouping.OneChannelForEachLine); DigitalSingleChannelReader reader = new DigitalSingleChannelReader(myTask.Stream); bool val = reader.ReadSingleSampleMultiLine().First(); return val; } public void BeepOk(int Periode=600){ Task myTask = new Task(); myTask.DOChannels.CreateChannel(GlobalVariables.beepPort, "beep",ChannelLineGrouping.OneChannelForAllLines); DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(myTask.Stream); writer.WriteSingleSampleMultiLine(true, new bool[]{true}); Thread.Sleep(Periode); writer.WriteSingleSampleMultiLine(true, new bool[]{false}); } public double ReadOcv() { int numSampsPerChannel = 1000; int numChannels = 1; List data = new List(); double rangeMinimum = Convert.ToDouble(GlobalVariables.rangeMinVolt); double rangeMaximum = Convert.ToDouble(GlobalVariables.rangeMaxVolt); string x = ""; int arraySizeInSamps = numSampsPerChannel * numChannels; if (OcvTask == null) { OcvTask = new Task(); OcvTask.AIChannels.CreateVoltageChannel(GlobalVariables.voltageSorceInput, "", (AITerminalConfiguration)(-1), rangeMinimum, rangeMaximum, AIVoltageUnits.Volts); OcvTask.Timing.ConfigureSampleClock("", numSampsPerChannel, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 101); data = new List(arraySizeInSamps - 1); } AnalogSingleChannelReader r = new AnalogSingleChannelReader(OcvTask.Stream); data = r.ReadMultiSample(numSampsPerChannel).ToList(); return data.Average(); } private void SendSCPI(string text) { mbSession.BeginWrite(text + "\n"); } public void InitLoad() { ResourceManager rmSession = ResourceManager.GetLocalManager(); mbSession = (UsbSession)rmSession.Open("USB0::0x0B3E::0x1004::ND002613::0::INSTR", AccessModes.NoLock, 10000); SendSCPI("PROG:FSP:END 10"); SendSCPI("PROG:FSP:TIME 0.0001"); SendSCPI("PROG:NAME 11"); for (int j = 1; j <= 10; j++) { Thread.[...]



Distribution: Pre Requisites for Target Machine.

Wed, 08 Nov 2017 09:46:59 GMT2017-11-08T09:46:59Z

Hi, I am new to Measurement Studio.

For development machine i will be installing MStudio,

but for the target machine (end user), just installing .Net will suffice?

 

Target Platforms (Win 7 and Win 10)




Reading flatten string from Network Variable

Tue, 07 Nov 2017 10:04:26 GMT2017-11-07T10:04:26Z

We have some RT targets writing cluster data to a Network Variable on a Windows machine. The variable type is string. Data is written using "Flatten To String". Everything worked fine when reading the variable and unflatten the value in Labview.

 

Now, we tried the read task from Measurement Studio .NET. Unfortunately, the NetworkVariableReader always returns an empty string. I'm afraid that marshalling the "binary ANSI string" is not supported. I can't find any limitations for strings in the Measurement Studio docs. Furthermore, passing a flatten string through a Labview .NET Interop Assembly works in both ways.

 

Final question: How do I read a flatten string from a Network Variable in .NET? Refactoring RT code is not possible.




ni:Plot Label string format

Thu, 02 Nov 2017 00:28:49 GMT2017-11-02T00:28:49Z

Hello,

I'm trying to format string for some of my plots using the standard WPF...

This does nothing:

And this way doesn't compile:

ContentStringFormat

 Please let me know if it's possible.

Thank you!




Deployement of .Net Application issues

Mon, 30 Oct 2017 10:21:16 GMT2017-10-30T10:21:16Z

Hello,

 

I'm using Measurement Studio 2015 in my Visual Studio 2013 .NET applications.

 

I've already used NationalInstrument.UI.WindowsForms with the Graphics, scattergraph,.... without problem.

 

But now I'm using the Analysis assembly.

 

When I deploy my software on other pc, I've an error on nianlys.dll missing. When I put this file in my exe folder, same error.

 

Can you help me please ?

 

Thank you.

Flow.




Mark Axis

Sun, 29 Oct 2017 10:56:05 GMT2017-10-29T10:56:05Z

Hi,(image)

I want cursor (or annotation or something else) that mark the area marked in yellow. 

I mean,The triangle will be on the scale (axis double) and not within the plot area, is there something similar? 

 

 

 




PXI 8464 .NET communication example

Sun, 29 Oct 2017 10:42:09 GMT2017-10-29T10:42:09Z

Hey,

 

I have a PXI 8464 communication function card, but I do not how can I control it to send or receive CAN message, is there any example or package file about CAN driver which can indicate it?

 

Thanks in advance




MultiPlotCursor value formatting in C# code

Thu, 26 Oct 2017 11:59:16 GMT2017-10-26T11:59:16Z

How to change MultiPlotCursor value format in C# code?

thanks

Theo




Network variable timestamp

Thu, 26 Oct 2017 05:43:45 GMT2017-10-26T05:43:45Z

Hello,

 

when I write Data with an NetworkVariableBufferedWriter with an sleep from 2ms I get the data with an NetworkVariableBufferedSubscriber with 5 identical timestamps. My variable has an buffer of 50. I am using Mesurementstudio 2015.

 

NetworkVariableBufferedWriter _bufferedWriter = new NetworkVariableBufferedWriter<bool>(NetworkVariableLocation);

int phase = 0;

for (int i = 0; i < 10; i++)

{

 _bufferedWriter.WriteValue(phase % 2 == 0 ? true : false);

 Thread.Sleep(2);

 phase++;

}

 I have also tried with an NetworkvariableWriter and set the FlushOnWrite property true but I got only every 10ms a new timestamp and 5 values have the same timestamp.

 

Best regards

 

Gerald

 




Change X-Axis value for specific plot on demand?

Wed, 25 Oct 2017 14:55:57 GMT2017-10-25T14:55:57Z

Suppose I have two arrays of doubles to plot, plot1 has 1000 samples with sampling rate at 1KHz, while plot2 has same number of samples with sampling rate at 10KHz.  Two plots will share same X-Axis, and X-axis should show time based information. One way to convert X-Axis to be time based is to use ValueFormatter approach .

 

Snippet

protected override string FormatCore<TData>(TData value, ValuePresenterArgs args)
{
    double dValue;
 
    try
    {
        // Try to covert axis value to a double
        dValue = Convert.ToDouble(value);
 
        switch (AxisValueType)
        {
            case AxisValueTypeEnum.Time:
                // Convert value to corresponding time
                if (_deltaT > 0)
                {
                    dValue = _deltaT * dValue + _offsetT;
                    return string.Format(EngineeringFormatInfo.Default, "{0:s2's'}", dValue);
                }
                else
                {
                    return base.FormatCore<TData>(value, args);
                }
 

This works perfectly if there is only one plot or plots having same sampling rate. In the case mentioned above, only the later renderred plot will have right time info on x-axis. 

  1. first plot plot1, x-axis time range will be 0mS to 1s
  2. then plot plot2, x-axis time range now become 0mS to 100mS. This looks good for plot2, but wrong for plot1.

One way to address this is to use scatter plot to provide time based data. However, it seems that scatter plot  is mush slower. Are there any other solutions?

 

Thanks!

 

 




.NET DAQmx.dll seen as native in Unity3D

Wed, 25 Oct 2017 07:30:46 GMT2017-10-25T07:30:46Z

The purpose of the hardware here is to connect buttons, joystick, switches etc. to it and then to read it out by using the API and turning the channel values into parameters that can be used in de simulation. Basicly the point is to make a custom controller for unity3D. But i have the following problem with trying to use NI hardware as I/O.

 

If the NationalInstruments.DAQmx.dll gets imported into Unity3D it is recognized as a type Native .dll and not a .NET .dll which it should be. Because of this it wont be added to the references what results in the namespace name not existing.

 

Does anyone know if there is a way to resolve this?

 

Greetings,

 

Tekakato




Interval mode hide the edge values

Tue, 24 Oct 2017 09:24:26 GMT2017-10-24T09:24:26Z

I have a graph whose Y axis shows the axis in multiples of 30, 60, or 90, etc. [project attached]
I use a dynamic interval mode by a converter.

When the edge values are in multiples the graph is displayed well, but when they are not multiples they are not displayed.

For example, when the minimum is 10 and the maximum is 100, it is presented as follows:

 

(image)

 

I would like the edge values to be displayed anyway, and the values in the middle will relate to the rule.
In the example I would expect to be displayed 10 then 30 - 60 - 90 - 100.
How can I do this?




Playback Skipping

Mon, 23 Oct 2017 17:29:56 GMT2017-10-23T17:29:56Z

I've written a playback system in C# that uses multi-threading to support a producer/consumer streaming architecture. The producer thread reads complex (IQ) samples from a RAID and passes them into a concurrent queue.  The consumer thread takes the data out of the queue and then writes it to the NI-5673 waveform buffer.

 

The issue I am having is that, once the RFSG has played the data that was initially loaded into the waveform buffer, the RF stream out of the module seems to increase rapidly.  I see this issue with both my own code and NI’s example called “ArbitraryWaveformStreaming.2010,” which is downloaded with RFSG-16 .NET 4.0 support.  I’ve come to this conclusion after recording a CW tone at a certain frequency for 10 seconds, then increasing the frequency by 100kHz.  I repeated this process for the entire recording of 2min at 5MHz bandwidth.  Given the amount of memory I chose to allocate for the waveform in the 5673, I calculated that it should take about 21 seconds for the initial waveform load to play.  During this time more data would have been added to the buffer so that no underflow could occur.  I observed that, at the end of the approx. 21 seconds indicating the end of the initial buffer load, the CW tones jumped in rapid succession to the final frequency that I had recorded.  Every tone was seen, but not for the expected 10 seconds. The recording then finished playing with the CW tone held at the final recorded frequency for the remaining ~90 seconds.  The NI example was slightly more behaved in that it did not make as many successive jumps, but play was still not smooth and still occurred for the first time after the initial buffer load had been played.

 

Any ideas as to why the skipping is occurring?




Possible to know the undo zoom/pan count

Mon, 23 Oct 2017 05:48:23 GMT2017-10-23T05:48:23Z

Whenever user performs zoom, pan or axis range changes on WPF graph, the actions are remembered by graph. Calling UndoZoomPan() will bring graph display to previous state. Is there a way to know the undo count, so undo zoom context menu item (user code) can be enabled or disabled accordingly?




measurement studio run for VS2008 in XP operation system

Sun, 22 Oct 2017 17:16:56 GMT2017-10-22T17:16:56Z

Hi,

 

i have a PXI computer with XP operation system, it it possible for measurement studio run with visual studio 2008 in XP system?

 

many thanks in advance.

 

best regards




500 MicroSecond Pulse

Wed, 18 Oct 2017 19:45:15 GMT2017-10-18T19:45:15Z

Hello everyone,

I am using NI usb-6003 and C# programming. I need to activate two digital line (p0/line0 and P0/line1) synchronously, and remain active 500 microsecond for the first one and 12 second for the other one. I couldn't do that with software because of the accuracy. I was wondering if anyone know how I can do it with the hardware using C#.