Using the Analog Discovery 2 in LabVIEW

0

My latest project involved an attempt to recreate some of the basic features of Digilent Waveforms in LabVIEW. My LabVIEW VI, called Labforms, allows you to connect an Analog Discovery 2 USB Oscilloscope to LabVIEW. The LabVIEW code uses the LabVIEW driver for the Analog Discovery 2, which lets you access the analog scope and Waveform Generator (WaveGen) functionalities of the Analog Discovery with LabVIEW.

In this post, I will walk you through the Labforms user interface.

Waveform Generator

The WaveGen tab allows you to generate electronic waveforms. The resulting waveforms can be input into a device being tested and analyzed with the Oscilloscope as they progress through the device. This is useful for confirming the proper operation of the device or pinpointing a fault in the device.

  • Channels: selects the channel(s) to be controlled. For every channel you select, a configuration form and a signal preview plot are displayed.
    • Channel One is Waveform Generator channel 1
    • Channel Two is Waveform Generator channel 2.
  • Waveform Function: represents the standard signal types: DC, Sine, Square, Triangle.
  • Frequency: adjusts the generated waveform period.
  • Amplitude: shows the amplitude for the Carrier signal.
  • DC Offset: adjust the offset in volt units.
  • Duty Cycle: Specifies the percentage of time the waveform is in an active state

Power Supplies

This instrument allows you to enable the device power supplies.

screen-shot-2016-09-15-at-10-04-34-am

  • Master Enable is ON/OFF button: the master ON/OFF switch for the power supplies.
  • Positive/Negative Supply button: the enable switches for each supply.
    • “Rdy” is shown when the master switch is on, and the supply is also enabled.
    • “OFF” is shown when the supply is not enabled.
  • Voltage fields: This allows you to adjust values for the power supplies by either selecting a value from the combo box or typing it in.

Oscilloscope

An oscilloscope (or “scope”) allows you to view signal voltages, typically in a two-dimensional graph where one or more electrical potential differences (on the vertical axis) are plotted as a function of time or of some other voltage (on the horizontal axis).

screen-shot-2016-09-15-at-10-02-52-am

Channels
Use the real channel (vertical controls) to position and scale the waveforms vertically using the offset and range controls for each channel.

screen-shot-2016-09-15-at-10-25-49-amscreen-shot-2016-09-15-at-10-25-57-am

  • Offset: The offset (vertical position) control lets you move the waveform up or down to exactly where you want it on the screen. The offset is the voltage difference between the center line of the oscilloscope screen and the actual ground. This difference is generated by an internal offset voltage source.
  • Range: The range (volts/division) controls to determine the vertical scale of the graph drawn on the oscilloscope screen. The volts/div setting is a scale factor. For example, if the volts/div setting is 2 volts, then each of the ten vertical divisions represents 2 volts, and the entire screen can show 20 volts from bottom to top. If the setting is 0.5 volts/div, the screen can display 5 volts from bottom to top, and so on. The maximum voltage you can display on the screen is the volts/div setting multiplied by the number of vertical divisions.

Time group

screen-shot-2016-09-15-at-10-25-33-am

  • Base: The time base (seconds/division) setting from the channel configuration toolbar lets you select the rate at which the waveform is drawn across the screen. This setting is a scale factor. For example, if the setting is 1 ms, each horizontal division represents 1 ms and the total screen width represents 10 ms (ten divisions). Changing the sec/div setting allows you to visualize longer or shorter time intervals of the input signal.
  • Sample Rate: Adjusts the sampling frequency.

Triggers

screen-shot-2016-09-15-at-10-25-14-am

  • Trigger level: specifies, in volts, the levels at which to trigger
  • Trigger Instance: specifies the trigger instance. This parameter accepts only A as an input
  • Trigger Slope: Specifies on which edge of the source signal to trigger
  • Trigger Hysteresis: specifies, in volts, a window below Trigger level.
    • If the edge is rising, the input voltage must pass below Trigger Level minus Trigger Hysteresis before the input voltage is recognized as a trigger.
    • Hysteresis can improve measurement accuracy when the signal contains noise or jitter.

Cursors

The Cursors are used to measure the amplitude, to indicate certain places on the waveform. Using delta cursors, you can make measurements that deal with power change with frequency or time.

screen-shot-2016-09-15-at-10-25-24-am

These can be added by switching on the “Cursor 1” or “Cursor 2″ switches” above the plot. The first cursor is by default added as a normal cursor, if you turn on both cursors you will not only see the X and Y position of each cursor, but you will also see the Delta, showing the difference between the position of each cursor. The cursor position can be modified with a mouse drag.

Possibilities 

LabVIEW ability to interface with the Analog Discovery 2 opens up a world of possibilities. Labforms can be used as a simple alternative to Waveforms or it can take advantage of LabVIEW ability to create customized and advanced measurement tasks. The Analog Discovery 2 is a great addition to any LabVIEW project, you can easily pair it with a WF32, a Raspberry Pi 2, a BeagleBone Black, and any number of LINX compatible devices.

feigq03iscbo1ey-large

Thank you for reading my blog post; if you want to learn more, please check out my Instructable “Analog Discovery 2 USB Oscilloscope + LabVIEW(2016 update)“.  If you are interested in making this project yourself but don’t have the right supplies, you can purchase LabVIEW 2014 home bundle here, and if you are a student the Analog Discovery 2 has an academic discount available. Please comment below with any questions or comments you may have!

Share on FacebookTweet about this on TwitterShare on Google+Pin on PinterestShare on RedditShare on TumblrShare on LinkedInShare on StumbleUponEmail this to someone
Share.

About Author

Leave A Reply