LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Math interface toolkit - warnings

Solved!
Go to solution
My apologies if this is a "read the manual" question, but I haven't been able to find the answer.
I have a vi for generating signals which I have converted using the MIT. When I run it in Matlab from the command window, I get no output from the DAQ card, and a warning:
Warning: DAQmx Stop Task.vi:1<append>
How do I get more information about what is causing the problem, an error code, for example?
 
What does the <append> mean in the above?
 
0 Kudos
Message 1 of 6
(3,279 Views)

CDancer,

Would it be possible to post the VI that you converted with the Math Interface Toolkit?  Which versions of LabVIEW, DAQ, MIT, and MATLAB are you using?

Chris M

0 Kudos
Message 2 of 6
(3,273 Views)

I can do that tomorrow. In the meantime, this is what I am doing, it's a finite analog output generation:

(1) Use DAQmx Timing (sample clock).vi to define the clock source and frequency for AO0
(2) Use DAQmx property node to set the buffer size for the analog generation.
(3) Use DAQmx Write (analog 1D dbl 1 chan N samp).vi to fill the buffer.
(4) Use DAQmx Start task.vi to start the generation.
(5) Wait for end of generation using DAQmx Wait until done.vi
(6) Stop the task.
(7) Clear the task
 
These are split between 4 vis:
 
Hardware initialisation (1)
Write data to buffer (2) (3)
Generate waveform (4) (5) (6)
Clear the task (7)
 
I have converted each vi using MIT. My reason for splitting the various functions was for code efficiency, the user will want to repeat generations or generate a series of different waveforms and I didn't want to clear and re-initialise every time.
The vi's work perfectly in Labview.
When I call the Generate waveform function in Matlab, I have noticed that it waits the expected time before returning the warning message - eg. if it's a 1 second waveform, it waits 1 second.
One thing I haven't tried yet is running the 4 vi's separately and sequentially in Labview. I have only run them together as sub-vi's.
I'm using Labview 8.5, DAQmx, and a PCI-6221. Not sure of other version numbers, PC is at work.
 
Chris
 
 
0 Kudos
Message 3 of 6
(3,265 Views)

Hi Chris,

Once you have generated mex-functions out of each of the four VIs, how are you passing the DAQmx refnum(s) between them in MATLAB?  One thing to try would be to create one single VI, then convert that with the Math Interface Toolkit.  I realize it isn't what you ultimately want, but it would help to narrow down on the cause of the problem.

Chris M

0 Kudos
Message 4 of 6
(3,260 Views)
>how are you passing the DAQmx refnum(s) between them in MATLAB?
 
I'm not, I am using a global channel name for the AO channel.
 
0 Kudos
Message 5 of 6
(3,253 Views)
Solution
Accepted by topic author CDancer

OK, I fixed the problem. It seems that when you configure timing for a global virtual channel the timing setup, buffer allocation, etc. is lost as soon as a vi exits.

Instead I created a new task using DAQmx Create Task.vi with my global virtual channel wired into it and Auto Cleanup set to false. Then I used the task name when writing the buffer and running the generation. When converted to Matlab functions using MIT it works fine.

 

0 Kudos
Message 6 of 6
(3,216 Views)