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

Measurement Studio for C# language

$
0
0
Recentely, I am trying to edit C# language to control the National Instruments Cards in computer, did any one has data about it? Any help will be appreciated.

NI Application Crashing and Measurement Studio Installer Builder Question

$
0
0

Hello,

 

We've built an application using Measurement Studio, NI DAQ USB-6281 and, c# with Visual Studio 2010. the development box has Windows 7 and Our target system is Windows 7 embedded.

 

We're attempting to move our application to the target box from our development box. However, upon launching our created application (from an EXE release) on the target box application crashes. This is due to an unhandled exception. It appears the target machine does not have all NI libraries or drivers and crashes when attempting to create objects designed to communicate with the DAQ.

 

Thus we've attempted to use Measurement Studio Installer Builder but, it's still crashing on the target box. I have a suspicion we are not using the Installer Builder correctly. Can you provide any ideas (common errors) on what might be going wrong?

 

Thanks,

Jeff

Plotting Multiple Datatypes

$
0
0

Hi,

 

I have made a graph and I want to plot multiple different types of data. Right now, i have a custom point class, let's call it CustomClass and I am converting everything to the CustomClass before it is plotted, but it would be faster to directly plot some data.

 

ie, I am given some data:

double[] firstPlot;

double[] secondPlot;

List<CustomClass> thirdPlot;

 

Right now, I loop through firstPlot and secondPlot and convert each of them into a List<CustomClass>. (I also want to add an arbitrary amount of double[] arrays) Then I eventually plot List<List<CustomClass>> by binding it to the datasource. (This part is working but the looping takes too long)

 

Is there some sort of collection where I can place multiple different types of data and plot that? 

 

Thanks,

Kelly

WPF Graph - exception in NationalInstruments.Common.dll

$
0
0

Hello.

I am using NI Graphs in my WPF application. The graphs are binded to ChartCollection<DateTime, double>. The application is appending every 1s the new point to the chart collection. The graphs are automatically refreshing and showing curves, but after some period (seems it is random period) the application sometimes stop with following exception:

 

A first chance exception of type 'System.ObjectDisposedException' occurred in NationalInstruments.Common.dll
An unhandled exception of type 'System.ObjectDisposedException' occurred in NationalInstruments.Common.dll
Additional information: The data store was modified.

 

2017-08-14_09h40_58.png

 2017-08-14_10h46_59.png

 

Here is graph XAML code:

 <Grid Grid.Column="2" Grid.Row="0" Grid.RowSpan="{Binding Path=testVoltageDropMeasurement, UpdateSourceTrigger=PropertyChanged, Mode=OneWay, Converter={StaticResource b2num2}}">
                                <ni:Graph x:Name="graph_temperatures" PreferIndexData="False" RenderMode="Raster">
                                    <ni:Graph.Axes>
                                        <ni:AxisDateTime Orientation="Horizontal"/>
                                        <ni:AxisDouble Label="Temperature [°C]" Orientation="Vertical" Range="0, 100, System.Double"/>
                                    </ni:Graph.Axes>
                                </ni:Graph>
                            </Grid>

 

Binding to ChartColletion is done programmatically only ones in the software:

// update graph data sources according to assigned channels
            graph_temperatures.Data.Clear(); // clear all data
            graph_temperatures.Plots.Clear(); // clear all plots
            if ((this.Test.temperatures != null) && (this.Test.temperatures.Count > 0))
            {
                for (int i = 0; i < this.Test.temperatures.Count; i++) // add plots for assigned channels
                {
                    graph_temperatures.Data[i] = this.Test.temperatures[i].values;
                    Plot p = new Plot();
                    LinePlotRenderer lpr = new LinePlotRenderer();
                    lpr.Stroke = (Brush)(new BrushConverter()).ConvertFromString(this.Test.temperatures[i].channelColor);
                    p.Renderer = lpr;
                    p.DataContext = this.Test.temperatures[i];
                    Binding b = new Binding()
                    {
                        Path = new PropertyPath("showed"),
                        Source = this.Test.temperatures[i],
                        Converter = new BooleanToVisibilityConverter()
                    };
                    p.SetBinding(Plot.VisibilityProperty, b);
                    graph_temperatures.Plots.Add(p);
                }
            }

 

See graphs in application:

2017-08-14_11h11_50.png

When I disable drawing of all channels (all show checkboxes are unchecked) the application is running well without any exception. I think the problem have to be in graphs controls.

Could you help me please to solve it?

 

Thank you for support.

Is this supported?

$
0
0

Hello,

 

