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

Is there a way to know if/when a StartTrigger has been received for a Task?

$
0
0

Hello friends,

 

I am working on implementing trigger timeout for an analog output task. If no trigger is received for the task within X seconds after calling Start(), I need to stop the task. The task under discussion is configured as follows:

            NiTask = new NationalInstruments.DAQmx.Task("AnalogOutputTask");
            var hardwareInfo = HardwareInfo.Instance;
            NiTask.AOChannels.CreateVoltageChannel(hardwareInfo.AnalogOutputModuleName + "/ao0", "ao0", HardwareInfo.ChannelVoltageMinimum, HardwareInfo.ChannelVoltageMaximum, AOVoltageUnits.Volts);
            NiTask.AOChannels.CreateVoltageChannel(hardwareInfo.AnalogOutputModuleName + "/ao1", "ao1", HardwareInfo.ChannelVoltageMinimum, HardwareInfo.ChannelVoltageMaximum, AOVoltageUnits.Volts);

            NiTask.Timing.ConfigureSampleClock("", HardwareInfo.AnalogOutputSamplingRate, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples);
            NiTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("/" + hardwareInfo.SecondDigitalIoModuleName + "/PFI0", DigitalEdgeStartTriggerEdge.Falling);
            NiTask.Control(TaskAction.Verify);

As you can see, I have configured the task to use a start trigger on digital input PFI0. Implementing trigger timeout would be simplified greatly if I could know or get notified when a StartTrigger is received by the task.

 

Is there a way to know if/when a StartTrigger has been received by a Task? If not, is there some built in trigger timeout mechanism that I could utilize?


SynchronizeCallbacks bei ChannelReadern für analoge und digitale Signale

$
0
0

Guten Tag

 

Wenn ich beim Lesen der Werte von den Karten 9220 und 9403 entsprechend "AnalogMultiChannelReader" und "DigitalSingleChannelReader" verwende, und zusätzlich die Flags "SynchronizeCallbacks" bei beiden Readern auf TRUE setze, kann ich davon ausgehen, dass die digitalen und analogen Werte synchronisiert werden? Oder werden nur die Signale von der Kanälen einzelner Module miteinander synchronisiert?

Standalone DAQmx Application missing dependencies

$
0
0

Hi,

 

I'm writing a data acquisition application for cDAQ based devices using C#/NET. I'd like to be able to install the bare-minimum driver package (i.e. the DAQmx runtime) on my deployment PCs, but when I do this, I'm missing dependencies.

 

What is the best way to package the cDAQ dependencies for deployment?

 

Thanks.

Digital I/O read write c#

$
0
0

Hi All,

 

I am developing a C# program which can communicate the device through Digital I/O. 

In my PC I have a Digital I/O card. 

 

