Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all 1999 articles
Browse latest View live

hardware timing of digital outputs

$
0
0

Hi Folks

 

I am cimpletely new to DAQmx and am struggling to come up to speed.  I am using a NI PCIe-6353 card in my device.  My programming environment in Visual Studio 2015 using Visial Basic with .NET 4.5.1.  I am not using Measurement Studio, just calling the .NET api directly from my code.

 

I have a set of 6 LED's that are attached to 6 of the digital output ports on this card.  I have been able to sucessfully turn the LED's on/off, but now I want to send PWM pulses to the LED's and control the duty cycle to change the intensity of the LEDs.  I know there is some way to use the internal counters on the card to generate a PWM pulse stream, and then use that pulse stream to somehow change the output to the digital lines, but I hnoestly don't have a clue about how to make that work.  I've search through the examples on my system. but noine of them show how to drive a digital output from a timer.

 

Can anybody give me some example code that can point me in the right diection?

 

Thanks

 

- Mike

 

 


Creating Multiple Waveform Graphs with Matching Plot Areas

$
0
0

Is it possible to create multiple waveform graphs with matching plot areas according to https://decibel.ni.com/content/docs/DOC-22665 with Measurement Studio and C#?

 

I found the .Graph1.PlotAreaBounds.X - property, but how can it prevent from changing, when different major division labels lengths are printed?

 

Thank you.

WPF NumericTextBoxDouble FontSize and AxisDouble exponential numeric format

$
0
0

Hi!

 

1.) How can I change the font size of NumericTextBoxDouble?

 

I use this code: 

 

<ni:NumericTextBoxDouble InteractionMode="ReadOnly" Height="50" Width="100" TextAlignment="Center" Value="999.999" FontSize="40"/>

 

but font size remain approximately 10-12 pixel.

Why?

 

 

2.) How can I disable the scientific (exponential) numeric format of the AxisDouble on WPF Graph?

 

Regards,

Tamas

 

 

P.S.: I use VisualStudio 2013 Community and MS 2015 Standard

NITask State

$
0
0

Hi Guys,

I have an issue with NITasks and assessing their state.

Part of my program involves stopping/aborting a task in order to regenerate an output signal and restart the task.

The issue is that after calling analogOutTask.Control(TaskAction.Stop); or analogOutTask.Control(TaskAction.Abort); I am unable to check if the task state. So when I try to write the new samples to the task, I sometimes get a DAQmx.DaqException as the Task is currently in the process of being aborted. 

How do I query the state? Or is there a callback for state change?

Thanks

What is Range IOpComparison argument for?

$
0
0

There are 2 overloads for Range but I can't find any examples on the 3rd argument - IOpComparison.

 

Could you please point me to some example or perhaps provide one... Curious what it does.

 

Thanks!

Is it possible to add Range type to XML config file?

$
0
0

Basically I have the standard XML configuration file for my app with lots of settings.

I'd like to add Range settings to it but not sure if possible to do it as one element.

Is it possible?  I tried this but it didn't work.  Thanks!

 

 

<MyGraphRange>0,20</MyGraphRange>

// In code
public Range<double> MyGraphRange;

 

Hide & Show axes with BaselineStrokeThickness=0

$
0
0

Hey,

In my project I want to hide / show the Y axis, It works usually.

But when BaselineStrokeThickness is 0 and TickVisibility of the MinorDivisons is collapsed, I am able to hide the Y axis but can not re-present it.

I attach a project, for example.

Plotting multiple line graphs with legend

$
0
0

Hi all,

I'm relatively new to WPF and trying to plot multiple (x,y)-lines in a ni:Graph control.

As datasource for the graph control I'm using

ObservableCollection<Point[]> plotData = new ObservableCollection<Point[]>();

and assigning this to my graph's datasource

tandGraph.DataSource = plotData;

As plotData changes during runtime, I get new (multiple) line plots (fine so far). I have the legend bound to the plots in xaml:

<ni:Legend ItemsSource="{Binding AllPlots, ElementName=tandGraph}"

Now the legend shows something like "Plot1; Plot2; etc." but I would like to specify the plotnames manually. I did plotting/charting in Matlab and Labview, but I don't seem to get how I could specify all the important things like LineStyle, Color, (or even "UserData" for some custom information) etc. in WPF as I would do it in Matlab:

