From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Daqmx clear taks freeze

Hello,

 

I am facing a problem with clearing daqmx task, mentioned part of my vi in attachment.

LabView2011, Daqmx 14.0 - what happens is, that after the loop is finished because of any stoping signal, sequence freezes, and it takes like 5-10 seconds for it to clear the task and move to another stack.

Any ideas what might be the cause and how to fix it? The same vi runs on another PC and works fine. 

 

Greetings

0 Kudos
Message 1 of 20
(3,332 Views)
So much of your code is hidden. You should not need the local variables and stacked sequence structures are another big no-no. Please attach the actual VI.
0 Kudos
Message 2 of 20
(3,324 Views)

We need to see the actual VI?

 

What is the actual loop rate? Are you really prepending a 2D array as multiple columns to a 2D array in a shift regsiter without any upper limit. I can imagine that the memory allocation at each iteration is an absolute nightmare. Most likely a completely new memory allocation needs to be made every iteration and all old contents copied over.

0 Kudos
Message 3 of 20
(3,318 Views)

Dear friends,

 

I am aware that the code is not optimum at all, but I am not the author and my role is to get it running on another, 1:1 station, there is no time and resources to optimize the code.

 

The point is, that the same code works fine on another station. I am not realy sure if you need the rest of the code, this loop is started by setting DADES ON true, somewhere in the rest of the code and vi is supposed to collect data from analog inputs. After finishing specific movement, STOP DADES is set true (everything works nice and smooth up to this point, so the loop itself is not causing the problem) and what causes the freeze is DAQmx clear task vi (I tried DAQmx stop task vi, but same thing happens).

0 Kudos
Message 4 of 20
(3,290 Views)

Okay, here I attach simplified version of the problem, which still occurs - when I press DADES ON button, it comes back to normal state immidiately and counter Numeric starts to increase smoothly. Once I press STOP DADES button it remains grayed for about 5-10 seconds (when Clear Task vi is active) and then comes back to normal state.

 

I hope you will be able to help me on this problem right now, I will be thankful.

 

Greetings

0 Kudos
Message 5 of 20
(3,263 Views)

@PawelS wrote:

The point is, that the same code works fine on another station.


Then please tell us what's is different between the two systems (CPU, amount of RAM, DAQ hardware, DAQMX version, LabVIEW version, etc. etc.)

 

LabVIEW is realtively forgiving and typically runs OK even with horrible coding such as seen here, so we first need to know what else changed.

0 Kudos
Message 6 of 20
(3,234 Views)

I am not able to provide all of those information at the moment, but for sure DAQ hardware is the same, CPU and amount of RAM are the same or only faster/more, DAQmx version is 14.0 (older station probably has 9.7.5), both LabView2011.

 

Generaly idea was to copy all possible automation components and software, so differences will be rather insignificant and in advantage for the new station, where the problem occurs (like for example the same PC station wasn't any more avaiable, so there is similar model from the same producer). For sure I installed up to date DAQmx software.

 

Back to the code quality, I am aware that it is horrible, but as I mentioned before, I am not the author and I would love to prepare it all from the begining, but unfortunately there's no time - I just hope that my another LabView project will be a completely new solution 🙂

0 Kudos
Message 7 of 20
(3,215 Views)

Hi PawelS,

 

                   I would suggest to try something simple - a simple aquisition ( see the example attached ). If you encounter the same issue - then the problem is in your computer or the drivers, in which case you might want to reinstall/update DAQmx as a first step. Otherwise - if it works fine - I suggest you consider optimizing the code .... although, if you say that it's only the Daqmx clear task that freezes, then it should not be related to the code inside the loop. In the example that you have sent us, every time you press the button, the loop will execute only once, so even if the code is not efficient ( i.e. it will require some time to read all the samples in the buffer and insert them into the array ), it should not take too long. Problems will occure when you do it continuously.  

 

                   Please let us know how did it work out.

 

Denis

0 Kudos
Message 8 of 20
(3,199 Views)

Please find attached the example.

0 Kudos
Message 9 of 20
(3,191 Views)

Hello XEnderMD,

 

Did you forgot to attach the example? I can't see any attachment in your post.

Why are you saying that the loop will execute only once? It will execute untill someone press STOP button (see the loop condition) and that's how it works in real application.

 

Anyway, I think maybe it's worth trying to reinstall DAQmx, although it's almost most up-to-date version.

Thanks for the suggestions, I will let you know if reinstall solves the problem.

0 Kudos
Message 10 of 20
(3,189 Views)