06-30-2017 11:30 AM
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:
The configuration of the task is:
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:
with the configuration;
and the last task:
with the configuration:
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
Solved! Go to Solution.
07-03-2017 07:10 AM - edited 07-03-2017 07:22 AM
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:
into thisBy 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:
With the change detection configured in MAX, not using the daqmx functions.