05-13-2011 10:46 AM
I have a 0-10 volt signal from a sensor that I would like to read, multipyly by some scaling factor and output that result to an analog output channel. I set up an exampe that seems to work with a simulated device setup in MAX but doesn't work when I actually try to read and write from the actual device, USB-6341.
In my example ai4 is reading the 0-10 signal from the device, ai5 is wired to the ao0 channel (sort of a double check).
Any suggestions?
Thanks.
05-16-2011 11:00 AM
MeCoOp,
I am sorry that you are have a problem with this VI. When I ran your VI with a physical device and with a simulated device I seemed to be seeing the same results as you are. I noticed when I ran your VI I was getting error code 200561 at the DAQmx Write VI, is this the same error that you were getting? This error was essensially telling me that the voltage I was reading was out of the 0-5V range that you had specified in the DAQmx Write task. I was writing a negative value and thus out of range. I then changed my range to -5 to 5V and it worked like a charm. Could you try that and let me know how it goes? Also it sounds like from your application, you might want to consider using a custom scale. With a custom scale you can scale your data a lot easier than programming it inside of LabVIEW. Here is a link to a how to create a custom scale in Measument and Automation Explorer and then implementing it in LabVIEW.
Regards,
Brian P.
05-16-2011 11:15 AM
Thanks for the reply. I found an example this morning that put a bit of a delay for the analog output and it worked like a charm. Interesting to note I did have to change the scaling as well but the error you listed is not the one I was getting initially although I foolishly didn't make note of the error code. My next step is to take a counter measurement from the analog output signal. Any suggestions?
05-16-2011 01:23 PM
MeCoOp,
Taking a counter measurement from an anolog output signal can be a tricky thing. I assume that your signal that you are using are not TTL signals, our counters usually use a TTL signal to count. We can convert the signal to a TTL signal with some manipulation. You can either use something called a Shmitt trigger or the Anolog Circuitry to create a hysterisis window that will help you count the signal. Here is a Knowledgebase article that explains how to do this. This article calls for an E-series board but your X-series board should work just fine.
Regards,
Brian P.
05-16-2011 01:40 PM
How do you define a TTL signal exactly. The original signal is a 0-10 volt square wave. I'm simply trying to scale that signal down to 0-5 in hopes of using it to obtain frequency.
05-16-2011 02:02 PM
Here are the standards from a TTL signal. If it was originally a square wave then it might work to use wire that signal straight into the counter and the count from there. We have a few LabVIEW examples in our example finder that shows how to take the frequency of your signal using a counter. Example Finder » Hardware Input and Output » DAQmx » Counter Measurements » Digital Frequency. There are 3 different types that can be used depending on you Range or Frequency that you are trying to measure. They are 1 counter (low frequency), 2 counters (High Frequency) and 2 counters (Large Range).
05-17-2011 07:19 AM
I was under the impression that the signal had to be TTL 0-5V in order to wire it directly to the counter. My original signal is 0-10 volt square wave.
05-17-2011 09:04 AM
You are exactly right, I am sorry that I wasn't clear with my last post. What I meant to say is that you can wire that 0-5V output directly into your counter. Sorry about the confusion.
Brian P.