Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Access violation Call Library Node AtUSBhid.dll Atmel XMega

Solved!
Go to solution

Hi, I’m working on my first project to get data from a USB Device, in this case a Atmel XMEGA-A3BU XPlained. Based on the information I found on this forum I decided to go for the Call Library Function Node because the .dll (AtUsbHid.pdf is the dll file, rename to .dll  ) and the header (AtUsbHid.h) file are available. I also have a description of the communication between the PC and the board which I used to build a small vi (RNH-USB31MRT2013.vi). I have attached the files mentioned.

 

In first instance the vi seems to be working perfect, the device is detected, the first command is send ok, the second command is send ok and yes data is received from the target. So what is the problem you might think well that shows itself after a few minutes to half an hour.  The first thing I notice is that the data from the target is no longer updated,  the call library  function readData() returns a zero and the processor load for labview jumps from less than zero to about 30%. When I stop the VI and run it again most of the time the communication starts again. Sometimes I get a crash report telling that a access violation occurred 0xc0000005@EIP 0x77918DC9 (for instance) and that Labview needs to restart. When I exit labview after the communication has stopped I always get the report: access violation 0xC0000005 EIP0xXXXXXXX occurred.      

 

I have done a search on this error and tried some off the solutions mentioned, shut  down anti-virus software (did not help), try another computer (no solution) or make a executable ( same problem). I have no clue what might be the problem, what I might be doing wrong,  let alone what the solution might be. I wonder if there are others who have experience with establishing USB communication between labview and an atmel device or with the access violation how could help me out to get a stable communication .  Any help or suggestion on how to solve this issue is very much appreciated.

 

Thank you for your time, happy Easter  and looking forward to your response.

 

Kind regards, Martin

Download All
0 Kudos
Message 1 of 27
(8,285 Views)

Hey SiddySl,

 

This can be indeed an annoying message, because this one of the most generic exceptions you can get.

 

First of all I have some general questions for you:

- Which OSes did you try?

- Where did you get these dll's from?

- Have you already contacted the manufacturer of the dll?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 27
(8,229 Views)

Hey Thierry, thanks for you reply. An annoying little bugger it is, I have been spamming the NI servers with crash reports the last couple off days. 

 

The answer to your questions:

- I have tried two systems with windows7 (full development) and one windowsXP system, (application only).

- I have obtained the dll and header file from a embedded system developer how used them to build a computer application in Atmel Studio

  (i think) to read the data from the device by USB. This application is working without problems, the files can also be found on the atmel site

   for instance in the AVR153 Application note software.

- No I have not yet contacted the manufacturer because the application from the embedded system developer is working, the files can be

  downloaded and there is documentation available on the site. Further I have just been working with labview for just a few months now (just

  invested in the full development suite a few weeks ago) and thought that I would probably make a beginners mistake.

 

Looking forward to your response,

 

Kind regards, Martin           

  

0 Kudos
Message 3 of 27
(8,221 Views)

Hello Martin,

 

Can you share the link with me from where I can officially download the software? (This would be useful as a reference for other online searches)

Where those OSes 64 bit or 32 bit?

Any extra information would also be useful..

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 27
(8,211 Views)

Sure, the link to the application note and software:

http://www.atmel.com/search.aspx?filter=0&output=xml_no_dtd&ie=UTF-8&oe=UTF-8&sort=date%3AD%3AL%3Ad1...

 

The windows7 systems are both running the professional 64-bit version and are up to date, the windowsXP system is the professional 32 bits version and is also up to date.

 

Also checked my logbook for extra information, what might be of interest is the following message I got a few times: Labview.exe there is no disk in the drive device\harddrive5\dr5. I believe this was a message from labview.

 

I'm not sure what extra information I could provide, if there is any specific information you need please let me know.     

0 Kudos
Message 5 of 27
(8,206 Views)

Hello Siddy,

 

How often do you get that last error? (eg. 1 out of 5 times)

This is a quite unusual error and could indicate that something went wrong with your installation.

 

The first thing I would like you try is deleting two entries in the .ini file:

- RecentFiles.pathlist entry

- RecentFiles.projectPathlist

 

Does this fix that issue?

 

From where did you install the environment? (dvd, network location, local download,...)

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 6 of 27
(8,185 Views)

Hi Thierry,

 

I have deleted the two entry's from the .ini file but unfortunately that doesn't solve the issue.

 

I have done some additional test and found two things that might be of interest:

- If I start the vi, let it run for a little while (say half a minute) stop the vi en exit labview than I get a crash report with the access violation and a warning from labview.exe, no disk (\device\harddisk4\dr4) (see attachment in Dutch).

- If I start the vi and just let it run after about 19 - 20 minutes to value is no longer updated and the readdata() returns a zero. When I exit labview I only get the access violation but no warning from labview.

- if I disconnect the device after it has stopt the state machine waits in "check device", if I reconnect the device the state machine identifies the device, sends commands (which I see in a USB monitor), readdata() returns zero and 

  the USB monitor I see that there is valid data available.   

 

On my main system the environment was first installed as a trial download (download), after the first trial period upgraded tot a professional trial and a few weeks ago In installed the full development suite 2013 (DVD) Far as I can recall I did not uninstall before upgrading to the full development suite. On my other computer also a bunch of trials (download)  where installed before installing the full development suite (DVD), on this system I did uninstall the trial version before installing the Full development suite.      

 

Thanks for your help, looking forward to your next message!

 

Martin

 

 

 

0 Kudos
Message 7 of 27
(8,177 Views)

Hello Siddy,

 

The first error does not seem to be a warning, but rather an error that can interrupt normal behavior.

Let us first try to resolve this.

There are 2 things I can think off straight away:

- There is a similar error related to DVD's where the error gets resolved by just entering a DVD in the DVD drive before starting LabVIEW or the exe that Requires the LabVIEW Run-Time Engine

- Does unplugging the network cable from the pc resolved the issue?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 8 of 27
(8,168 Views)

Hello,

 

I also now had a chance to check your code.

Is there a specific reason why you do not seem to be doing error handling in your state machine?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 9 of 27
(8,165 Views)

Sorry for the late reply, I was out of the office most of the day and unable to do the tests, the results:

-placed a DVD in the DVD player, started the vi, stopped the vi after about 10 seconds, yes on crash report no on labview.exe report (5out of 5), so that seems to be solved. I say first Kudo deserved! 😉

-disconnected the network connection yes on crash report no on labview.exe, also tested what happens if I let the vi run, after about 20 minutes the value updates stop etc. Etc.

 

The honest answer to your questions on the error handling in the state machine is that I have no clue how to do that. As I mentioned before I have just purchased labview a few weeks ago, and I'm trying

to find the time tot follow the online training core1,2 and 3. The trouble on this moment is that I first have to finish this and on other project and then I can focus on the training. So you understand your

help is much appreciated.

 

Regards, Martin         

 

0 Kudos
Message 10 of 27
(8,155 Views)