plot(X,Y,LineSpec)

Sorry, I know that maybe I'm talking about two entirely different programming worlds, but I would really like to try this in WPF. I also know, I could define (a fixed number of plots) via xaml, but the number of plots changes during runtime. How would this usually be done? Can anybody help me?

Thanks in advance

Greetings


Save an image in .NET

$
0
0

I am completely new to .NET programming, zero experience, and I currently don't want to get into any deep programming with it. That said I have been thrown into the world of .NET by the need to use a camera which uses it in LabView. 

What I'm looking to do is save an image from the picture box. The image below shows the error I'm running into, error 1172. Looking this up I get information about my registry files, do a disk clean up, and need to clear out my temporary folders and what not. Further searching lead to some people talking about trust levels and needing a rank of 8 to work properly and that comepletely confuzzled me.

The software and VI packages that build up the VI that I'm using can be found at: http://www.ids-imaging.com/go/edmund/

From the attached image the vi that I'm using is uEye_SimpleLive.vi. I do see the documentation on the website I've linked and I've had a look at the LabView .NET documentation which has provided absolutely no use. It did mention that you should close off the .NET reference after it's been used to save memory however I don't fully understand why.

I appreciate any advice that you care to share as currently the only thing working in this is the creation of a .bmp file shell.

Unable to find module dependency with signature 'Microsoft_VC110_CRT_x86.F9D0B380_EB85_31D4_96AC_C6CB40086A55'

$
0
0

Hi there,


I get the above error from the Visual Studio installer caused by the following merge modules, having a dependency to the Microsoft_VC110_CRT_X86 merge module:
    nimodularinstrumentscommon.2012.msm
    nimodularinstrumentssystem.2012.msm
    ninetscope.fx45.msm

The Microsoft_VC110_CRT_X86 merge module is installed on the system, but it has the wrong signature.

Where can I get the merge module with the right signature? Or is there an other solution?

 

Regards from Berlin

 

Chris

 


Environment:
    Windows 7 Professional
    Visual Studio Professional 2013 Update 5
    Measurement Studio 2015 Professional
    Visual Studio Installer Extension

References:
    .NET Framework 4.5
    Ivi.Driver
    Ivi.Visa
    NationalInstruments.Analysis.Professional
    NationalInstruments.Common
    NationalInstruments.DAQmx
    NationalInstruments.ModularInstruments.Common
    NationalInstruments.ModularInstruments.ModularInstrumentsSystem
    NationalInstruments.ModularInstruments.NIScope.Fx45
    NationalInstruments.UI
    NationalInstruments.UI.WindowsForms
    NationalInstruments.Visa

TypeInitilizationException when Using NationalInstruments.Analysis

$
0
0

Hi everyone I could use some help

 

I am getting the following exception when I run my program

 

Exception thrown: 'System.TypeInitializationException' in SerialDacq.exe

Additional information: The type initializer for 'NationalInstruments.Analysis.Dsp.SymmetricWindow' threw an exception.

 

I am currently using the evaluation version of Measurement Studio and can't figure out where to go from here

 

Help would be appreciated Thanks!

Finding VISA Resources of Instruments connected with LAN

$
0
0

Hi,

 

I'm trying to search and find all instruments that are plugged to my PC and connected to the same network (with LAN).

 

Using:

ResourceManager.GetLocalManager().FindResources( "?*" );

Works great in finding all connected instruments.

 

Is there a way to find all instruments that are in the network?

I'm not sure if I need to use GetRemoteManager and how to use it.

 

Any help would be great.

 

Regards,

 

Dov.

daqMX API

$
0
0

I am working on a project where I need to use C# to both write a waveform (could be sinusoidal, square, etc.) on one of the analog out channels and then read the waveform on one of the analog in channels and for certain monetary reasons (I'm just a student) I cannot really afford to buy MeasurementStudio.  

 

So, is anyone aware of a fully documented API for the DAQ-MX C# plugins?  I've looked around a fair amount and cannot really find anything.  

SCPI Commands and Variables

$
0
0

Good morning, 

 

