Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a pulse with the waveform generator?

Solved!
Go to solution

The error is due to the fact that you have two oscilloscope VIs on the same diagram running without setting the Stop value on the first to true. Basically, the sample clock is already running because it was started with the first call and never stopped. Then, when it gets to the second one, the sample clock attempts to sample the data before it's ready. Is there a reason you are using two VIs? Both channels can be read from the same scope VI and even combined into the same graph using the Merge Signals function as shown below.

 

ElvisScope.png

 

In response to your other questions, you can use the oscilloscope to view the analog input channels as well. In the express VI configuration or the soft front panel, there is a Source control for each channel that contains not only the SCOPE channels, but also the analog input (AI) channels. You can't mix SCOPE channels and AI channels in a single oscilloscope VI, but you can have two oscilloscope VIs, one that reads the SCOPE channels and another that reads the AI channels.

 

The other way you can read the AI channels is using the DAQmx API or DAQ Assistant. You'll need to do some configuration on the sample rate to make sure you're capturing the signals fast enough to avoid aliasing, but ELVISmx is built on DAQmx technology and the I/O for ELVIS is all accessible from DAQmx.

Donovan
0 Kudos
Message 11 of 25
(5,722 Views)

Hi Donovan,

 

Thanks again for your fast reply.

I managed to solve the issue with your help. However, i wish to know if i can view more than 2 waveforms concurrently?

Or it is possible to view more than 2 but not concurrently such that i have to stop the first oscilloscope from reading then start the second one?

Can you advice me on how i can proceed with the labview then?

 

09 - testing for 4 waveforms.png

 

0 Kudos
Message 12 of 25
(5,713 Views)

The ELVISmx oscilloscope functionality only provides access to 2 channels at a time. If you need to read more analog channels at one time, you'll need to use functions provided by the DAQmx driver. The easiest way would be to use the DAQ Assistant. Configure the express VI to take voltage measurements and select the analog input lines you want to monitor. Then just select the number of sample to read per iteration and the rate at which sample should be read to capture your waveform. The diagram is then very simple.

 

DAQAssistant.png

 

If you want to break the signals out individually, you can use the Split Signals function or the Convert from Dynamic Data function.

 

If you need more control over individual channels, you can also use the DAQmx API. For a starting point, you can look in the Example Finder (Help»Find Examples) and open the Voltage - Continuous Input.vi or Voltage - Finite Input.vi.

Donovan
0 Kudos
Message 13 of 25
(5,709 Views)

Hi,

sorry i could only test and get back to you at this time. I tried the DAQ Assistant, and it worked for one signal but i could not get it to work when i assigned it to read 2 analog inputs.

 

It just showed the error below.

 

Picture1.png 

 

My circuit looked like this.

 

Picture2.png

 

Does the DAQ use the oscilloscope to read the inputs? So no matter what it only can read 2 inputs?

 

0 Kudos
Message 14 of 25
(5,689 Views)

The DAQ Assistant using Analog Input channels should work just fine for more than 2 channels.  When I created my example, I used 4 channels.  What are your sample rate and number of samples settings? It's possible that the Assistant is configured to read faster than the device is capable. ELVIS devices are not simultaneously sampling, which means that the hardware's specified maximum sample rate must be divided by the number of channels used. The more channels you have, the slower each channel can sample.

 

For more information, see this document.

Donovan
0 Kudos
Message 15 of 25
(5,686 Views)

Is there any way to collect the data from the analog input and display it as a continuous waveform with for example 50000 to 100000 sample rate? And then continue on to collect the data from another analog input for a second waveform and so on?

0 Kudos
Message 16 of 25
(5,674 Views)

Is there any way to collect the data from the analog input and display it as a continuous waveform with for example 50000 to 100000 sample rate? And then continue on to collect the data from another analog input for a second waveform and so on?

 

P.S. Is there any way to create an irregular or random waveform?

0 Kudos
Message 17 of 25
(5,666 Views)

There is a way to acquire different analog channels in series with a higher sample rate, but I can't think of a very common use case. Resetting the device and starting a new task for each channel will not be very performance efficient; there will be a gap between when the last sample of one channel is acquired and when the first sample of the next channel is acquired. That gap in non-deterministic, so even though it might look like a continuous waveform, it won't actually be continuous. Instead of the array of doubles I have below, you could probably use a waveform datatype and actually see the gap in the graph. You can't do this with the DAQ Assistant, you must use the DAQmx API.

 

AppendWaveforms.png

 

The Arbitrary Waveform Generator does just that; it generates any arbitrary waveform you wire to it. There are waveform VIs under Signal Processing » Waveform Generation in the LabVIEW palettes that create waveforms and you can do some math and actually create whatever points you want to output. The example below simply generates a series of different waveform types and outputs a new waveform each time through the loop. You could get a lot more creative if you needed something more advanced.

 

RandomWaveform.png

 

Since this thread has wandered away from just outputting a pulse using ELVIS, if you have more questions, can you create a new discussion thread so it's easier to track?

Donovan
0 Kudos
Message 18 of 25
(5,654 Views)

AppendWaveforms.png

 

 

 

Hi,

 

Thanks for your reply Donovan, i tried creating another post but did not get replies so thats why i used this subject to reply to you. You are the best help to me!

I wanted to ask you, from the block diagram above, is it possible to send the first waveform into waveform chart 1,

second waveform into waveform chart 2 and so on until waveform chart 4?

In the case for example where i will be using 4 analog input channels as shown above.

 

Also i wanted to find out where i could get/find the WFChart on the bottom left of the picture, i could not find it.  

0 Kudos
Message 19 of 25
(5,643 Views)

Picture4.png

Hi, i also want to to ask about this function gen. Because i want to put a range to the waveform, i was wondering what values i should put for the sampling info, top and bottom value. The values i currently used creates a waveform random but it has something like the image below and then another waveform of different frequency.

 

Picture5.png

 

Which is actually what i want but, i want it to look more like the image below.

 

Picture5.png

 

 

 So for eg. it has a sine wave of 100Hz for a period, then for the next period it is a wave of lets say 1800Hz and so on...

 

 

0 Kudos
Message 20 of 25
(5,638 Views)