LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program appears to work in virtual environment but will not write voltage

Solved!
Go to solution
I have a program that I want to use to output an AC voltage where the magnitude can change with the press of a button. I've attached the program. Everything appears to work fine (judging by the graph of the voltage!!) But when I attempt to run this program with the DAQ device (usb-6211), I do not get any voltage output as measured by my voltmeter. It's as if it is not writing the voltage. Am I missing something simple, or will this program not work? Many thanks.
0 Kudos
Message 1 of 12
(3,855 Views)

Mark,

 

How can you measure an AC waveform with a multimeter?  Also, I suggest that you use events - it's difficult to follow exactly what is happening here.

 

Cheers, Matt

Message Edited by mtat76 on 02-23-2010 03:29 PM
0 Kudos
Message 2 of 12
(3,848 Views)
Actually, I'm using an oscilloscope. I have a different program where I can measure the output voltage waveform using the oscilloscope, but the program is quite different. When I check the output voltage on the oscilloscope with this program, I get 0.
0 Kudos
Message 3 of 12
(3,837 Views)

Mark,

 

Here is what I am talking about.  However, from what you posted, it looks to me like you are trying to write to a digital line (PFI); you can not do this.  Can you switch the line to an AO and get the response you are looking for?

 

Matt

 

why not.png

Message Edited by mtat76 on 02-23-2010 03:45 PM
0 Kudos
Message 4 of 12
(3,831 Views)
I would suggest you start by using the internal clock and not stopping and clearing the task immediately after you start it. As Matt mentions, use an event structure and when you stop the VI, stop and clear the task there. As it is now, you can't stop the VI at all except with the teminate button on the toolbar and that's never a good idea.
0 Kudos
Message 5 of 12
(3,814 Views)
Thanks so much for the detailed response. I don't have access to my computer with labview until Monday, but once I get back I'll check this out and let you know how it goes. Thanks again.
0 Kudos
Message 6 of 12
(3,793 Views)

After sorting through examples and these explanations. I've began to realize that what I want to do is almost as easy as using one of the provided LabVIEW examples. My old program wouldn't write because I never allowed it enough time, before I looped through it again. If I introduced a time delay before clearing the task, I would get a sputtered waveform output. Which won't work, I need a nice smooth output wave.

 

The example that works great is the "continuous generate waveform voltage with internal clock" which I attached.  The only problem is that I need to be able to change the amplitude of the sine wave while it is running with the click of a button. For example, the program can run continuously with an amplitude of 5. But when I press a button, the sine wave must change to an amplitude of 10 for 0.5 seconds. On a previous post, a user helped me identify a way to do this using shift registers and the "get time" function and then comparing the times in a loop until the difference exceeded my time of 0.5 seconds. But that was with my previous loop program which didn't use the waveform timing and the output sine wave was really choppy. 

 

In this example, I don't see how you can change the amplitude of the sine wave. Is it even possible, or do I have an impossible task??

 

 

0 Kudos
Message 7 of 12
(3,768 Views)
Solution
Accepted by topic author mark308
You are using the wrong example. Look at Cont Gen voltage Wfm-Int Clk-Non Regeneration.
0 Kudos
Message 8 of 12
(3,762 Views)
Thanks a bunch!
0 Kudos
Message 9 of 12
(3,752 Views)
The program is working fine with one exception. When I trigger the change in amplitude of the sine wave, the amount of time required to complete a loop is such that I need to have the amplitude change for 0.25 seconds. I was hoping for a very short burst. Even if I take the timing out of the block diagram, and simply have the amplitude change when the latch is pressed and immediately return to the original amplitude, the "burst" lasts for a good period of time (I'm guessing about 0.25 seconds) which is what leads me to believe that it is taking 0.25 seconds to run through the loop. This seems very long. Is that simply how the sine wave generator and wave-form timing work. I don't have anything else going on in the "while loop". Can the change in magnitude be applied to the nonregeneration voltage for just a tiny impulse?? Thanks for any insight and taking the time.
0 Kudos
Message 10 of 12
(3,712 Views)