We've built an application using Measurement Studio, NI DAQ USB-6281 and, c# with Visual Studio 2010 under Windows 7 Pro.

 

Our target box is WES7. Is this supported? 

 

Thanks,

Jeff

function to read PXI-6515 DIO data

$
0
0

Hey,

 

Could anyone tell me what function could read the DI data in the PXI-6515 Card? For I could like to read / write High / Low Voltage SIgnal on the Card, just like "devicename.readChannel(vhannel name)".

 

Any help or suggestion will be appreciated. I hope some examples could help me.

 

Thanks

Is UWP or dotnetcore dlls supported?

$
0
0

Hi,

Is it possible to import UWP or dotnetcore dll into LabVIEW projects? I am currently using LabVIEW 2015.

 

Reading TDMS scaling values

$
0
0

Hello,

   I'm using Measurement Studio .Net in C# to save data from a NI USB-6210 to a TDMS format file. I am scaling the data with a LinearScale:

LinearScale scaleTest = new LinearScale("Test", 11, 2);
scaleTest.PreScaledUnits = ScalePreScaledUnits.Volts;
scaleTest.ScaledUnits = "N";

I set up a NationalInstruments.DAQmx.Task task and create a voltage channel:

task.AIChannels.CreateVoltageChannel(0,"TestChannel",AITerminalConfiguration.Rse, 0, 10, "Test");
task.Timing.ConfigureSampleClock("", 1000, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);
task.ConfigureLogging("TestFile", TdmsLoggingOperation.OpenOrCreate, LoggingMode.LogAndRead, "Test");

all of which as far as I can tell works fine and I get the expected data in a TDMS file format which I can view in Diadem. The problem is that I can't find the values that have been used for scaling and offset in the metadata.

I'm looking at the Measurement Studio 2015 Support document (.chm format) and find on the page "Properties Autogenerated by the TDMS Library":

Scaling Properties

When you use NI-DAQmx to stream raw data and scaling information into TDMS files or the LabVIEW TDMS Create Scaling Information node to create customized scaling information, the following properties are created.

 

and then a list which includes the properties I am after, Linear_Slope and Linear_Y_Intercept. Does anyone know how I can retrieve this information from my file?

 

   Thanks,

          Tim


[C#] Getting the maximum number of physical channels of a device

$
0
0

Hello all,

 

Is there a way to get the maximum number of physical channels (analog in/out, digital in/out) of a connected device?

 

I have a couple of USB DAQs, one has 4 differential Analog Outputs, the other has 40 differential analog outputs.  I want the ability to make some decisions based on their analog output counts.  Is there a property somewhere in the measurement studio C# library I can use?

 

Thanks,

Joe

unable to find module dependency with signature - NIMesaDLL

$
0
0

This issue seems unlike other "unable to find module depency" topics in the forum.


I'm using Visual Studio 2010,  Measurement Studio 2010 SP1.  I'm trying to deploy a project built with the setup wizard.  More precisely, I've been deploying it for a few versions now.   It works fine on most computers, but I'm wondering if these warnings are the root of the problem a few users have reported (controls not displaying, timer running very slowly)

 

This warning appears three times when I build my project:

Unable to find module dependency with signature 'NIMesaDLL.6FE8CEDD_964F_47A2_8F23_5A607953B235'  

 

Scrolling through the list of detected dependencies, I can't find anything matching this signature.  I'm only using UI

controls in my application -- no data acquisition calls, for example.

 

I get the same warning if I create a blank project (no controls on the form, no code except what Visual Studio creates, but including the NI Windows Forms & User Interface Library as part of the project.   No such warning if I don't include the NI Library.

 

a) Is it safe to simply ignore the warnings?

b) If not, how can I make them go away?

 

NI 4070 function card measures current above 10A

$
0
0

Hey,

 

Recently I try to measure a current which is about 10A, but I feel worry because my NI driver NI 4070 could only measures the current which is below 1A, as the spec said. Is there any solution to investigate this issue?

 

Thanks in advance if there is any discussion or good idea about this topic.

An observable collection cannot be modified during a change event

$
0
0

When I am plotting some points on a graph, I use a few of the graph's events to modify the input, so after the data has been processed and the renderer has been run, I want to re-assign the the graph to the modified data. In the dataprocessed event, I am calling graph.Data[0] = someList; It then throws this error: An observable collection cannot be modified during a change event. Does anyone know how to get around this? Is there another event that I can be firing that is not a change event where I can change the collection and therefore refresh the graph?

 

Thanks,

Kelly

How to get RenderGraphCore to be called

