{"id":28541,"date":"2021-08-12T08:56:54","date_gmt":"2021-08-12T15:56:54","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=28541"},"modified":"2023-02-07T17:01:43","modified_gmt":"2023-02-08T01:01:43","slug":"measurement-automation-with-the-analog-discovery-pro-adp3450","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/measurement-automation-with-the-analog-discovery-pro-adp3450\/","title":{"rendered":"Measurement Automation with the Analog Discovery Pro ADP3450"},"content":{"rendered":"<h2>How to Automate Your Measurements<\/h2>\n<p><em>Article originally written by Richard Oed<\/em><\/p>\n<p>Oscilloscopes are the tool of choice for every engineer when it comes to measurements. If the instrument can also work as a waveform generator and can do some mathematical calculations on the signals acquired, or allows automated tests, even better.<\/p>\n<p>For many measurement tasks that designers face in their daily work, oscilloscopes are an excellent choice as they offer many ways to achieve good results. But occasionally, it is necessary to document the obtained data or to process the signals further. Just as a simple example: You want to quantify the power of a certain block in your circuitry, and you are also interested in the waveform originating from these calculations, not only in the absolute values.<\/p>\n<p>But most oscilloscopes only measure voltages, the current, and therefore the power cannot be measured directly. So, a shunt resistor must be used to obtain the current passing through the circuit, allowing for the computation of the power consumed (Figure 1). You also have into account that the channels of most oscilloscopes are single ended, and all measurements therefore must be referred to ground. It is not possible to read the voltage drop over the load directly. A second measurement taking the voltage drop over the shunt resistor is necessary. In the end, this means that some computations have to be done to get the power reading.<\/p>\n<p>Here oscilloscopes capable of doing the calculations right on the device, like the <a href=\"https:\/\/store.digilentinc.com\/analog-discovery-pro-3000-series-portable-high-resolution-mixed-signal-oscilloscopes\/?utm_source=digilent+blog&amp;utm_medium=referral&amp;utm_campaign=adp3450&amp;utm_content=measurement+automation\">Analog Discovery Pro (ADP3450)<\/a> from Digilent, enter the game. This four-channel oscilloscope (a two-channel version is available as well) with 14 bits of resolution at a sampling rate of up to 0.5 GSamples\/s is a true mixed-signal measurement device that the meets the needs for professional-level electronic test-benches at the office or at home. Besides the analog inputs, it also provides engineers with 16 digital I\/O-channels, two external trigger inputs, and a two-channel arbitrary waveform generator (Figure 2).<\/p>\n<figure id=\"attachment_28542\" aria-describedby=\"caption-attachment-28542\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-28542\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-1-Power-measurement-system-600x289.png\" alt=\"power measurement\" width=\"600\" height=\"289\" data-wp-pid=\"28542\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-1-Power-measurement-system-600x289.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-1-Power-measurement-system.png 645w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-28542\" class=\"wp-caption-text\">Figure 1 &#8211; A simple power measurement system<\/figcaption><\/figure>\n<figure id=\"attachment_28543\" aria-describedby=\"caption-attachment-28543\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-28543\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-2-ADP3450-600x237.png\" alt=\"ADP3450\" width=\"600\" height=\"237\" data-wp-pid=\"28543\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-2-ADP3450-600x237.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-2-ADP3450.png 649w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-28543\" class=\"wp-caption-text\">Figure 2 &#8211; Oscilloscopes like the Analog Discovery Pro from Digilent come with multiple instruments like waveform generator or analyzers and can be scripted for automated testing.<\/figcaption><\/figure>\n<p>The Analog Discovery Pro ADP3450 is smaller and lighter than a laptop and has no built-in user-interface. It connects to a host computer through one of its four high-speed USB 2.0 ports or through its Ethernet interface, and it is controlled by the <a href=\"https:\/\/store.digilentinc.com\/software\/digilent-waveforms\/?utm_source=digilent+blog&amp;utm_medium=referral&amp;utm_campaign=adp3450&amp;utm_content=measurement+automation\">free WaveForms software<\/a> from Digilent running on the host. This software, refined by over 10 years of customer feedback, provides a user experience with the look-and-feel of traditional benchtop applications and is compatible to the macOS, Windows, and Linux operating systems.<\/p>\n<h2>One Software for All Instruments<\/h2>\n<p>WaveForms comes with twelve built-in software instruments, like an oscilloscope, a pattern- and a waveform-generator (which, for example, could create the test signal for our power measurement), a controllable power supply, I\/Os, logic-, spectrum-, network-, impedance- and protocol-analyzers, as well as a voltmeter and a data logger. This way users can capture, record, analyze, document, and generate mixed-signals and mixed-domain signals. Additionally, the WaveForms application includes a script editor tool, which allows custom programming of the instruments in JavaScript.<\/p>\n<p>Sometimes, however, like in the case of the power-measurement example, it is not even necessary to create a script. The software\u2019s oscilloscope instrument contains so-called Math channels, which perform the calculations and plot the result alongside the measurements. So, to display the total power of the circuit, simply writing \u201c(C2 \u2013 C1) * C1 \/ R<sub>S<\/sub>\u201c in the \u201cScript\u201d field of a dialog is sufficient, with R<sub>S<\/sub> being the value of the shunt resistor.<\/p>\n<p>This equation computes the current by dividing the voltage V<sub>S<\/sub> across the sensing resistor (Channel 1) by its resistance value and then multiplies the result with the voltage across the\u00a0combined load (capacitance and resistance) derived by subtracting the voltage V<sub>S<\/sub> (Channel 1) from the voltage V<sub>G<\/sub> across the load (Channel 2). In the same window, also the unit of the signal and the range of the channel in units per division can be set. It is also possible to rename the measurement channels and the math channels for more clarity (Figure 3). Additional calculations, like the power consumption of the resistor R<sub>L<\/sub>, can be performed as well by simply adding more math channels. Besides arithmetic operations, the module also supports trigonometric operations, and others.<\/p>\n<figure id=\"attachment_28544\" aria-describedby=\"caption-attachment-28544\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-28544\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-3-Math-channels-600x454.png\" alt=\"\" width=\"600\" height=\"454\" data-wp-pid=\"28544\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-3-Math-channels-600x454.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-3-Math-channels-290x220.png 290w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-3-Math-channels.png 624w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-28544\" class=\"wp-caption-text\">Figure 3 &#8211; The math channels in the software makes simple calculations using the inputs to the oscilloscope easy.<\/figcaption><\/figure>\n<h2>Script Instrument Eases Measurement Automation<\/h2>\n<p>Each of the Waveforms\u2019 instruments can be run by scripts. By writing JavaScript code and executing it in the \u201cScript\u201d instrument, engineers can control any other instrument through extensive Application Programming Interfaces (APIs). This way, it is also possible to configure and run several instruments simultaneously in an easily repeatable way.<\/p>\n<p>The script instrument not only allows to control the instruments and to acquire data. It also includes a plot pane, where users can integrate the data from many different instruments and display them in a highly customizable way. Moreover, GUI actions can be automated, as well as custom data analysis and manipulations.<\/p>\n<p>This way, engineers can monitor signals and document the measurement results. With the WaveForms Software Development Kit (SDK), even more customization is possible, as the SDK can be used to create custom applications and scripts in Python, C, C++, C#, and Visual Basic. For LabVIEW and MATLAB, third-party toolkits are available.<\/p>\n<figure id=\"attachment_28545\" aria-describedby=\"caption-attachment-28545\" style=\"width: 534px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28545\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-4-WaveForms-SDK.png\" alt=\"\" width=\"534\" height=\"279\" data-wp-pid=\"28545\" \/><figcaption id=\"caption-attachment-28545\" class=\"wp-caption-text\">Figure 4 &#8211; WaveForms Script editor allows you to write user applications in JavaScript.<\/figcaption><\/figure>\n<h2>Full Automation in Linux Mode<\/h2>\n<p>Beside the standard mode, where the device is connected to a host PC running WaveForms using a USB port or the Ethernet interface, the Analog Discovery Pro also operates in a Linux mode. In this mode, the ADP boots into a terminal-based Linux distribution from Debian installed on the device. This allows to run automated test scripts written in Python, C, C++, C#, or Visual Basic through the APIs of the WaveForms SDK without a host computer. The Analog Discovery Pro acts then as an embedded device and adds additional flexibility and connectivity. Figure 6 shows an excerpt from a Python script demonstrating an automated test of the analog-to-digital converter on a Pmod AD5 as an example.<\/p>\n<figure id=\"attachment_28546\" aria-describedby=\"caption-attachment-28546\" style=\"width: 533px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28546\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-5-Linux-Mode.png\" alt=\"Screenshot of linux mode\" width=\"533\" height=\"334\" data-wp-pid=\"28546\" \/><figcaption id=\"caption-attachment-28546\" class=\"wp-caption-text\">Figure 5 &#8211; In Linux Mode, the Analog Discovery Pro can be accessed via a serial terminal. Change username and password after the first startup.<\/figcaption><\/figure>\n<p>When running automated tests, user-defined functions are exercised for repeating tasks like resetting or closing the used instruments, displaying error messages, and reading data from the SPI. Programmers will also have to define certain keywords and interrupt handlers before using them.<\/p>\n<p>The ADP3450 has four USB ports on the back of the panel that are enabled in Linux Mode. This makes it possible to connect peripherals such as a compatible Wi-Fi dongle or a FAT\/FAT32 formatted Flash drive. When scripts are run on the device, data can be stored locally, or streamed over a USB or a wireless interface, for example, to a <a href=\"https:\/\/reference.digilentinc.com\/software\/waveforms\/waveforms-sdk\/thingspeak?utm_source=digilent+blog&amp;utm_medium=referral&amp;utm_campaign=adp3450&amp;utm_content=measurement+automation\">cloud-based service like ThingSpeak<\/a>, for storage, display, and manipulation. When running in Linux Mode, the device is accessible through a serial terminal program like PuTTY or TeraTerm. Communication between the device and the host computer is supported through USB, Ethernet, and Wi-Fi. Internet access for remote access or the Internet of Things (IoT) is also possible. Through WaveForms and a connected Flash drive, users can update the on-board Linux, keeping the operating system current. Updated OS-images are provided by Digilent.<\/p>\n<figure id=\"attachment_28547\" aria-describedby=\"caption-attachment-28547\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28547\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-6-Script-Example.png\" alt=\"pmod script\" width=\"510\" height=\"375\" data-wp-pid=\"28547\" \/><figcaption id=\"caption-attachment-28547\" class=\"wp-caption-text\">Figure 6 &#8211; Example script for controlling the analog-to-digital converter on a Pmod AD5.<\/figcaption><\/figure>\n<p>With the different methods of automating tasks \u2013 math channels, scripts, and Linux mode \u2013 the Analog Discovery Pro supports engineers to research, validate, and test the increasingly complex systems and it helps to reduce the design cycle time.<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-28541 jlk' data-task='like' data-post_id='28541' data-nonce='8fb35f3b22' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-28541 lc'>+2<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-28541 jlk' data-task='unlike' data-post_id='28541' data-nonce='8fb35f3b22' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-28541 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-28541 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>How to Automate Your Measurements Article originally written by Richard Oed Oscilloscopes are the tool of choice for every engineer when it comes to measurements. If the instrument can also &hellip; <\/p>\n","protected":false},"author":50,"featured_media":28542,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4312,4267,1563],"tags":[],"ppma_author":[4502],"class_list":["post-28541","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-usb-scopes-analyzers-generators","category-featured","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/08\/Figure-1-Power-measurement-system.png","authors":[{"term_id":4502,"user_id":50,"is_guest":0,"slug":"davidh","display_name":"David Horn","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/44030532fc8d2bc9aa1d05f87c27d6f9?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Horn","last_name_2":"","first_name":"David","first_name_2":"","job_title":"","description":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=28541"}],"version-history":[{"count":1,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28541\/revisions"}],"predecessor-version":[{"id":29611,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28541\/revisions\/29611"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/28542"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=28541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=28541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=28541"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=28541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}