SE AcceesViolationException NationalInstruments.DAQmx.Task.UnregisterAsyncWaitHandle

Hello

I use my own .net application which communicates with NationalInstruments.DaqMx.dll (version 9.7) in order to activate NiDaq in the following configuration:

Chassis PXI-1033 at two locations PXI-6284, measure differential voltage. This app worked already for a few months and has been tested under high performance - high sampling rate and long hours, without no problems so far. Recently, we tried a new use case - short sessions (60 min) measures running in sample rate = 100 and samples per channel = 100 after a few iterations, we continue to get access violation exception:

Exception info: System.AccessViolationException

Battery:

to NationalInstruments.DAQmx.Task.UnregisterAsyncWaitHandle (System.Threading.WaitHandle)

at NationalInstruments.DAQmx.Internal.DaqAsyncResult.AsyncOpDone)

at NationalInstruments.DAQmx.Internal.AnalogMultiChannelMemoryOptimizedMultiSampleReadAsyncResult.WorkItem (System.Object)

at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object)

at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem)

at System.Threading.ThreadPoolWorkQueue.Dispatch)

at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback)

Keeping the sampling rate 100, but his definition of samples per channel at 1000 seems to solve this problem.

Can someone explain to me what is the cause of this exception?

Thank you

Hadas


Tags: NI Software

