06-14-2007 02:24 PM
06-18-2007 10:04 AM
Hi,
1) This error message indicates the combinations of input parameters for this VI are such that the analog output sampling rate is too great for the device.
Please see the following knowledgebase article to learn more about this and how you can resolved this issue:
Why Do I Receive Error -200016 When I Run DAQ Shipping Examples with the NI DAQPad-6015/6016?
http://digital.ni.com/public.nsf/allkb/8B2BAB87BCAB2D9C8625712B00559824?OpenDocument
2) I have noticed that you haven’t used any timing functions within the loops to allow you to achieve software timing.
Please see this article for further information:
Software Timed Loops using Wait (ms) and Wait Until Next ms Multiple
http://zone.ni.com/devzone/cda/tut/p/id/4120
With the USB-6009 vi I have noticed that you have two loops. One with software timing and the other without.
3) USB-6211 can certainly output 1KHz signal but I am sure you can also do that with the USB-6008/09 please check 2 and 3 first.
If you are new to LabVIEW I would like to suggest pursuing a LabVIEW basics 1 course. The courses offer:
The most efficient way to learn LabVIEW
Training courses for new and experienced users
Hands-on training with experienced LabVIEW instructors
Basics courses to help you get started quickly
Intermediate courses to help you learn how to optimize applications
Advanced courses to help you learn advanced features and architectures
If you don’t have the time to come on a course you can choose to purchase the manual and self pace the material in your own time. If you would like further information on content, quotes, promotional offers etc for LabVIEW or other National Instruments courses then please do not hesitate to let me know in reply.
I hope this helps!
Kind Regards,
Kirtesh Mistry
06-18-2007 11:16 AM
Hi Kirtesh,
Thank you for your comments. I need a few clarifications:
1. As you can see from my VI, I want to input the data to be output using a spreadsheet of the waveform data- this gives me a lot more flexibility. So for this format and with the simple DAQ Assistant output how do I set the "samples per buffer" and "cycles per buffer"? In the example you have pointed out these are in the form of inputs to Labview function "waveform data".
2. The software loop attached does have timing within in the form of a "Wait (ms)". The second loop above the software loop is for my analog inputs. When I tried this software loop alone (and with the loop AI loop) I had issues with timing and low rates of output, please see my earlier post: http://forums.ni.com/ni/board/message?board.id=170&message.id=247895#M247895
3. The USB 6009 can only do 150S/s and my software-timed loop indicated that this cannot be achieved either at any regularity- so it won't do for me. I want to get the hardware-timed loop working before I purchase anything else, to make sure to get the right one. I basically need one sample/ms to be output from my spreadsheet data which has been converted into an array so it loops repeatedly. I need the timing to be quite exact between the outputs.
thanks,
Chanchala
06-21-2007 07:00 AM
HI there,
Just take a look at this.
See if it works?
Thanx
AdamB
06-21-2007 09:11 AM
Hi Adam,
This works with the USB-6259 (though not with the 6015). However I need the exact timing (when the ramp starts and stops) so I can relate this to analog input data that I'm collecting. With your vi, my 'Write to Measurement File' X column is no.s 1-1000 (and repeats again 1-1000) and no longer time. I tried using an 'Elapsed Time' function and wiring the present(s) to the 'Write to Measurement File' but I only get the time every 1000 points. Is there a way of writing the time for each of the 1000 data points that makes up my ramp?
thanks,
Chanchala
06-21-2007 09:38 AM
Hi again,
What we are doing is sending a series of 1000 points to the card buffer. The speed of the ramp etc is depicted by the rate at which you output those 100 points. For example if you want your 1000 points to be completely finished within a second, set your output rate to 1k. If you want the ramp to take longer, decrease the output rate of the card and vice versa.
I assure you that the card has very accurate hardware timing and so the rate you set will be very closely matched with the Hardware rate of the output. So from the start of the test, every point will be exactly 1/1000th of a second later.
Therfore if you creat a waveform (as you did previously) onle once, before the write to DAQmx Card, and set the "t0" as the current time (start time) then set the "dt" to be "1/rate" the rest of the waveform will have the time values.
Does that make sense?
Thanks
AdamB
p.s another way of doing as you ask is to use teh DAQmx lower level functions. From here you can export the "AiSampleClock" to the "AoSampleClock". This will synchronise the inputs and outputs. You could then read the analog input as a waveform, and the first point in that waveform will match the first point you outputted almost exactly.
It might be worth looking at some examples in the example finder.
06-21-2007 09:45 AM
Hi Adam,
I can't open your attachment because I have Labview 8.0 and yours is 8.2. Could you please re-post the attachment so I can open it in 8.0.
thanks,
Chanchala
06-21-2007 10:48 AM
Sorry about that
AdamB
07-09-2007 11:28 AM
Hi Adam,
Sorry about the delay with this, I had some other work to do so could not work on this for a while.
I'm working with the USB-6259.
The code you sent me above: Flow%20Loop1-USB6015-hardware%20timed%20AO[1].vi works fine when I change Timeout to -1 (from default of 10s in DAQ Assistant). I also added Elapsed Time- Present (s) and am writing the Analog Output data to a Measurement File- see attachment. My problem is that the Elapsed Time is giving me crazy times when compared to what I would expect:
So at a rate of 100Hz AO; with 2000 points in my spreadsheet, I get the Elapsed Time noted every 2000 points (every repetition of my spreadsheet data). It gives: 0....33.282....73.282....113.282s. What is Elapsed Time recording (computer time, or DAQ onboard clock time)?. I would expect at the rate specified: 0....20...40...60...80 etc. I am happy with what you tell me that my output in this case should be at exactly 1/100th of a second as specified, but Elapsed Time is telling me otherwise.
I coupled the above code with Analog Input readings- again see attached- and wrote to measurement file together with Elapsed Time. This time I compared the values in X-column, which I believe are time (DAQ onboard clock), to Elapsed Time, again the two are different. Where X column gives 0, 0.002, 0.004....2.000....4.000...6.000; elapsed time gives (every 1000 points the time is recorded in this case) 0.....2.125.....4.109...6.125.
I also tried the other code you sent me: NewSynchInput-Output[1].vi. However, I need my AO rate to be much slower than AI rate and when I specified different rates, the Elapsed Time indicated that AI seemed to wait for AO to complete its slower output. So for eg. at an AI and AO rate of 1kHz, it gives time in X column for AI (every 1000): 0...1.000...2.000....3.000 and in elapsed time: 0....2.297...4.313...6.329. AO Elapsed Time gives (every 1000): 2.297...4.297...6.297.
As I mentioned before I need the timing between output and inputs so I can compare the two at the exact same time. The AO is to a flow control valve and AIs are from sensors in the flow. I also need the output/input intervals to be very accurate.
thank you,
Chanchala
07-12-2007 08:20 AM