LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -50808 Occurs whenever my task is started.

Solved!
Go to solution

The error given by my program is: Error -50808 occurred at DAQmx Start Task.vi:7220011. I am using Labview 2016

 

The portion of code where the error occurs is:

 

Code segment.PNG

The configuration of the task is:

Task configuration.PNG

 

The two channels being used are in a NI cDAQ-9178 chassis, I have tried both a NI-9230 and NI-9234 module and gotten the same result. I am using channels ai0 and ai1. 

 

Now, what happens is every time that this task is called, the device immediately connects and disconnects. after the device disconnects, it needs to be unplugged and plugged back in before anything on the device can be used again. This segment of code currently is just executing in the main part of my code, it originally ran in one of my subvi's and was causing this issue, but had the same issue when I moved it out of the other vi. there are two other tasks in the program that use the same chassis. They are:

 

Task 1.PNG

 

 

with the configuration;

 

Task configuration.PNG

 

and the last task:

 

Task 2.PNG

 

with the configuration:

 

Task 2 configuration.PNG

 

I have tried repeatedly disconnecting it and running it again, it does it every time.

 

As for the rest of my code, there is a few buffers that are waiting on the port inputs to change, so none of them are running up until the second task I have shown excecutes, and I don't have anything connected to the digital inputs currently, so the rest of the code won't execute. I have also attached my code.

 

Any help that anyone can provide would be greatly appreciated.

 

Thanks 

0 Kudos
Message 1 of 2
(3,807 Views)
Solution
Accepted by topic author Nevenhouse

For anyone who runs into this same error, I have figured out a way to fix it, though it seems to actually be an internal error to Daqmx of some sort, not what the error describes. The fix ended up being relatively simple, I changed this portion of code:

 

Task 1.PNG

 

into thisCode Fix.PNGBy changing the change detection for the for this set of code from the individual lines to any change of the port, this error disappears. 

 

My best guess is that this error has to do DAQ resource reservations. A timer or a counter is probably reserved in the background without it being directly visible, and because I was using the lines instead of the port, it probably reserved all available resources. When the accelerometer task when to reserve the resource, the system didn't catch that the resource was being reserved by two separate tasks and being told to do opposing things, the end result probably caused the driver for the cDAQ to crash causing a communication failure.

 

EDIT:

 

I apologize, I posted the wrong image above. this is the correct method:

 

Code fix 2.PNG

 

With the change detection configured in MAX, not using the daqmx functions. 

0 Kudos
Message 2 of 2
(3,722 Views)