LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx task not functioning

Solved!
Go to solution
Problem Description :
Hardware: PXI-8184 (chassis PXI-1042), PXI-6221 (slot 2 in chassis)
Software: LV RT 8.5.1, DAQmx 8.7.1 (see MAX.jpg)
Problem: Task does not function within program (CounterRead.jpg). I can run the task within MAX (MAX.jpg) while the program is running and I can see the counts. All other tasks work fine. I have eliminated everything else in my
program except this task and it still doesn't function and I get no errors. Also tried putting the task directly in the main program to no avail. I've tried different types for the task (raw, Counter Dbl 1Samp, etc).
Thanks.

NI Software : LabVIEW Real-Time version 8.5.1
NI Hardware : PXI Controllers, Chassis, and MXI device PXI-8184
Driver Version : 8.7.1
OS : Windows XP
Download All
0 Kudos
Message 1 of 9
(4,406 Views)

Did you try a counter example shipped with LV?

 

If you get the example to work you can then find your mistake more easily.

Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 9
(4,398 Views)

I see you are using a shift register to store the task. Are you certain it is being initialised properly?

 

Do you have an error message which would help diagnose the problem?

_____________________________
- Cheers, Ed
0 Kudos
Message 3 of 9
(4,396 Views)

No error messages and yes, I'm sure it's being initialized correctly...I'm using the exact same structure for the other 3 tasks that work fine. I even eliminated the sub-vi, initialized in a frame before, etc. I'm scoped the hardware, so that is not an issue, which can be seen from the Counter.jpg. I did not write the initial code but I've debugged and understand how the program structure works. I'm still new to RT and find that debugging is not very simple.

The only thing I've seen in the forums close to this problem is using certain slots in the PXI. Almost ready to swap slots to see if the problem follows. Apparently this all worked awhile ago and works in several other PXI systems (I don't have anymore here now). Some changes were made, not pertaining to the counter...but I've taken everything else out to make sure that isn't causing the problem.

I know this is probably something simple, but another pair of eyes always helps! I do not have any other LV people here.

Thanks again!

0 Kudos
Message 4 of 9
(4,387 Views)

So does the VI just not return a value?

Have you tried stepping through the program or used highlight execution and see what is happening?

 

Could be a hardware issue if there are no software errors (is it plugged in? 😛 )

_____________________________
- Cheers, Ed
0 Kudos
Message 5 of 9
(4,381 Views)

I have stepped through (Counter.jpg) and I know the hardware is functioning (MAX.jpg). In the program, I see "0" all the time...in MAX I see it counting up.

Thanks.

0 Kudos
Message 6 of 9
(4,379 Views)

The only reason I can think of as to why it would not work, is that you cannot share hardware between MAX and a LV application at the same time - I assume it has been tried in just LV with MAX closed.

 

 Otherwise I cannot think of a sensible reason why it would work in MAX and not LabVIEW.

_____________________________
- Cheers, Ed
0 Kudos
Message 7 of 9
(4,364 Views)
Solution
Accepted by topic author teritask

It was an initialization error! A default case would wipe out the task name...it's the same for the other subvi's for the other tasks so I don't follow that. But, it works now that I totally simplified the subvi. Two other people worked on this before me (newbees) so I have a lot of clean-up to do.

Thanks for all the responses and sorry it was something so simple. Took me awhile to get back in the swing of debugging RT stuff.

0 Kudos
Message 8 of 9
(4,350 Views)
When I wire strucutures I always remove the default value on tunnels, so when I add a new event or case it will break the run arrow, forcing me to always define the value.
_____________________________
- Cheers, Ed
0 Kudos
Message 9 of 9
(4,346 Views)