Similar Questions

  • I'm trying to reference NationalInstruments.DAQmx in my application c# but build error

    I'm trying to reference NationalInstruments.DAQmx.dll in my c# application but get error of next generation. No idea how to solve this problem?

    WARNING 1 the referenced assembly 'NationalInstruments.DAQmx, Version = 9.4.40.50, Culture = neutral, PublicKeyToken = dc6ad606294fc298, processorArchitecture = x 86' cannot be resolved because it has a dependency "System.Web, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a", which is not in the current target framework". NETFramework, Version = v4.0, profile = customer. Remove references to assemblies not in the target framework or consider retargeting your project. NITesting

    Julien,

    If you have the same error message, such as noted above, it seems that the problem was that the project has been configured for the profile of the Client .NET 4.0. The .NET 4.0 Client profile is a lighter version of the .NET framework, but the assemblies of National Instruments require the .NET 4.0 framework. You can set up your project (even after its creation) to use the full version of .NET in the project properties > Application > target framework in c# and project properties > compile > Advanced Options of compilation... > target in VB .NET framework.

    If this isn't the same error message that you receive, or if this does not resolve the problem, could you please put the error message in your response?

  • Missing NationalInstruments.DAQmx.DLL

    Hello

    I use VB .NET with Visual Studio 2010.

    I have downloadad the last version of the NOR-DAQmx driver, but when I call the library of NationalInstruments.DAQmx.DLL program this component could not be found.

    Where can I find this library?

    Thank you.

    I have never installed these features support, but if you have already installed DAQmx, you should be able to install the required additional components similar to what is shown here:

    http://digital.NI.com/public.nsf/allkb/52F5F5EF78AF084286256E0B007FE793

    -AK2DM

  • How can I fix error with package installed: "could not load file or assembly ' NationalInstruments.Daqmx.dll

    I'm fighting this problem for days (euphemism)...

    I used to work, but now isn't an installation package.  I tried to install and run the program on a couple of computers and the program hangs when loading the Dll NI.  I put everything ' x 86.

    The list of dependencies in VS2010 is illustrated in the attatched screenshot.

    The text of the mistake of trying to run the application on the target computer is lower in italics.

     

    Of course, I could use some help on this!  Thanks in advance.

    See the end of this message for details on the call
    just-in-time (JIT) debugging instead of this dialog box.

    The exception text *.
    System.IO.FileNotFoundException: Could not load file or assembly 'NationalInstruments.DAQmx.dll' or one of its dependencies. The specified module could not be found.
    File name: "NationalInstruments.DAQmx.dll."
    at IPClientTest.MTF_Supervisor.mainSstart13)
    at IPClientTest.MTF_Supervisor.mainStartByParts)
    at IPClientTest.MTF_Supervisor.lblSelfTest_Click (Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnClick (EventArgs e)
    at System.Windows.Forms.Control.WmMouseUp (Message & m, MouseButtons, Int32 clicks button)
    at System.Windows.Forms.Control.WndProc (Message & m)
    at System.Windows.Forms.Label.WndProc (Message & m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage (Message & m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc (Message & m)
    at System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

     

    Loading assemblies *.
    mscorlib
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.34011 built by: FX45W81RTMGDR
    Code: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    MTF_Supervisor
    Assembly version: 1.0.3.3
    Win32 version: 1.0.3.03
    Code: file:///C:/mtfDebug/MTF_Supervisor.exe
    ----------------------------------------
    System.Windows.Forms
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.34003 built by: FX45W81RTMGDR
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    MTF_ClassLib
    Assembly version: 1.0.1.0
    Win32 version: 1.0.1.0
    Code: file:///C:/mtfDebug/MTF_ClassLib.DLL
    ----------------------------------------
    NationalInstruments.UI.WindowsForms
    Assembly version: 13.0.40.242
    Win32 version: 13.0.40.242
    Code: file:///C:/mtfDebug/NationalInstruments.UI.WindowsForms.DLL
    ----------------------------------------
    NationalInstruments.UI
    Assembly version: 13.0.40.242
    Win32 version: 13.0.40.242
    Code: file:///C:/mtfDebug/NationalInstruments.UI.DLL
    ----------------------------------------
    NationalInstruments.Common
    Assembly version: 13.0.40.188
    Win32 version: 13.0.40.188
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/NationalInstruments.Common/v4.0_13.0.40.188__dc6ad606294fc298/NationalInstruments.Common.dll
    ----------------------------------------
    System.Web
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.34009 built by: FX45W81RTMGDR
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
    ----------------------------------------
    System.Core
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    NationalInstruments.Common.Native
    Assembly version: 13.0.40.188
    Win32 version: 13.0.40.188
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_32/NationalInstruments.Common.Native/v4.0_13.0.40.188__dc6ad606294fc298/NationalInstruments.Common.Native.dll
    ----------------------------------------
    System.Xml
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Design
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
    ----------------------------------------
    Accessibility
    Assembly version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    Code: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------

    Salvation Lorne.V.,.

    Exactly how you install OR DAQmx on the target computers?  Even if you include the DAQmx merge module in your version, you always need to install DAQmx on the target machine separately.

    You can also confirm that the DAQmx.dll is installed in the same directory on the development and deployment of the machines?  And you have the same version of DAQmx on both machines?

    Kind regards

  • Programmatically, create a multi-channel DaqMX task

    Is there a way to create a task of multichannel DaqMX programmatically, without having a task to copy?

    Yes and it is an easy way to find a way to do it.

    Start by creating a task in MAX (Ben, but I want to avod MAX!) Don't be afraid that it's just a one time event that will allow us to know what are the steps)

    Go to a block diagram and steady decline DAQmx task on the diagram and choose the task you created in MAX.

    Right click and select 'create configuration and example '. LV will create the code that goes with the taks.

    Study the config VI that was created. It will show you what it takes to create a task without MAX.

    I hope that helps!

    Ben

  • DAQmx task Read DAQmx with sampling frequency of 10 Hz produced much too much data

    I have a simple configuration with a strain of channel 4 OR-9237 amp holds a carrier of series C of WLS - 9163 (wired ethernet mode) - Details probably does not matter.

    I used MAX to create a DAQmx task associated with which all four gauges samples.  The calendar setting is "Scan Loads" is continuous sampling, 2 k buffer (read samples) and 10 Hz rate.  I guess that this task would generate 40 data values per second - 10 for each channel.

    I have a simple loop of reading using DAQmx Read.vi that works always (without any stimulation time).  Playback is set to read all available data and then pump it into a table.
    In the attached example, I also added a few words of debugging to stop the loop after N iterations.

    As the loop is programmed with a 0.2 second period, I expect each pass of the loop to read about 8 samples or 2 samples per sensor.  Instead, I get hundreds each passage.  It's like reading has substituted the sampling frequency specified in the task of the unit.  I absolutely need data to be material to the rhythm.

    Where have I lost?

    Thanks Adnan,

    I changed your example I selected 'Strain gage' entry analog and then lowered the minimum and maximum thresholds to +-1-2.  What happens is that each other in the loop, I 2048 samples or zero samples.  The display flashes a whole line and then it clears any other past.

    In response to your second post, I understand that the loop cannot run quite right that I select.  I think that, but at a sampling frequency of 10 Hz, I have to sleep on the software side for nearly a minute before I built 2 K samples.

    I played with the frequency of sampling, assigning to various values from 0.1 to 10000Hz.  The behavior is the same until I approach the high rates where available samples remains to 2048-4096 sometimes, the display becomes continuous.

    Ahhh, Darn.  Yet another search was this link that points to the root of my confusion.  The 9237 can taste arbitrary rates using its internal clock.  Duoh!  I wish that the pilots are smart enough to warn you if there is a discrepancy between the selected sampling rate and capabilities of the device

  • How to add DaqMX task to an existing project

    I use Measurment Studio 2010 with Visual Basic. I created a NI Daq Windows application with an element of task Daq to analog input.

    Now, I have to add additional DaqMX tasks (tasks in digital and Digital Out) to the existing Visual Basiic project.

    How can I do this?

    Thank you

    Mike

    Hello

    Here is a link that shows how to add a task to a .NET project

    http://digital.NI.com/public.nsf/allkb/290D84D10809D4C086256FF20076F8B8

    Curt

  • How to set up wizard DAQ or DAQmx tasks using an external text such as a CSV file?

    I work in an environment were we have a lot of users VI. I develop the VI and technical personnel using the GUI (cover Page) to collect the data. In order to control the input parameters used on multiple hardware platforms, I'd like to develop a generic VI which will import or read a text file I created, and configures the DAQmx tasks to perform data acquisition. In fact, I have the generic VI full and need to understand how to make configurations DAQmx more transparent for the end user as long as the end user has the text file to import. For example, to generate the wizard DAQ DAQmx tasks based on information from text file?

    I don't have time to do more than just a small example. The VI below contains a table with table fixed index functions. This would have changed to get automatically the correct rows and columns, but I hope that you have an idea. I does not have any code to define the type of temperature measurement or to set the correct configuration of Terminal. All of this plus all other possible options will be treated similarly to the definition of the type of channel and min/max which is located in the example.

    Edit-attach VI

  • Convert DAQmx task IDS in a string

    I'm using LabVIEW to perform a generation analog DAQmx and I call my LabVIEW of CVI code via a dll.  I want to make two separate calls, one to start a task DAQmx and one to stop the task, so I need to either:

    (1) move a task ID DAQmx CVI and then again to LV

    or

    (2) convert a string of the ID for the task, pass it to CVI and then back to LV and then convert back to a task ID in LabVIEW.

    I'm sure that option 2 is the easiest option, but I don't know how to convert back and forth between a string and a task ID DAQmx.  Can anyone help with this?

    Thank you

    Joe

    Nathand is correct, it's pretty easy convert from/to the task DAQMX and String.  The two below

    Hmmmm is note expected or a bug?

    Feedback probably need an expert of DAQmx to answer that - I think it might be related to level DAQmx tasks

  • Could not load file or assembly NationalInstruments.DAQmx

    I get an error 'Could not load file or assembly NationalInstruments.DAQmx' when I put my application on another computer.  The only difference between the two computers that I can say is that one that doesn't use the 64-bit Windows version and one who does has the 32-bit version.

    DAQmx exists on the computer and I can control the acquisition of data through the Explorer measurement & cutting automation.

    Any suggestions?

    Thank you

    Garth

    I solved the error by downloading the latest version of DAQmx on computers and recompiling code using the most recent version.

  • How to store a DAQmx task properties effectively?

    Hello everyone and happy new year!

    I would like to be able to keep track of all the DAQmx task settings (and canals) in a file, regardless of the content of the DAQmx task / channel is. So far, the only way I've found is to use a task DAQmx / channel property nodes and treat every property possible. However, since they are so many properties, each being is not valid for any material or task / channel type, it's a really big job and I'm rather lazy

    So I ask here if someone has already dealt with THIS or have any idea?

    Hi Hillman,

    Thank you very much for the link. Related documents Silly me had neglected tdm... Your link is indeed very useful, as I do right now exactly the same way it's done the:

    • DAQmxTaskInfoQuery.vi
    • General info.VI DAQmx TEDS

    As part of the download in the link you gave.

    Exepted this code is much more readable than mine, so I guess I don't need to view my ugly code incomplete. Many things interresting, thank you very much. I'll be back if I have something better to give as a reference.

  • DAQmx task: MAX or lvproj?

    Experts,

    What are the benefits to declare tasks DAQmx either in the lvproj or Max?

    My question because I'm calling a VI of TestStand test, and when the DAQmx task constant is declared in the project (lvproj) which holds the criterion VI, it does not perform properly, saying can't find the reference or something.

    If I change the DAQmx task to be a global task in MAX everything works as expected.

    What is the best practice to do this kind of things?

    Thank you very much

    LR2

    TestStand does currently not support execution of VIs a project. So unfortunately, we expect the behavior that you see where to call a VI that uses a DAQmx task defined in a project does not work. For now, if you do want to keep your configuration of the task outside the source code and you want to use these task for TestStand, you must store the Max.

    We are looking for by adding support for the performance of screw a project in a future version of TestStand.

    David Rohacek

    National Instruments

  • Configuration of extraction of DAQmx task ID...?

    Hello

    Is it possible to set up channels in a pull-out TaskID? I know it's just a number, which I think refers to an entry in a table of tasks taking into the configuration details. Regardless of whether I'm right or not, is it possible to decipher the task ID accurate and detailed on the co-content channels?

    Thanks in advance,

    You try to reverse engineer a task only from the handle of the task or you have access to the task handle after it's been created?

    If this is the first, it is not that you can make the raw string, because the task must exist on the computer for any information about her.  If a task is saved, it will appear in MAX.

    If the task was created dynamically and still exists on the machine, you can use the task to stop DAQmx to stop the task and then to study its properties using different DAQmx properties.  You can use the task property NOR-DAQmx 'Channels' to get an array of all the channels in the task.  Then, you can use different properties DAQmx channel on each channel to obtain more precise information on the channels.  Triggering and synchronization, simply use the associated properties.

  • Cannot rename the old DAQmx tasks via NI MAX

    Hello

    I NI MAX 15.3 and DAQmx 15.1.1 installed.

    I am facing a strange problem. When I try to rename any task DAQmx via NI MAX, I get this error message:

    The thing is, the chosen name is NOT in use and does not contain illegal characters! (I tried several names, including "X" and "MyTask"). The same thing happens to the tasks associated with devices, simulated and real devices.

    The other weird thing is, I can create a new task from scratch, and I can rename this task without any problem. However, I am still not rename my old tasks.

    I suspect some sort of corruption of database NI MAX. How can I find the cause and fix?

    EDIT: more signs of corruption: if I delete something 'new', nothing happens. If I delete something 'old', NI MAX silently crashes to the desktop.

    Thank you!

    You can reset the database to MAX through the link below: http://digital.ni.com/public.nsf/allkb/2C7480E856987FFF862573AE005AB0D9

    Also make sure the backup and try if it works.

  • How to copy DAQmx task without the help of MAX?

    Howdy-

    I hit a bit of trouble here I think points to a fundamental misunderstanding I can have on DAQmx channels and tasks.  I can hack together a workaround, but I would like to know how to do these things, common sense.

    In a Word, I prefer to do everything in the code and not use MAX.  For my application, I would like to create a single channel/task initialized with all the scaling, the physical channel parameters and units (it is what is, in my case, a 'channel').  I would then like to create copies of this channel/task and configure each with parameters of specific task of sampling... corresponding to what I would call the "tasks" to use "Channel".

    I'll have no chance, so of course, I do not understand what I do.  Any reading/posts I've met use MAX.  Here's what I've tried so far:

    Even when you try to use MAX, I am the breath.  Any help straightening on my confusion here is very appreciated.

    Thanks in advance and have a nice day.

    -Brad

    In fact, you're not confused.  In this instance of National Instruments is perhaps...

    See the links ofthese ideas in the link.

    But a 'task' is really just a section in an XML file.  If this file is named *.lvproj the project has access to tasks.  If this file is *.nce any labview application has access to tasks.  If this file is created by the RTE that vi has access to the task.  In short, the "tasks" are never really defined by 'Code' but by the XML code to the file than declairs them and teir properties.  Tasks need to be defined a time-preference during design - project

    Yes, it's a bit simplistic but a good analogy!

    Go ahead and kiss MAX to set your tasks... use DAQmx property nodes if you need to programmatically determine a task property.   "do everything in code" as you say is just not really the way it is... the way I think you hear it...  'S really not 'made it in the code"but rather how LabVIEW is inherintly multithreaded.  The IDE just handles it for you "So easy that could encode a cave man!  Relax and let it work the way it does work for you.

Maybe you are looking for