$
0
0

Hi,

 

I am having trouble refreshing the data in my graph. It looks like whenever

graph.Plots[i].Renderer = someRenderer;

or when

graph.Data[i] = someListOfData;

or

graph.Refresh();

is called, the method called RenderGraphCore should be called to rerender the data. My problem is that this is not always true. I am calling graph.Data[i] = someListOfData; twice and the first time I step through the program, it looks like it is getting to RenderGraphCore, the second time, I am modifying the list and then using the same line: graph.Data[i] = someListOfData; and RenderGraphCore is not being called. Is there some explanation of when RenderGraphCore gets fired or why RenderGraphCore isn't being called the second time?

 

Thanks,
Kelly

[C#] Pulse Counting, maximum rate and settings

$
0
0

Hello,

 

I'm counting pulses in a C# program. The pulse rate varies between some kHz and up to 50 MHz. What is the upper limit for the count rate and can I influence it with settings?

 

Thanks,

Ben

C# IIviDCPwr . How to track compliance message (QueryInCompliance)?

$
0
0

Good day.

Would you please help me with tracking compliance message (overvoltage error) with my PXI-4112?

"Outputs["0"].QueryState(OutputState.OverVoltage)" doesn't work. It works only with OVPEnabled on and doesn't supported with 4112.

 

In classic NI-DCPower it used to use "Measurement.QueryInCompliance(ChannelName)" and it's work great, bool value is always available! But in current project I should use IVI wrapper.

 

So, is any idea to call function like "QueryInCompliance" using IIviDCPwr?


Get Axis Interval in Auto Mode

$
0
0

Hello,

 

I am making a graph where the axes' MajorDivisions.Mode is Auto. How do I get the number of tick marks that have been produced on the axes when the graph is filled with data and loaded?

 

Thanks,

Kelly

WPF Graph - format of AxisDateTime

$
0
0

Hello.

I am using NI Graphs in my WPF application. The graphs are binded to ChartCollection <TimeSpan, double>. Here is my graph XAML code and the picture:

 

<ni:Graph x:Name="graph_temperatures" PreferIndexData="False" RenderMode="Raster">
     <ni:Graph.Axes>
          <ni:AxisDateTime Orientation="Horizontal"/>
          <ni:AxisDouble Label="Temperature [°C]" Orientation="Vertical" Range="0, 100, System.Double"/>
     </ni:Graph.Axes>

</ni:Graph>

 

2017-08-29_09h48_33.png

 

And I would like to change default format of datetime axis to be like this: "hh:mm:ss". How can I easily do it please?

Thank you for support.

Jakub

Problem with DaqMx

$
0
0

Hello,

 

This is clearly not my field of specialty and I am not even sure I am posting in the right section. I am a physicist using NI cards to generate ouput for an experiment my team is working on. I am using Cicero Word Generator to control the cards, when I run the program I get the following error:

 

 

" System.BadImageFormatException: Could not load file or assembly 'NationalInstruments.DAQmx, Version=9.3.35.219, Culture=neutral, PublicKeyToken=18cbae0f9955702a' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'NationalInstruments.DAQmx, Version=9.3.35.219, Culture=neutral, PublicKeyToken=18cbae0f9955702a'
at AtticusServer.ServerSettings..ctor()
at AtticusServer.AtticusServer.Main() in C:\Users\Aviv Keshet\Documents\Software\Cicero-Word-Generator\AtticusServer\AtticusServer.cs:line 67

 

In the installation guide the creator of this tool says:

 

 

At a minimum, you will need to have working versions of the National Instruments DAQmx, VISA, and 488.2 driver libraries. These are required not just on the output hardware computer, but also on any computers running the Cicero user interface client. The latest bundle of these can be downloaded at http://www.ni.com/drivers/ . Almost all Cicero errors and exceptions are caused by not having the correct or latest version of the driver libraries installed (greater than or equal to the version that Cicero was compiled against), causing the .NET runtime to be unable to resolve various library references.

Important note : When installing all 3 of the above driver libraries using the downloaded installer, chose a “Custom” installation rather than a “Typical” one. Ensure wherever possible that  .NET Framework Language support is enabled for all versions of the .NET Framework (at the time of this writing, 2.0, 3.5. 4.0; Cicero is built around Framework version 3.5, but at some future point it is possible that this will migrate to 4.0).

 

I am running on a Windows 7 x64 machine, I have MAX 17 which is correctly detecting the cards, and I have NI DAQ 16. 

 

I hope I could find help with you guys.

 

 

Redistributing NI-DAQmx with a Visual Studio C# project

$
0
0

I am not sure where this post should be since I am rather confused about the NI software products.  I don't use Labview and I don't use Measurement Studio.

 

I am using NI-DAQmx with a custom software application created in Visual Studio 2015 using C# (.net 4.5).  I've installed the drivers and NI development tools on the same PC as VS and everything works fine.  When I install the application on another PC that doesn't have VS it doesn't work because I get an error that the DLLs aren't loading.  I have included  the two DLL files NationalInstruments.DAQmx.dll and NationalInstruments.Common.dll in the project and they get copied to the target PC.  What am I missing?

 

Does NI require a special, separate installation of the DLLs so they get registered?  If so, what installer should I be using so I don't install all of the development stuff on a target PC?

 

What about drivers?  I am using the 9217 temperature module and the 9171 single slot USB chassis.

 

Thanks.

Adding .NET NI-DMM and NI-SWITCH libraries to the same VS project causing circular reference

$
0
0

I need both NI-DMM and NI-SWITCH .NET libraries (NationalInstruments.ModularInstruments.NISwitch.Fx40 and NationalInstruments.ModularInstruments.NIDmm.Fx40)  for my project in VS 21015.  There is no problem under development environment but unable to run after deployment with the following messages:

=======================================================

...
IDENTITIES
Deployment Identity : WinFormApp.application, Version=1.0.0.23, Culture=neutral, PublicKeyToken=097a2721cb4640aa, processorArchitecture=amd64
Application Identity : WinFormApp.exe, Version=1.0.0.23, Culture=neutral, PublicKeyToken=097a2721cb4640aa, processorArchitecture=amd64, type=win32

APPLICATION SUMMARY
* Installable application.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\public\WinFormApp.application resulted in exception. Following failure messages were detected:
+ Value does not fall within the expected range.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [9/2/2017 11:58:53 AM] : Activation of E:\Publish\WinFormApp.application has started.
* [9/2/2017 11:58:53 AM] : Processing of deployment manifest has successfully completed.
* [9/2/2017 11:58:53 AM] : Installation of the application has started.
* [9/2/2017 11:58:53 AM] : Processing of application manifest has successfully completed.
* [9/2/2017 11:58:56 AM] : Found compatible runtime version 4.0.30319.
* [9/2/2017 11:58:56 AM] : Detecting dependent assembly Ivi.Driver, Version=1.0.0.0, Culture=neutral, PublicKeyToken=A128C98F1D7717C1, processorArchitecture=msil using Ivi.Driver, Version=1.1.0.0, Culture=neutral, PublicKeyToken=a128c98f1d7717c1, processorArchitecture=msil.
* [9/2/2017 11:58:56 AM] : Detecting dependent assembly Ivi.ConfigServer.Interop, Version=1.6.0.0, Culture=neutral, PublicKeyToken=A128C98F1D7717C1, processorArchitecture=amd64 using Ivi.ConfigServer.Interop, Version=1.6.0.0, Culture=neutral, PublicKeyToken=a128c98f1d7717c1, processorArchitecture=amd64.
* [9/2/2017 11:58:56 AM] : Request of trust and detection of platform is complete.
* [9/2/2017 11:58:58 AM] : Downloading of subscription dependencies is complete.
* [9/2/2017 11:58:58 AM] : Commit of the downloaded application has started.
* [9/2/2017 11:59:00 AM] : Installation of application has successfully completed.

ERROR DETAILS
Following errors were detected during this operation.
* [9/2/2017 11:59:00 AM] System.ArgumentException
- Value does not fall within the expected range.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.CorLaunchApplication(UInt32 hostType, String applicationFullName, Int32 manifestPathsCount, String[] manifestPaths, Int32 activationDataCount, String[] activationData, PROCESS_INFORMATION processInformation)
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)

....
...

=======================================================

 

Using IL DASM disassembly tool I was able to see these two libraries referenced different versions of ivi.driver.

 

NationalInstruments.ModularInstruments.NIDmm.Fx40 ==> ivi.driver version 1.1.0.0

NationalInstruments.ModularInstruments.NISwitch.Fx40 ==> ivi.driver version 1.0.0.0

I also looked at NISwitch.Fx45 and it also referenced the same ivi.driver version 1.0.0.0

 

Is there anyway to work around this circular reference issue?  Or are there any NIDmm and NISwitch libraries with same ivi.driver reference?

 

Some more detail:

We're using VB.NET 4.5 with Visual Studio 2015

Running on Win 7 SP1

 

Viewing all 1999 articles
Browse latest View live


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