LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting I2c to out put on a DAQmx USB-6009

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 

0 Kudos
Message 1 of 10
(3,345 Views)

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.

0 Kudos
Message 2 of 10
(3,336 Views)

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.   

0 Kudos
Message 3 of 10
(3,335 Views)

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? 

0 Kudos
Message 4 of 10
(3,334 Views)

If you are getting data and doing something with it right away, I would put the DAQ assistant in the same while loop.

0 Kudos
Message 5 of 10
(3,330 Views)

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.

0 Kudos
Message 6 of 10
(3,327 Views)

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.

0 Kudos
Message 7 of 10
(3,324 Views)

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 

0 Kudos
Message 8 of 10
(3,322 Views)

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.

 

Message 9 of 10
(3,316 Views)

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.

0 Kudos
Message 10 of 10
(3,311 Views)