I'm writing some software where I need to test 58 switches at 35 different states (decimal 0 to decimal 34).  Rather than write the commands to set the state the port value over and over again for each switch, is it possible to use a for loop to change the decimal value (0) in the below section of code to 1, 2,3 and so on?  I haven't found any way to  insert a changing variable into a SCPI command.  

    Private Sub btnSwitchTest_Click(sender As Object, e As EventArgs) Handles btnSwitchTest.Click
        Dim Port As Integer

        DAQ = li.ibdev(0, 9, NO_SECONDARY_ADDR, TIMEOUT, EOTMODE, EOSMODE) '''''GPIB addressing.  

        For Port = 0 To 34

            '''sets all switches to 0
            wrtbuf = "SOUR:DIG:DATA:BYTE 0, (@201)" '---->>>> the 0 is the variable that I want to change.
            li.ilwrt(DAQ, wrtbuf, Len(wrtbuf))
            System.Threading.Thread.Sleep(1000)

            '''record voltages here/havent written this code yet.

Next Port

Any suggestions would be great!  

Thanks!

 

LogarithmBase10 not working properly

$
0
0

I replace ni WIN graph in WPF graph.

I use in LogarithmBase10 in some graphs (you can see it in the example project).

 

When the range start from 0 it's OK, but if I change the range to another number (70
for example) the divisions are not displayed properly [The divisions are overcrowded].

 

You can change the range and sometimes it's overcrowded and sometimes it's OK (depending on the start number).

 

Capture.PNG

 

I must say: in WIN graph it does not happen.

 


Formating waveform for graphing in c#

$
0
0

Hello,

I am not familiar with C# but I need to build a waveform of array of samples with known sample interval (dt) and start date/time (t0).I have managed to plot the array eith the PlotY method. I even managed to initializa a waveform of the samples but am not able to comprehend how to put dt and t0 in the wavefot. The classes are too much of a complication to me.

Following works so far but with not proper timing:

--------------------

AnalogWaveform<double> waveform = new AnalogWaveform<double>(0);
waveform.Append(AnalogWaveform<double>.FromArray1D(probna));
waveform.Timing = WaveformTiming.CreateWithRegularInterval(TimeSpan.FromSeconds(10));
        
graph1.PlotWaveform<double>(waveform, new AnalogWaveformPlotOptions(AnalogWaveformPlotDisplayMode.Time, AnalogWaveformPlotScaleMode.Raw));

--------------------

SInce there a re (surprisingly) no examples in the MeasurementStudio help, I would appreciate if somebody can write the code lines for building a waveform with proper timing of the samples array and plotting it.

 

Thanks in advance,

FFT of a Waveform in C#

$
0
0

Hello,

 

I have a Waveform and I need to perform a FFT and plot its Magnitude. Since I have absolutely no previous experience with C# I have a difficult time tracking methods and data types through the forest of NI classes.

 

I would appreciate if someone can help me with my situation:

----------------------

SIgnal[] is the array of samples...

Waveform is SIgnal bundled with dt and t0...

FFT method in Transforms class insists on ComplexDouble input and I don'y know how to convert my SIgnal[doubles] into ComplexDouble...

If (unlike in LV) I cannot perform FFT of a waveform what is the resulting df between smaples of the resulting array? - Is it just 1/dt? What is the notion of df with respect to dt?...

Any issues with graphing spectrum (FFT)?...

----------------------

PS: I am trying to graph on a web form!

 

Thanks in advance,

Need Developer Guide & .Net API for Anritsu MT8820C

$
0
0

Hi All,

 

I am new to Anritsu Instruments. I am looking for Anritsu MT8820C Developer Guide and if possible its .NET APIs?

How can I find them?

 

Regards,

Ashish

Help Installing .NET Framework 3.5 Languages when Framework 4.6.1 is previously installed

$
0
0

I'm trying to install NI-DAQmx 8.8 for another software program. Because NI-DAQmx 8.8 requires .net framework 3.5, I've been trying to install .NET framework 3.5.  However, I wasn't able to do it.  Can anyone tell me how to resolve this issue?

 

Thanks in  advance!

 

Analog input channel calibration

$
0
0

Hi, I have in MAX created Analog Input channel and now I would like calibrate this channel with using C#. Manually in MAX it works well but I have no idea which lib and methods use in C#. Can you show me some elementary example or documentation?

 

P.S. Sorry for my English

Viewing all 1999 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>