06-07-2010 11:25 AM
I have a test application which communicates via a USB-8473 CAN bus interface. The application works fine until I try to run it as a .NET web service. When run as a web service I get a "(Hex 0xBFF62002) An internal error occurred in the NI-CAN driver. A description is located in the file NicanErr.txt in your ..\NI-CAN\bin folder (typically located at C:\Program Files\National Instruments\..). Solution: Email or fax the NicanErr.txt file to National Instruments for tech" error. Initially I was not getting the NiCanErr.txt file, but I enabled writing to the specified directory by the ASP.NET user and now I get the following NiCanErr.txt contents:
[OSINFO_SECTION]
OS=Microsoft Windows XP Workstation
Service_Pack=Service Pack 3 (Build 2600)
[CURRENT_SECTION]
Section_Index=0
[DRIVER_VERSION_SECTION]
NICANFRM.DLL_VERSION=2.5.4f3
DRIVERS\NICANPK.DLL_VERSION=2.5.4f3
NICANPU.DLL_VERSION=2.5.4f3
NICANTSK.DLL_VERSION=2.5.4f3
NICANCFQ.DLL_VERSION=2.6.0f0
NCVI.DLL_VERSION=2.6.1.8198
NICAN.DLL_VERSION=2.5.4f3
NICAN_S1.NFW_VERSION=2050300
NICAN_S2.NFW_VERSION=2050300
[INDEX_1]
Local_Time= 06/07/2010 11:39:55.421
Err_Status= Status:0xb1020002-Location:0x30000000-Internal:0x01020000
Function= ncOpenObject-CAN8
I really need to get this working within the web service context. Any help on troubleshooting this would be appreciated!
Thanks,
Richard
06-08-2010 11:54 AM
Hi Richard,
Thanks for posting on the NI Discussion Forums! I looked into this a little further for you, but unfortunately, the NI-CAN driver does not offer .NET support.
06-09-2010 07:43 AM
Thanks for the reply. Unfortunately I don't think you understand my problem. The NI-CAN support works fine from my VB.NET application. The problem arises only when I try to execute that application from within a .NET web service. It seems likely there is some issue of the NI-CAN library using a resource which is accessable from an application running outside the web service context, and not being able to from within the web service context. The Error log file appears to point to a specific location in the code where the problem arises but the reported error isn't specific as to what the problem is. What is the NI-CAN library and/or driver trying to do at the point of the error?
Thanks,
Richard
06-10-2010 03:09 PM
06-10-2010 04:30 PM
06-11-2010 09:03 AM
Hi Richard,
I did look into obtaining more details on the error and have discussed it with my colleagues, but again, because we haven't previously tested the NI-CAN driver in this setting, we don't have a record of exactly what the error represents. I wish I could be of more help to you, but unfortunately, our resources are limited with NI-CAN applications in .NET interfaces.
06-11-2010 09:37 AM
I appreciate you're feedback and I understand the issues of limited resources as well. My questions have more to do with a concern that you're focusing on the wrong part of my question. The application and NI-CAN function calls all work fine in the context of a regular GUI user. It's not a question of whether I can use the NI-CAN API from a .NET application. That already works fine. It ONLY fails when run as the user identity under which web services execute. My question is "Why does that matter"? What resources is it trying to access that are available when running as an interactive user that are not available as the non-interactive user identity used to run the web service?
Thanks again for your responses.
06-14-2010 03:46 PM
Richard,
I did some further research with other colleagues in R&D and was able to identify that the reported internal error is a result of the operating system being unable to create a Mutex. A Mutex is requested by NI-CAN when calling openObject to ensure that the object can only be accessed by one thread at a time. Unfortunately, since we haven't tested NI-CAN in .NET Web Service applications, it is hard to know what a suitable workaround would be. Perhaps you can use this information along with other web resources to get around this.
06-15-2010 07:45 AM
THANKS! That sounds like it could be a really useful piece of information! I'll see what I can come up with.
Is there any indication as to why the Mutex couldn't be created? Is it a permissions issue?
Thanks again,
Richard
06-16-2010 05:03 PM
Richard,
I don't really have more information than what I previously posted, which is that the operating system failed to create a Mutex.. sorry!