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.
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
This instrument allows you to enable the device power supplies.
- 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.
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).
Use the real channel (vertical controls) to position and scale the waveforms vertically using the offset and range controls for each channel.
- 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.
- 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.
- 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.
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.
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.
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.
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!
One Comment on “Using the Analog Discovery 2 in LabVIEW”
Hello! I am a newcomer from Japan and has become keen on using the Analog Discovery2 after reading the above article. Is it workable with LabView 2014 of Home Bundle available from some Japanese shops ?
Best wishes Tohru