LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom signal generation analog output

Solved!
Go to solution

Hi,

 

I have a VI which generates a waveform based on values from an excel spreadsheet. I am trying to output this waveform through a DAQ. I am using a NI USB-6211.

 

I have copied the code for output to the DAQ from another VI which outputs a sine wave based on an excel spreadsheet. This program works fine. (attached for reference- Analog Output VI + Sine Waveform)

 

I am having two problems at the moment. Firstly, I am receiving error -200560 relating to the wait until done function, attached.

 

Secondly the output only rises to about 5.5V instead of the 9V specified in the data.

 

My VI generate several types of waveform depending on the tests selected but I am trying to get DAQ output working with the first test, named 'battery disconnect' working first before implementing it across the other tests so please ignore the others for now. To run this VI select battery disconnect under select tests then direct to the attached excel file (BD values under 10V).

 

Hopefully I have explained myself well enough, if not please ask more! I am new to LabVIEW so your help would be extremely appreciated.

 

Many Thanks,

 

Parker

 

 

0 Kudos
Message 1 of 6
(3,810 Views)

aeParker wrote:

I am having two problems at the moment. Firstly, I am receiving error -200560 relating to the wait until done function, attached.

 

Secondly the output only rises to about 5.5V instead of the 9V specified in the data.


1. You have your waveforms regenerating, which means the DAQ will just repeat your waveform.   Therefore, the task will never be done and your Wait Until Done just times out and gives you that error.

2. What is your Analog Output connected to?  Often when I see this issue, you are trying to drive something that needs more current than the AO can handle.  For that situation, you need to use an amplifier circuit that has a higher output current.

3. You can make your life a lot easier by using an Autoindexing Tunnel on your FOR loop.  That would eliminate the need for the Array Size (the FOR loop will know how many times to iterate based on the autoindexing tunnel), the Index Array, and your shift register with the Increment.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(3,789 Views)

1. I've just realied I was stupidly changing the timeout on the DAQWrite instead of on Wait Until Done. I have put the timeout to 20 seconds on the wait until done and no longer receive an error. The regeneration you mentioned doesn't appear to be an issue now, were you referring to RegenMode being set to Allow Regeneration?

 

2. At the moment the Output is simply connected to the input for monitoring purposes which forms the AO0 graph on the front panel for me to see what is going on.

 

3. I made the changes that you suggested but the only problem is the program doesn't stop at the end of the tests now. I think it just continues to go down the empty rows of the excel spreadsheet and just pass them through the loop?

0 Kudos
Message 3 of 6
(3,776 Views)

I have made some improvements to the VI but I am still experiencing the DAQ output capping at 5.5V.

 

Attached is the newer program and the spreadsheet of values. If anyone is looking to investigate please select test "Activation" and select the attached spreadsheet when prompted. The Output graph should follow the ignition voltage curve but instead caps at 5.5V until about 23s when the curve is <5.5V.

 

Does anyone have any ideas?

 

Also I'm very new to LabVIEW so general advice about my program is very appreciated.

 

Thanks,

 

Parker

Download All
0 Kudos
Message 4 of 6
(3,738 Views)
Solution
Accepted by topic author aeParker

@aeParker wrote:

I have made some improvements to the VI but I am still experiencing the DAQ output capping at 5.5V.


 

Dear Parker,

 

     I assume this statement is based on the values show in Chart AO 0.  However, this is not (necessarily) the Voltage being produced by AO 0, but rather the voltage being sampled by AI0.  If you look at the DAQmx Create Channel function for the AI Voltage channel, you'll see that you left the Maximum and Minimum Value inputs unwired, which means that they take their default values of +5v and -5v.  This may explain the clipping behavior you are observing.  Try wiring +10 and -10 and see if that fixes this problem.

 

Bob Schor

 

Message 5 of 6
(3,721 Views)

Right you are again Bob! A silly mistake as I thought it would be...

 

Thanks again for your assistance!

 

Parker

0 Kudos
Message 6 of 6
(3,694 Views)