Getting AcceesViol​ationExcep​tion from NationalIn​struments.​DAQmx.Task​.Unregiste​rAsyncWait​Handle

Hi,
I'm using my own .net application that communicates with NationalInstruments.DaqMx.dll (version 9.7) in order to activate NiDaq in the following configuration:
PXI -1033 chassis with two slots of PXI-6284, measuring differential voltage. This application was already running for some months and was tested under high performance - high sampling rate and long hours, with no problems so far. Recently we were trying a new use case - running short sessions (60 mins each) of measurements in sampling rate = 100 and samples per channel =100. after few iterations we keep getting access violation exception:
Exception Info: System.AccessViolationException
Stack:
   at NationalInstruments.DAQmx.Task.UnregisterAsyncWait​Handle(System.Threading.WaitHandle)
   at NationalInstruments.DAQmx.Internal.DaqAsyncResult.​AsyncOpDone()
   at NationalInstruments.DAQmx.Internal.AnalogMultiChan​nelMemoryOptimizedMultiSampleReadAsyncResult.WorkI​tem(System.Object)
   at System.Threading.QueueUserWorkItemCallback.WaitCal​lback_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(Syst​em.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threa​ding.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.​Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWa​itCallback()
Keeping the sampling rate as 100, but setting samples per channel to 1000 seems to solve this problem.
Can someone explain me what is the cause of this exception?
Thanks,
Hadas
Solved!
Go to Solution.

Thanks Mike,
I attached the relevant code pieces. Generally, it is based on the example on NI-DAQ\Examples\DotNET4.0\Synchronization\Multi-De​vice\AIContAcquisition\cs.
It has 4 classes:
SyncTask - an abstract class that represents one task
NiSyncTask - a derived class that does the actual access to DAQmx API
TaskManager - an abstract class that manages several SyncTasks
NiTaskManager - a derived class that manages NiSyncTasks 
It's quite complicated, but I hope it will be helpful.
Regards,
Hadas
Attachments:
SynTask.zip ‏9 KB

Similar Messages

  • How to I get list of Users from LDAP in a Task?

    Hi,
    Can any one tell me that how can I communicate with a LDAP Resource and get all the users from the LDAP as a list in an activity in the task?
    Can anyone tell me how can I do this?

    The "Stick Slidelet" option has been unchecked all the time, but the "X" button stayed.
    Meanwhile, on saving Captivate asked me for the umpteenth time if I wanted to convert my project from Captivate 7 to 8. It seems like I originally had a version 7 trial installed, but my licensed copy clearly states that it is version 8 now, and I have answered this dialog with "please convert" in this project every time before.
    Anyway. Now my original slidelets still have the unwanted "X" button. But when I create a new slidelet from scratch, it does not have the button anymore.

  • How to get the User Id from the user interactive task?

    If I need to get the user id or whoever process the user interactive task and save this information to the database, how can I get the user identity who process the interactive task? I tried the owner, creator on the execdata, but it doesn't work.
    Thank you

    try using
    Participant.id or Participant.name
    in the interactivity and update this value in the database.
    HTH
    Narasimha
    Edited by: Narasimha on Mar 6, 2011 9:42 PM

  • Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Not a lot of details here, but my guess is this isn't working for you because you are wiring in the task to the Active Channels Property and not the actual Channel Name. I have attatched a screenshot of what I believe you are trying to do. The Task has 2 channels in it, so I need to index off one of the channels and wire it into the active channels input of the Channel Property node. Then I can read information about that channel
    Attachments:
    channel_name.JPG ‏69 KB

  • Is it possible to use "Delay Values" to create a frequency signal from digital "Count Edges" -task? (= are the results I'm getting correct?)

    Hello.
    I have a digital encoder from which I need freaquency information (to ultimately get rpm -infromation). The problem is that this task is inside a loop with 2 other DAQmx -tasks that are using "one sample on demand"-aquisition mode and if I configure this new counter task to be a freaquency task, it only updates once in ~ second which makes the whole loop lag.
    I thus created an "artificial" freaquency signal by using "Count Edges" -aquicition mode and the "Delay Values" -block so that I substract the delayed signal from original "Count Edges" -signal. There is a 0,01s delay in the loop and I figured out that if the history of the "Delay Values" -block is 100 samples I would thus get the real edge-freaquency.
    I tested this configuration and the results seem to be at least really close to correct but I have no idea if this idea is in any way correct...
    This explanation was probably quite confusing so please see the picture attached.
    Thanks a lot in advance! 
    Attachments:
    are_the_results_correct.jpg ‏200 KB

    First of all, thank you for quick reply. Unfortunately I don't have the acces to the vi. until tomorrow.
    And yes, I think you understood correctly: essentially this arragement measures how many edges have been counted during one iteration. This is how I figured out that this could then be used as a frequency measurement:
    1. From the "Edges - Delayed Edges" I get the information on how many edges have been counted during last iteration.
    2. I "know" (really I don't?) that one iteration lasts ~0,01s because of the delay in the loop.
    3. There is 2048 edges in one round of the encoder so I get the rpm as follows: rpm = (edges - delayed edges)/204,8*60(s)
    (If I was using history size of one as you suggested it would be: rpm = (edges-delayed edges)/2048 * 60) However using history size of 10 and taking it account in the multiplication smoothens the response nicely.
    But doesn't this arragement count on the fact that the vi runs smoothly and there is no additional lag?
    I quess using another loop and notifiers for a dedicated freaquency measurement as you suggested could be worth trying. I just have to first learn how to use them. 
    If I do use them will the main loop run smoothly and not wait for every update of the notifier? This would be essential since the freaquency output refresses only about once in a second if I use the continious aquisition mode.
    Attachments:
    are_the_results_correct.jpg ‏198 KB

  • Extract single channel from DAQmx Task

    Hello,
    I have created a DAQmx output task, which contains two channels.  Is it possible to extract individual virtual channels from the task to be processed by two parallel processes?  I have tried bringing out the Channels Property using a Task Property Node, but I then get the error that the channel is not part of an active task (see attached snippet)
    Could anyone advise on a better approach, or how to acheive this functionality - if it is possible?
    Regards
    Dave
    Solved!
    Go to Solution.
    Attachments:
    split out channels from DAQmx task.png ‏34 KB

    Sorry, that VI does not make much sense. You have to use a single DAQmx Write for both channels and for 1 Sample mode, you simply have to build an array of the signals as shown below.
    Attachments:
    two channel write.png ‏12 KB

  • Get All serial numbers from a computer.

    Get All serial numbers from a computer.
    I have an application were knowing which computer the program is being run on is a very important aspect.  I want to be able to get the Hard Drive Serial Number, the Motherboard Serial number, and any other devices that are installed on the computer.  This includes such things as NI Can Cards (PCMCIA), AN SCXI Chaises and PCI cards.
    This information will provide the necessary link and will prevent an misconceptions as to what was and is installed on the computer.
    Any and all help that can be provided for this would be greatly appreciated.  

    Hi Kyle,
    To get you started, I have attached a VI that will return the serial number information for any devices in your system that use the NI-DAQmx drivers.  In addition, this VI will allow you to obtain certain information about devices in your system that have VISA resource names.  To ensure all of your PCI devices are accessible to VISA, you must enable this option in Measurement and Automation Explorer.  In MAX, go to Tools>>NI-VISA>>VISA Options and select the radio button "Show all devices accessible to VISA" in the "PXI/PCI and Firewire Interfaces" section.  The property node in the top for loop of the VI contains various properties about these devices that can be accessed.  As far as other non-NI devices in your system, a call to an external Windows DLL may be your best option for obtaining serial number information about the hard drive, motherboard, etc.
    Regards,
    Andrew W
    National Instruments
    Attachments:
    Get Device Info.vi ‏44 KB

  • Get DAQmx tasks parameters

    I've created in MAX 4.0 some DAQmx tasks to control diferent digital outputs bits (I attach a picture of it). I have to develop a TestStand step type with LabVIEW 7.1 in edit mode able to select any of this predefined tasks and show the bits correspondence (following the picture it would be for example "DigitaOut4 -> Dev1/por0/line2"). Is there some method to get all those parameters? Does somebody has a small example? Thanks in advance.
    Mackemann
    Attachments:
    MAX DAQmx Tasks.JPG ‏62 KB

    You can get all of this information from DAQmx property nodes. I wrote a quick example and there are probably more on either the LabVIEW or DAQ boards.
    Message Edited by Dennis Knutson on 03-30-200602:56 PM
    Attachments:
    DAQmx Properties.JPG ‏30 KB

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can I get an HD movie from iTunes store to play on original iPad

    I recently purchased an HD movie--Brave--from the iTunes store.  I'm trying to play on my original iPad (iPad 1), but iTunes refuses to synch it because it says it is an unsupported format.  The movie is in 1080p format.  I typically get both HD and SD formats when I purchase movies, but iTunes no longer downloads the SD version automatically when I purchase the HD version.  I attempted to get an SD version from the store, but it said I already purchased the movie and instructed me to check the downloads.  There is no SD download pending and a check for new downloads was fruitless.
    Can someone confirm that the original iPad is unable to play HD video?  I imagine it is the 1080p that's the problem.  Can anyone confirm that 720p would work?  Is there no longer a means to get both HD and SD when purchasing a movie from the iTunes store?  If there is, how?
    Thanks for your help.
    Jamie

    You can get the SD or 720p version by:
    Open iTunes 11
    Click iTunes in menu bar > select Preferences...
    Click on the Store tab
    Change When downloading High Definition videos, prefer dropdown to 720p > click OK
    Click on the iTunes Store button
    Click Purchased link
    Click Movies tab
    You should now see a download icon for the movies you already have 1080p version of.
    Click on this download icon to download the 720p version.
    This will put a 720p version in the same folder on your hard drive as the 1080p version.  If you have iTunes setup to play 1080p when available, it will play the 1080p version.  When you connect your iPad 1, it will sync the 720p version.
    Don't forget to change your preference back to 1080p so you can continue to get the higher quality version.

  • How can I get an itunes movie from macbook to apple tv via airplay, how can I get an itunes movie from macbook to apple tv via airplay

    how can I get an itunes movie from macbook to apple tv via airplay?

    You don't use Airplay.  You set up Home Sharing on both and under the Computers section of AppleTV you'll then find it under Movies (or Rentals if rented), assuming it's in a compatible format.
    AC

  • How do you get your money back from a charge you never even made on the app store?

    How do you get your money back from a charge you never even made on the app store?

    Contact iTunes.
    How to report an issue with Your iTunes Store purchase

  • I cannot send email from my ipad. Getting address is rejected from server message.

    I cannot send email from my ipad. Getting address is rejected from server message.

    Check the outgoing mail server setting. Make sure that your username and password are in there.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional.

  • How to get back voice memos from my computer

    Hello, is there any way to get back voice memos from my computer? please help, very urgent, thank you in advance:)

    The only method I know of is software called iexplorer.  After downloading the program onto your computer, open explorer and navigate to your phone and you will see the voicemails.  Copy them to your computer and your all set.  Sorry for your loss

  • Is there a way to get the voice memos from my iPhone on to my pc?

    Is there a way to get the voice memos from my iPhone on to my pc?

    See http://www.tech-recipes.com/rx/6403/iphone-transfer-voice-memos-from-iphone-to-c omputer/.

Maybe you are looking for