09-19-2011 11:01 AM
Hello,
I am pretty new to lab view so bear with me. I have a program written so far for an accelerometer hooked up to a USB-8451 reading i2c. This part of the program is perfectly fine the problem is that i need to send this information back out by using a DAQmx USB-6009 analog signal. I am not sure where to begin really i figure i would use the DAQ assistant vi but im not really sure if that is all it takes. ill post my code so far. Thanks in advance
Cliff
Engineering Intern
09-19-2011 12:38 PM
Do you want your DAQ assistant to be outside the loop? Right now, nothing is sent to the DAQ assistant until you hit the stop button on your VI stopping the while loop.
09-19-2011 12:39 PM
For a bit more information it would be easier if i could take the data going into the different axis graphs (x,y,z) and directly output that through the DAQ if that is even possible. Right now i am just using a scope to read the output channel and nothing is happening. I also realize that for this specific device there are only two analog channel outputs so i can't possibly fit on the data i want to see but just being able to output one will work for right now.
So far i have tried using the DAQ assistant and manually creating my own DAQ write with the DAQmx function pallete however neither has worked and i feel i am overlooking something.
09-19-2011 12:41 PM
i would like the DAQ to be continuously outputting values as the response to the accelerometer and have put it in its own while loop outside the orginal is this correct or should it be in the first while loop?
09-19-2011 12:44 PM
If you are getting data and doing something with it right away, I would put the DAQ assistant in the same while loop.
09-19-2011 12:52 PM
With the DAQassistant is there a way to link my data to have it output the same data because the only options it seems is just a constant DC voltage output on my scope. It seems like even though my data is wired to the DAQ that it overlooks that and just outputs the voltage in the DAQassistant settings.
09-19-2011 12:55 PM
Your DAQ assistant is set for 1 sample (On demand) so it is only going to output 1 value per loop iteration, probably the first data point in your array. Try setting it for N samples. Be sure to set all of the DAQ timing parameters as well.
09-19-2011 01:04 PM
I tried that and i get an error 200077 it says i have requested sample clock but i can select on demand i even turned down the sampling but it still keeps giving me that error and with the on demand i am now getting a a slight response but an error keeps coming up saying i'm out of range of the 0-5v
09-19-2011 01:38 PM - edited 09-19-2011 01:41 PM
First look at the data you are trying to send. Is it between 0 and 5 volts? Are there any bad data points in there? Do you need to scale the data from one range to the 0-5V range? My guess is that you are not scaling the data properly. You are getting U16 data out of your subVI and coercing that to a double. Since the expected range is 0-5 volts, only 6 values out of the 65,000+ are valid and won't generate an out of range error.
For error -200077, the error says you have picked a value not supported for that property. What value have you picked for your sample rate?
IF your right click on your Express VI and choose Open Front Panel, you can turn it into a regular subVI that you can open and see what it is doing. There you should be able to see in a little finder detail what the different properties and values mean.
09-19-2011 01:44 PM
It was a scaling error it seemed i corrected it and it is running find and as far as the sample rate goes it is working fine at on demand so i'm not going to change it thank you Ravens fan.