{"id":25353,"date":"2018-08-28T15:19:08","date_gmt":"2018-08-28T22:19:08","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=25353"},"modified":"2021-06-09T14:00:23","modified_gmt":"2021-06-09T21:00:23","slug":"where-can-i-script-in-waveforms","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/where-can-i-script-in-waveforms\/","title":{"rendered":"Where Can I Script in WaveForms?"},"content":{"rendered":"<p>Earlier in the month, we talked a bit about the <a href=\"https:\/\/digilent.com\/blog\/get-the-most-out-of-waveforms-with-the-software-development-kit\/\">WaveForms Software Development Kit,<\/a> and briefly\u00a0mentioned the scripting capabilities from within the <a href=\"https:\/\/digilent.com\/shop\/waveforms-previously-waveforms-2015\/\">WaveForms Application<\/a>. Scripting within WaveForms allows you the customization and automation of instruments from in the application itself. This tool is available in any WaveForms compatible hardware, including the <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\">Analog Discovery,<\/a> <a href=\"https:\/\/digilent.com\/shop\/digital-discovery-portable-logic-analyzer-and-digital-pattern-generator\/\">Digital Discovery,<\/a> and <a href=\"https:\/\/digilent.com\/shop\/electronics-explorer-all-in-one-usb-oscilloscope-multimeter-workstation\/\">Electronics Explorer<\/a> Board.<\/p>\n<p>The first place to find scripting is in the Script Editor:<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/1-script-editor-oscilloscope-waveform-generator.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25360\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/1-script-editor-oscilloscope-waveform-generator-600x404.png\" alt=\"\" width=\"600\" height=\"404\" data-wp-pid=\"25360\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/1-script-editor-oscilloscope-waveform-generator-600x404.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/1-script-editor-oscilloscope-waveform-generator.png 740w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>In the Script Editor, you can write JavaScript scripts to automate measurements or create custom decoders, like this VGA decoder. In the help tab, you&#8217;ll find a list of all the functions you can use.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/2-script-help.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25361\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/2-script-help-600x462.png\" alt=\"\" width=\"600\" height=\"462\" data-wp-pid=\"25361\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/2-script-help-600x462.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/2-script-help.png 736w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>In the Script Editor itself are several examples, including oscilloscope and waveform generator demos, as well as a static I\/O demo that makes use of the Digital channels.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/3-script-example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25362\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/3-script-example-600x270.png\" alt=\"\" width=\"600\" height=\"270\" data-wp-pid=\"25362\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/3-script-example-600x270.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/3-script-example.png 710w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Scripts are written in the top editor, and the output of the scripts can be found in the bottom box.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/4-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25363\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/4-output-600x517.png\" alt=\"\" width=\"600\" height=\"517\" data-wp-pid=\"25363\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/4-output-600x517.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/4-output-110x96.png 110w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/4-output.png 740w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>There is also a Qt script debugger available to debug scripts.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/5-Qt-script-debugger.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25364\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/5-Qt-script-debugger-600x478.png\" alt=\"\" width=\"600\" height=\"478\" data-wp-pid=\"25364\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/5-Qt-script-debugger-600x478.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/5-Qt-script-debugger.png 745w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>To learn more about the Script Editor tool, check out the <a href=\"https:\/\/www.youtube.com\/watch?v=E0JKEFEGfHs\">Script Editor Quick Start Video<\/a>. In addition to the Script Editor tool, you can also script in various places within other instruments.<\/p>\n<p>For example, in the Protocol Analyzer tool, you can script custom SPI and I2C analyzers. This is useful in the event that you need an analyzer that isn&#8217;t in the protocol analyzer, or you need to decode the data into values specific to the sensor.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/6-protocol-script.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25365\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/6-protocol-script-600x340.png\" alt=\"\" width=\"600\" height=\"340\" data-wp-pid=\"25365\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/6-protocol-script-600x340.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/6-protocol-script.png 736w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>There are even examples available for each analyzer to help you get started.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/7-examples.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25366\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/7-examples-600x360.png\" alt=\"\" width=\"600\" height=\"360\" data-wp-pid=\"25366\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/7-examples-600x360.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/7-examples.png 753w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>In the Oscilloscope, custom channels can be scripted to assist data analysis or processing.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/8-Script-Scope-Channels.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-25367\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/8-Script-Scope-Channels-600x371.png\" alt=\"\" width=\"600\" height=\"371\" data-wp-pid=\"25367\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/8-Script-Scope-Channels-600x371.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/8-Script-Scope-Channels.png 739w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>If you&#8217;ve created any custom scripts let us know by commenting below! If you have a question about the script editor or need assistance creating a script, your questions are always welcome on the <a href=\"http:\/\/forum.blog.digilentinc.com\">Digilent Forum.<\/a><\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-25353 jlk' data-task='like' data-post_id='25353' data-nonce='3c15ebf169' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-25353 lc'>+5<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-25353 jlk' data-task='unlike' data-post_id='25353' data-nonce='3c15ebf169' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-25353 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-25353 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Get familiar with custom scripting in WaveForms!<\/p>\n","protected":false},"author":18,"featured_media":25367,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4323,1563],"tags":[1736,452],"ppma_author":[4466],"class_list":["post-25353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","category-guide","tag-analog-discovery-2","tag-waveforms"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/08\/8-Script-Scope-Channels.png","authors":[{"term_id":4466,"user_id":18,"is_guest":0,"slug":"kaitlyn","display_name":"Kaitlyn Franz","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/3f16f6159d3666c6fd05a4b73a18c286?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Franz","last_name_2":"","first_name":"Kaitlyn","first_name_2":"","job_title":"","description":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/25353","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\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=25353"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/25353\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/25367"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=25353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=25353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=25353"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=25353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}