LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

exception C0000005 in niNIESR100 tAllImmediateTapSupervisor

Any update on this error, it is still occurring with the latest version of LabWindows RTE (7.1.1) and NI-DAQmx 7.5.

It was mentioned that the problem may be occuring during the destruction of a task.  Is that still the case?  If so what types of task destruction should I be trying to track down and what type of failure would cause the execution of the program to stop completely?

Ken

0 Kudos
Message 21 of 26
(1,426 Views)

Hi Ken,

I took a look at your code and the following line really stuck out to me:

   while (DAQmxFailed (error = DAQmxTaskControl (taskHandle, DAQmx_Val_Task_Reserve))) {

      Sleep (1);

   }

It appears that you are sitting in a loop and simply trying to call a function in the driver.  Further in the code you can see that the code keeps polling the driver until it is.  You also said that you are running this on different systems.  What that means is that one system could be using the driver and in the process or creating or destroying a task and that another computer is trying to poll the driver to see if it's available.  Evidently there are a few rare instances where the two processes occur at the same time and then it causes this error that you are seeing.

I think that the best way you could get around this would be to have some sort of indicator that the driver is in use.  This could be something rather simple like a semaphore that simply is used so that you can see if the driver is being used.  Once the driver is no longer in use, then your other application could attempt to create a new task to access the driver. 

This would also prove to be beneficial because it would help to free up your CPU as it would not have to be continuously polling the process. 

I think making these changes will help your process become more efficient and prevent the errors that you are seeing from occurring.  Let me know if you have any more questions and we can see what else we can work on.

Regards,

0 Kudos
Message 22 of 26
(1,413 Views)

Thanks Otis,

Do I need to create a third application or dll that implements the semaphore so both instances of the program can access it?  More importantly, why can't this be implemented directly in the DAQmx driver?

Also, you may have noticed that the main portion of my code where the acquisition occurs does not create or delete the tasks.  This is done at the start and end of each cycle which lasts about 6 hours.  The program crashes at random times during the cycle.

0 Kudos
Message 23 of 26
(1,407 Views)

Hi Ken,

I talked with a few people and I think what may be easiest is make some sort of global variable in your program.  Essentially you could have a global (or some sort of DataSocket value) that is set to True (or 1) when one controller takes control of the application.  Then at the end of the program the global could be set back to False (or 0).  Then in your application, instead of polling to see if the driver can be accessed simply poll the global variable.  If it's True that the driver is in use, then do not try to access it.  If it is False then you can try to access the driver.

Regards,

0 Kudos
Message 24 of 26
(1,377 Views)

Hi Otis,

Unfortunately, I can't just not access the driver if its busy.  I am running a PI controller that requires feedback from the DAQ card so I need some type of event or trigger to indicate when the driver is available.  I tried using the DataSocket for synchronization when I first started developing this application but it never worked--I was only able to transfer data to the DataSocket server.  That was back in CVI 5.1 so maybe it will work now.

Ken

0 Kudos
Message 25 of 26
(1,372 Views)
Hi Ken,

I still think that setting up something with a DataSocket (DataSocket Tutorial) connection would work out best for you.  Essentially you would make some sort of value on the acquisition machine and then have that value set to 0 or 1.  You could have the subscriber computers looking at the DataSocket value and if it's a 0 take control of the computer; otherwise, continue polling for availability.

There have been a lot of changes in CVI since 5.1 so I would not be surprised if you find it simpler to get DataSocket working now than you did then.  Here are some examples that show how to do DataSocket with CVI :
Simple CVI Samples That Use the DataSocket API
DataSocket Reader and Writer Combination

Since you have multiple computers trying to access the same information then you will need to be careful to keep in mind the principles learned in the famous "The Five Philosophers" situation.  Essentially there is a chance that 2 computers could read a 0 value and try to take control at the same time, so you will need to make you program where it prevents situations like this from occurring.

Regards,

0 Kudos
Message 26 of 26
(1,354 Views)