From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to read out analog voltage signal to oscilloscope, but it's extremely choppy and stops

Trying to generate a sine wave that I can control the amplitude and frequency of. I'm wiring that output into DAQmx (using NI PCI 6221 for DAQ) which outputs to a BNC2110 block which I have connected to an oscilloscope.

 

The oscilloscope keeps showing the wave blinking in and out of existence, and eventually it just stops triggering.

 

I also connected an indicator to the "# of samples per channel" wire on the DAQmx write function and it comes out 1000. How can I just get a single continuous sin wave outputted that's stable over time? I've attached the VI.

0 Kudos
Message 1 of 3
(2,569 Views)

Don't create the task in the loop.  That should be done before the loop.  Right now you are probably burning up resources by creating tasks endlessly and never clearing them.  Eventually your PC will crash.

 

The Clear Task should be added after the loop.

 

Set up your taks for continuous samples in timing and regeneration.  Look for DAQmx examples in the Example Finder under Help to see how to do it.

0 Kudos
Message 2 of 3
(2,540 Views)

You clearly read the "Learn 10 Functions in NI-DAQmx" article I mentioned to you in yesterday's post, but you didn't read it carefully.  Included in there was code that I believe will do exactly what you want to do.  Did you try using MAX to "play with" your device?  

 

Bob Schor

0 Kudos
Message 3 of 3
(2,504 Views)