LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx task unnamed when subVI called

Solved!
Go to solution

Dear all,

 

I built a subVI based on a state machine architecture.

Inside this VI, I use multiple DAQmx tasks without problem.

When I call this subVI from the main interface, It has errors coming from the tasks that appear to be unnamed.

I don't understand why this subVI is running properly when it is called directly and why it has errors when it is called from outside.

Unnamed Task.PNG

Could you help me please?

Best regards.

Sébastien

 

Here is the diagram of the subVI. The error appear when calling the "DAQmx Write" vi:

SubVI.PNG

 

0 Kudos
Message 1 of 3
(3,604 Views)
Solution
Accepted by topic author MAILFERTSeb

Dear all,

 

I found the solution.

When running the subVI alone, there were no apparent error but when called from outside, the error apperas.

In fact, in my stae machine, one state was repeated until an event occurs and then called "DAQmx start task" at every loop.

This was transparent Inside the subVI (this is really Strange because this is an obvious error) but crashes when called from the main VI.

Sorry but this can help people to know where it can come from.

Best regards.

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

[Edit: OP had own solution by the time I finished my post]

 

The error text for the -200547 code describes things pretty clearly.  Apparently, you attempted to write data to the task more than once before starting it, and this isn't allowed.

 

Seems like you need a closer look at your state sequencing logic to figure out why the behavior is different when you run from your "main interface."

 

 

-Kevin P 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 3
(3,571 Views)