Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Input - Analog Output Simulataneously

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.

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 1 of 8
(3,462 Views)

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. 

Applications Engineer
National Instruments
Message 2 of 8
(3,441 Views)

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?

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 3 of 8
(3,438 Views)

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.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(3,431 Views)

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.

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 5 of 8
(3,428 Views)

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).  

Applications Engineer
National Instruments
0 Kudos
Message 6 of 8
(3,425 Views)

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.

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 7 of 8
(3,414 Views)

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.

Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(3,409 Views)