After I made the write code base on the DAQmx example, the code doesn't give back error, but I can't see anything in the NI IO Trace. (I've started capturing...)

The example program does the same issue.

 

I don't know what the problem is. Nevertheless, If I push the start button on the test panel I can see the captured communication lines. Smiley Sad

 

Please help me whether the example code wrong or the NI IO Trace.

 

The example source code as below or in the attachement:

 

private void writeButton_Click(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
try
{
using (Task digitalWriteTask = new Task())
{
// Create an Digital Output channel and name it.
digitalWriteTask.DOChannels.CreateChannel(physicalChannelComboBox.Text, "port2",
ChannelLineGrouping.OneChannelForAllLines);

// Write digital port data. WriteDigitalSingChanSingSampPort writes a single sample
// of digital data on demand, so no timeout is necessary.
DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(digitalWriteTask.Stream);
writer.WriteSingleSamplePort(true, (UInt32)dataToWriteNumericUpDown.Value);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
Cursor.Current = Cursors.Default;
}
}

Will Measurement Studio 8.1.2 for Visual Studio 2005 work with NI-9215 hardware?

$
0
0

Hi there,

I have an older version of Measurement Studio (8.1.2), along with Visual Studio 2005.  It's been a while since I've done any development with this software.  It was previously used with PCI-6013 hardware, developing software in VB.NET.

 

I now have a need to work with some newer hardware (cDAQ-9178 DAQ Chassis, NI-9401 C Series DIO Module, NI-9215 C Series Voltage Input Module).  I'd like to know if anyone can tell me whether this older software will properly run with this newer hardware?

I'm guessing it's a matter of whether the older version of Measurement Studio can access the newer version of the driver for this hardware?  Or would it be possible to install an older version of the driver?

 

I am working with a Windows 10 development machine.  Would appreciate if anyone has any insights on this, or can offer any tips?

 

Best,

Chris

Why VISA does not have permission to create folders?

$
0
0

HI:

I use VISA screenshots. Then I found that if I had a folder in the middle of the file name, it might cause my screenshot to fail.(The folder already exists)

I have two E5052B here. One of them doesn't have this problem, but the other always fails in screenshots. If I save the screenshot to the root directory, I can take a screenshot.

Here is my screenshot command:

:MMEMorySmiley FrustratedTORe:IMAGe " F:\test\test.png"

 

 

Is VISA not authorized to create folders?Or what else?

Thank you

How to make the X axis to the middle position of graph in WPF?

$
0
0

How to make the X axis to the middle position of graph in WPF?

ScaleTransform name cannot be found in the name scope of System.Windows.Controls.ControlTemplate

$
0
0

Hello,

I'm not sure what I'm doing wrong here.

I have a simple graph with 4 plots.  When I click on the Y or X axis last/first value (to change the range), I get this exception:

'ScaleTransform' name cannot be found in the name scope of 'System.Windows.Controls.ControlTemplate'

I'm pretty sure some time ago this used to work.  Could someone please give me a pointer here?  Thanks!

 

<ni:Graph x:Name="GraphRefNode">
<ni:Graph.Axes>
<ni:AxisInt32 Orientation="Horizontal" Label="Frame"/>
<ni:AxisDouble/>
</ni:Graph.Axes>
<ni:Graph.Plots>
<ni:Plot Label="X" />
<ni:Plot Label="Y" />
<ni:Plot Label="Z" />
<ni:Plot Label="S" />
</ni:Graph.Plots>
</ni:Graph>

Listing devices from .net application

$
0
0

Hi,

I need to list in my application devices connected. Like in measurment studio explorer.

For example:

- NI-USB-6351"Dev1"

- NI-USB-6351"Dev2"

- CDAQ-9171"CDAQ1"

 

Is it possible in .net ? VB or C# examples ?

Thanks

Using the PXI-2527 with c#

$
0
0

I am programming a C# test application using Measurement Studio and Visual Studio and I'm having trouble understanding how to close the relays on the PXI-2527. Going through each topology for the 2527, and trying to figure out how to close the correct relays, it seems the documentation does not support what I'm seeing. I found two example solutions. The first example is MakingConnectionsOnASwitch and the second is ControllingAnIndividualRelay. These are both found in C:\Users\Public\Documents\National Instruments\NI-SWITCH\Examples\DotNET 4.5.

 

For example, choosing the 1-Wire 64×1 Multiplexer Topology, and trying to close a single relay, I would expect to be able to connect any channel to com0 as described in the documentation. But I cannot do this.I would expect that in this topology, cho+ would be ch0, ch0- would be ch1, ch1+ would be ch2 and so on. But this does not work. I can never connect ch0- to com0. I can connect all the chx+ channels, but none of the chx- channels to com0.  Also, if I use the designator "ch", I get errors that the "ch" is an invalid name. I can only use K0, K1, K2....  This does not match the documentation that I have read. 

 

Does anyone have a better example of how to program the PXI-2527 to support all the different topologies?

 

Thanks,

How to change Analog output waveform of Ni DAQmx quickly (each 2ms) in vc#

$
0
0

Hi All,

 

I am using USB6215 and want to generate different squar wave frequencies with it.

It works fine when I try to genrate different frequencies up to 40 KHz that I need.

The problem is that the only way that I found to change the frequency from 40KHz to 20KHz, was 

disposing the task and again making new task and write new data to it.

it takes about 55 ms abut I have to do it in less than 2ms because I am simulating a kind of frequency modulation.

the goal is to generate 40KHz, 20KHz and 8KHz eachone for about 1.5 to 2 ms and it will be decided at runtime that which frequency should be generated now.

Do you know how I can do it?

Thanks a lot for your help.

Synchrononous measurement of 3 encoder positions and analog signal

$
0
0

Hi--

I'm working on a project in which I need to collect data from 3 encoders (via 3 counters) and 1 analog signal synchronously.  I was hoping to get some high-level guidance here on the best approach.

 

I was contemplating using the internal clock to trigger measurements from the 4 sources.  My questions are the following:

  • what would be the best practice for this kind of data acquisition?
  • are there any good counter/analog examples that people can point me to?  I'm developing in VB but any text examples would be helpful.
  • is there a way to run a single task to read all 3 counters?  the way i've implemented it right now is with 3 separate tasks.  it works, but i worry about synchronicity at higher sampling rates.

Any assistance would be greatly appreciated.

Thanks!

Sandheep

PCIE6323 can it emulate a serial port or ethernet?

$
0
0

PCIE6323 can it emulate a serial port or ethernet?

Examples of basic LV architectures in Measurement Studio?

$
0
0

How can I do in .NET/Visual Studio/Measurement studio the following software archictectures:

 

  1. State machine loop
  2. Producer loop + Consumer loop
  3. Producer loop event + Consumer loop
  4. Actor Framework

Do you have any example or video?

Thanks for any suggestions

 

 

-201295 Calibration Error Code

$
0
0

I am trying to Calibrate a NI USB-6289 DAQ and it is not working. When I follow the direction in NI MAX using the Self-Calibration instructions from NI I get the following Status Error Code: -201295

 

If anyone knows how to correctly Calibrate this NI DAQ Device please message me below. That would be most appreciative! Thank!  


System.IO.FileLoadException after switching to NI 2019

$
0
0

Hello,

I recently switched to NI 2019 and didn't realize that once my apps are deployed on a "production" system, they crash with "System.IO.FileLoadException".  I searched this forum and looks like it could be a mismatch with .NET version or something related.

 

  • Before I switched from 2015 to 2019 they worked fine on production systems.
  • Apps work fine on my computer and on the build machine (both have Measurement Studio 2019 installed)
  • I install the following as I always did, only this time it's 2019 instead of 2015:
    • NI.Common.dll
    • NI.Controls.dll
    • NI.Controls.Graphs.dll
  • Building targeting .NET 4.7.2

I attached all files I could gather for troubleshooting.  Please let me know what I am missing.  Thank you!

 

Edit:  this is what's inside .wer file

Version=1
EventType=CLR20r3
EventTime=132083006954137528
ReportType=2
Consent=1
ReportIdentifier=c3fbdc38-acbe-11e9-9bf5-54ee7530faae
IntegratorReportIdentifier=c3fbdc37-acbe-11e9-9bf5-54ee7530faae
Response.type=4
Sig[0].Name=Problem Signature 01
Sig[0].Value=ExpressCompTool.exe
Sig[1].Name=Problem Signature 02
Sig[1].Value=1.0.0.20
Sig[2].Name=Problem Signature 03
Sig[2].Value=ab5836b7
Sig[3].Name=Problem Signature 04
Sig[3].Value=ExpressCompTool
Sig[4].Name=Problem Signature 05
Sig[4].Value=1.0.0.20
Sig[5].Name=Problem Signature 06
Sig[5].Value=ab5836b7
Sig[6].Name=Problem Signature 07
Sig[6].Value=1
Sig[7].Name=Problem Signature 08
Sig[7].Value=3f
Sig[8].Name=Problem Signature 09
Sig[8].Value=System.IO.FileLoadException
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=6.1.7601.2.1.0.256.48
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=1033
DynamicSig[22].Name=Additional Information 1
DynamicSig[22].Value=52a4
DynamicSig[23].Name=Additional Information 2
DynamicSig[23].Value=52a47bae162b5056874cd9b250824114
DynamicSig[24].Name=Additional Information 3
DynamicSig[24].Value=19d8
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=19d899072b5974d4d62c96d0f9ec7235
UI[2]=C:\Diagnostics\ExpressCompTool.exe
UI[3]=HF Comprehensive Tool has stopped working
UI[4]=Windows can check online for a solution to the problem.
UI[5]=Check online for a solution and close the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
LoadedModule[0]=C:\Diagnostics\ExpressCompTool.exe
LoadedModule[1]=C:\Windows\SYSTEM32\ntdll.dll
LoadedModule[2]=C:\Windows\SYSTEM32\MSCOREE.DLL
LoadedModule[3]=C:\Windows\system32\KERNEL32.dll
LoadedModule[4]=C:\Windows\system32\KERNELBASE.dll
LoadedModule[5]=C:\Windows\system32\ADVAPI32.dll
LoadedModule[6]=C:\Windows\system32\msvcrt.dll
LoadedModule[7]=C:\Windows\SYSTEM32\sechost.dll
LoadedModule[8]=C:\Windows\system32\RPCRT4.dll
LoadedModule[9]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll
LoadedModule[10]=C:\Windows\system32\SHLWAPI.dll
LoadedModule[11]=C:\Windows\system32\GDI32.dll
LoadedModule[12]=C:\Windows\system32\USER32.dll
LoadedModule[13]=C:\Windows\system32\LPK.dll
LoadedModule[14]=C:\Windows\system32\USP10.dll
LoadedModule[15]=C:\Windows\system32\IMM32.DLL
LoadedModule[16]=C:\Windows\system32\MSCTF.dll
LoadedModule[17]=C:\Windows\system32\nvinitx.dll
LoadedModule[18]=C:\PROGRA~2\Sophos\SOPHOS~1\SOPHOS~2.DLL
LoadedModule[19]=C:\Windows\system32\PSAPI.DLL
LoadedModule[20]=C:\Windows\system32\VERSION.dll
LoadedModule[21]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
LoadedModule[22]=C:\Windows\system32\MSVCR120_CLR0400.dll
LoadedModule[23]=C:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\b308b9c61f65cf2dfd876031ee385ba4\mscorlib.ni.dll
LoadedModule[24]=C:\Windows\system32\ole32.dll
LoadedModule[25]=C:\Windows\system32\CRYPTBASE.dll
LoadedModule[26]=C:\Windows\system32\uxtheme.dll
LoadedModule[27]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System\095a3392942c3d4eb888e6a32036acd8\System.ni.dll
LoadedModule[28]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System.Core\75913bbaf1bee617a94dcd6b5df12a5d\System.Core.ni.dll
LoadedModule[29]=C:\Windows\assembly\NativeImages_v4.0.30319_64\WindowsBase\6110ecf056356557d5798a1583a1c434\WindowsBase.ni.dll
LoadedModule[30]=C:\Windows\system32\CRYPTSP.dll
LoadedModule[31]=C:\Windows\system32\rsaenh.dll
LoadedModule[32]=C:\Windows\assembly\NativeImages_v4.0.30319_64\PresentationCore\ceff7eae18ed09ff1116ebf9af497790\PresentationCore.ni.dll
LoadedModule[33]=C:\Windows\assembly\NativeImages_v4.0.30319_64\Presentatio5ae0f00f#\3d01d2b7bde19d91d70c4ff96eea3432\PresentationFramework.ni.dll
LoadedModule[34]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System.Xaml\76a6a6b0f7fb1fbd64a800b5fc3d47bb\System.Xaml.ni.dll
LoadedModule[35]=C:\Windows\system32\dwrite.dll
LoadedModule[36]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\wpfgfx_v0400.dll
LoadedModule[37]=C:\Windows\system32\MSVCP120_CLR0400.dll
LoadedModule[38]=C:\Windows\system32\OLEAUT32.dll
LoadedModule[39]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\PresentationNative_v0400.dll
LoadedModule[40]=C:\Windows\system32\api-ms-win-core-xstate-l2-1-0.dll
LoadedModule[41]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
LoadedModule[42]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\nlssorting.dll
LoadedModule[43]=C:\Windows\system32\WRusr.dll
LoadedModule[44]=C:\Windows\system32\SHELL32.dll
LoadedModule[45]=C:\Windows\system32\MSIMG32.dll
LoadedModule[46]=C:\Windows\system32\profapi.dll
LoadedModule[47]=C:\Windows\system32\WindowsCodecs.dll
LoadedModule[48]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System.Configuration\36778d2072c745f0ad72f7e219122258\System.Configuration.ni.dll
LoadedModule[49]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System.Xml\8821b72d5d51079acf96e90c4af19a96\System.Xml.ni.dll
LoadedModule[50]=C:\Windows\system32\bcrypt.dll
LoadedModule[51]=C:\Windows\system32\RpcRtRemote.dll
LoadedModule[52]=C:\Windows\assembly\NativeImages_v4.0.30319_64\Presentatio1c9175f8#\7600f870ebcc661f412ab16465a64647\PresentationFramework.Aero.ni.dll
LoadedModule[53]=C:\Windows\system32\dwmapi.dll
LoadedModule[54]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll
FriendlyEventName=Stopped working
ConsentKey=CLR20r3
AppName=HF Comprehensive Tool
AppPath=C:\Diagnostics\ExpressCompTool.exe

Syncing multiple cDAQ-9191 over WiFi

$
0
0

For my next project I am thinking about using multiple cDAQ-9191 carriers with WiFi. It seems possible to create a virtual task in LabView and add multiple carriers. The syncing of the input signal is happening in the background.

 

However I dont use LabView and didnt find any documentation how to do this with the DAQmx lib in c#.

It would be really nice if someone could point me in the right direction.

An unforseen error occured, probably as the result of a code of markup error. Could not load file or assembly 'NationalInstruments.DAQmx.dll' or one of its dependencies. The specified Module could not be found.

$
0
0

An unforeseen error occurred, probably as the result of a code of markup error.
Could not load file or assembly
'NationalInstruments.DAQmx.dll' or one of its dependencies.
The specified Module could not be found.
The above error is happening when we changed OS from Microsoft Windows 10 LTSB 2016 64bit to Windows 10 LTSC 2019 64bit
 
Hi team, I am Lead OS Engineer working for Philips Health Care Bangalore. we are using NI DAQ 18.1 version. In our application I could see 'NationalInstruments.DAQmx.dll' and some more NI related files used with the application, and application calls the DLL file.
 
Operating System Used : Windows 10 LTSC 2019 x64, we recently moved to this OS and when we launch our application it refers the 'NationalInstruments.DAQmx.dll'.
IN OS we have installed : NI_DAQ MX 18.1 drivers successfully. The error doesn't appear in windows 10 LTSB 2016 or Windows 10 enterprise edition 2016.
 
Why this error appears in Windows 10 LTSC 2019 x64 os ? I am not able to find the 'NationalInstruments.DAQmx.dll' from NI-DAQ 18.1 after installation so I can replace it with my application in case of any compatibility issues.
 
Requesting your guidance and help ASAP.

ZoomInOnPoint

$
0
0

Hello I am using NI MS 2015 with intensity graph and I am trying to utilize the ZoomInOnPoint method but it behaves very erratically. It does not zoom in as intended and in some cases it will zoom in but not in a smooth operation. Is there anything I should know with this method for the intensity graph to zoom smoothly?

wpf Graph :axis position

$
0
0

I want to put  x axis  and  y  axis to the center  of  Graph,like  a  digital scope  screen.

how   can  I  implement  this ?

Viewing all 1999 articles
Browse latest View live