LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 200294 in Daqmxstart task

Solved!
Go to solution

So I decided to modify the code that way im not always reading. I created a case structure. when it's true I write data and when it's false i do  nothing. but when I turn the case to falso I get error:

Error -200621 occurred at DAQmx Write (Analog 1D Wfm NChan NSamp).vi:6390002

This is what the explain error give me:
Onboard device memory underflow. Because of system and/or bus-bandwidth limitations, the driver could not write data to the device fast enough to keep up with the device output rate.

I notice when that happen the size of my data  being read changed. It usually is 20 x 1613 but changed  to 20 x16.

 

Also What is I wanted to select the channels I want to feed the waveform to, how would I go about that. Right now I am feeding the waveform to all 8 channels. I tried the waveform as 1x1 array but I get error 200524. Help please

see attached, it is only a modified portion of my code. I initialized 8 channels and used Diane S model to do the data read and write. 

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 11 of 41
(2,332 Views)

I realize I had some missing Vi. Here's one with all the Vi attached

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 12 of 41
(2,319 Views)

There's not enough information in what you posted for me to be able to tell exactly what's going on, since just showing me the AO code is only half the picture.  I can make some guesses, but I'd like to see more code...specifically, your entire DAQmx loop which contains both DAQmx Read and DAQmx Write. 

 

Note that since those operations are synchronized, if you call DAQmx Read without also calling DAQmx Write (you know, as happens when your case structure is in the False case), you're going to get buffer errors.  You need to call them both, exactly as I showed in an earlier post, every loop iteration.  They are synchronized.  They need to stay synchronized.  Calling one without calling the other ruins the synchronization.  Therefore...

 

If you don't want to Read with every loop iteration, too bad.  You still have to do it.  However, what you can do is decide to either ignore the data you read, or do something with it.  If you don't want to send it to another loop for processing (for instance), have your Enqueue function in a case structure and then have logic which either enqueues the data or not.

 

Same with Write.  You need to write data with every loop iteration.  If you don't want to output any voltage on your AO lines for a particular loop iteration, write an appropriately-sized 1D array of waveforms where the data is all zeroes, so that the channels output 0V.  It's your waveform generator that needs to be in your case structure, not DAQmx Write.

 

You also need to write to all of the channels with every loop iteration.  If your task contains 8 channels, then you need to write to all 8 channels.  If you only want a waveform coming out of channel 0, then write a waveform of the same size and sample rate, but containing all zeroes, to the other channels, so that those lines will output 0V.  But you always need to provide a buffer for all channels in your task.

 

Please post the code which contains all of your DAQmx operations, and we'll take it from there.  Sound good?

 

 

0 Kudos
Message 13 of 41
(2,299 Views)
Understood. To answer your question about the write part. What you mentioned is what I exactly planned to do. When I do want to write I tried to write all zeros. When I tried to feed it an empty constant waveform I get the 200621 error. I tested using 0 freq and amp with a fs and #s of 1000 and a sine wave and it works. But that's not what I want. I want it to output all zeros data so I can see only noise.
For the 8 channels issue, keep in mind I'm using a client to send command to the server which is what I'm having issues with. I want to program that in a way I can index in an array of channels and applied that waveform to which ever one I want to. Hope that's clear for you. In other words if I want to apply the waveform to channel 0. Let's say from the client side I have a listbox where channel 0-7 is listed and have index values 0-7. I send the index value to the server by selecting the channel on the client. When the server gets it. It select index 0 from the array of channel. Feed channel 0 to daqmx write and of corse write the waveform to that channels. Mind you the list also have multi selection mode. My problem now is to get the array of task name and index it. My other problem will be how can automate so it can generate the arrays size of the waveform based on the arrays size of the channels. Please lead me to the right direction.
0 Kudos
Message 14 of 41
(2,291 Views)
Also it's a lot of subvis in that's code. Last time I tried to upload a zip file. It was too big and I couldn't upload it.
0 Kudos
Message 15 of 41
(2,290 Views)

Your explanation isn't really very clear.  Also, if you can't upload your entire code (which is fine), then take the time to write an example which illustrates your problem, and upload that.  You need help, so it's up to you to make some effort here.

 

I'm not understanding your problem very well.  Ok, you have a client which tells you which channel upon which to output data.  Output data on that channel and output all zeroes on the other channels.  Why is that a problem?  Of course you cannot use an empty constant waveform, I pointed that out in my very first response to this thread.  I have no idea what you mean when you say "I want it to output all zeroes data so I can see only noise".  Then build a waveform which outputs all zeroes, as I advised...why is that difficult?

 

None of this is difficult, so I think you might just be confusing yourself!  If you configure a task with 8 channels, then you must have data for all 8 channels.  That is a requirement.  You cannot get around it, so you need to work with it.

 

Look at the code below.  If you don't understand something, try the LabVIEW help first.  It really is a wonderful resource!  Then ask for help.  Before you ask for more help, write the example code that illustrates your problem.

 

waveform array creation.png

 

 

0 Kudos
Message 16 of 41
(2,282 Views)

Thanks for your reply, Here's my server vis. see attached

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 17 of 41
(2,266 Views)

Wow, that's some messy code.  I'm not trying to be mean, but readability is very important.  You have wire bends all over the place, many of which are hidden by various structures so you can't see which terminals are connected where, you have way too many error wires -- your next step should be to tidy up, to help you (and others!) read your code easily.  Use a single error wire to enforce data flow.  Branch where necessary, then recombine.  Straighten out your wires.  All of them.

 

That being said, you've done a nice job with adding comments here and there, especially in your case structures, so good for you!

 

I'm not sure what further help you need.  I've already told you that you need to take DAQmx Write out of the case structure.  So take DAQmx Write out of the case structure.  I've already shown you how you can write a waveform only to selected channels, and write a waveform containing all zeroes to the other channels in the task.

 

You do have one problem with your DAQmx task setup that I can see.  You're set to start your AO using the AI Start Trigger.  Therefore your Write task will start when your Read task does.  Right now, you're not controlling the order in which those tasks start, and you need to.  Don't start your Read task until after your Write task has started.  Use the error wire to enforce that:

 

Call DAQmx Write to preload the buffer.

Call DAQmx Start for your DAQmx Write task.

Route the "error out" wire to the "error in" input of DAQmx Start for your Read task.

 

Now your tasks are synchronized.

 

It seems like I've already told you how to solve your main problems, so try incorporating my advice (after cleaning up your code) and see how you do.  Ok?  I'd still recommend putting together a little example application for yourself which concentrates on the DAQmx aspect.  Experiment with only outputting a sine wave on selected channels, as I showed you.  You need to develop a bit more understanding of DAQmx, and taking it one piece at a time will help you.  I frequently write little examples for myself when I'm trying to understand a concept, so I can play with things and see how they work.  It's very valuable.

 

You've come a long way, so don't give up now.  Keep working at it!  You're doing fine.

0 Kudos
Message 18 of 41
(2,254 Views)

I know thanks for helping. I appreciate it very much.

Somewhat that 200621 error keep popping up. and when it doesnt happen the server works fine. As soon as I select the channel I want to affect with the waveform it crashes and give me error 200524. I 'm trying to troble shoot it but I cant seem to put my hands on it yet.

0 Kudos
Message 19 of 41
(2,246 Views)

I see one issue. Inside the for loop when you select 2 channels, that changes the dimension of the array from 8 to 10 therefore causing the 200524 error.

0 Kudos
Message 20 of 41
(2,238 Views)