This example generates an arbitrary waveform with optional white noise using the VirtualBench function generator (FGEN) and reads the resulting waveform from the mixed signal oscilloscope (MSO). The stimulus response is then displayed.
[+] Enlarge Image
Steps to Run Program
- Download the example program on the right under downloads.
- In LabVIEW software, open the program by going to File » Open… and navigating to the file.
- Connect the VirtualBench device.
- Select the correct VirtualBench device in the pull-down menu of the VirtualBench Device control.
- Specify the arbitrary waveform settings, including the addition of white noise if desired. Specify the MSO channel, trigger, and timing information.
- Connect the FGEN to the device under test (DUT); connect the DUT output to the MSO channel specified above.
- Click the Run button source the waveform.
- The stimulus response will display in the graph.
As a reminder, the detailed help for each VI specifies allowable values for each input. Below is an excerpt from the MSO Configure Analog Edge Trigger VI as an example:
[+] Enlarge Image
[+] Enlarge Image
- Initialize Session
- The VirtualBench device information is passed into the FGEN Initialize VI to initialize a new session to the FGEN and passed to the MSO Initialize VI to initialize a new session to the MSO.
- Configure Instrument
- Waveform Settings
- Error information is passed to the Basic Function Generator VI to create the arbitrary waveform. The specified waveform information from the Waveform Settings panel is passed to the VI.
- The arbitrary waveform signal and error information are passed into a Case Structure. The white noise selection is used as the case selector. Select the down arrow next to the case name to select a different case to view.
- True case: In this case, error information is passed into the Uniform White Noise Waveform VI. The amplitude and sampling information are passed to the VI, and it outputs white noise. The generated arbitrary waveform is added to the white noise waveform to create the final waveform to output.
- False case: In this case, the generated arbitrary waveform and error information are passed unchanged through the case structure.
- Instrument information, error information, and the generated arbitrary waveform are passed into the FGEN Configure Arbitrary Waveform VI.
- Channel Settings
- Instrument and error information are passed into the MSO Configure Analog Channel VI. The specified channel is passed to the VI, and the channel is enabled through a Boolean true constant.
- Trigger Settings
- Instrument and error information are passed into the MSO Configure Analog Edge Trigger VI. The trigger source, slope, level, and hysteresis voltage are passed to the VI.
- Timing Settings
- Instrument and error information are passed into the MSO Configure Timing.
- Perform Operation
- Instrument and error information are passed to the MSO Run VI to begin acquiring with the MSO.
- The error wires are bundled together and then passed into the FGEN Run VI to start outputting from the FGEN. The error wires enforce data flow in order to make sure the MSO is running before the FGEN begins.
- Instrument and error information are passed to the MSO Read VI, and the VI outputs the stimulus response which is displayed on the front panel.
- Close Session
- The instrument and error information are passed to the FGEN Close VI and then the MSO Close VI. This closes the FGEN and MSO sessions and deallocates any resources for the next time a session is created with the instruments.
- Handle Errors
- Finally, the error information is passed into the Simple Error Handler VI. If an error has occurred, a dialog box will open to notify the user.
- Single Instruments
- Multiple Instruments