Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
test-and-measurement:guides:getting-started-with-labview [2021/05/14 23:05] – ↷ Page moved from reference:test-and-measurement:guides:getting-started-with-labview to test-and-measurement:guides:getting-started-with-labview Arthur Brown | test-and-measurement:guides:getting-started-with-labview [2024/04/18 18:28] (current) – Add ULx callout Arthur Brown | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Getting Started with LabVIEW and a Test and Measurement | + | ====== Getting Started with LabVIEW and a Digilent Discovery |
~~TechArticle~~ | ~~TechArticle~~ | ||
- | {{ :learn: | + | {{:test-and-measurement: |
- | The following guide presents how to install and use the Digilent WaveForms VIs LabVIEW package, to control Test and Measurement devices. Demos for controlling the Power Supply, the Digital I/O lines, the Waveform Generator, and the Oscilloscope instruments can be found in the [[# | + | The following guide presents how to install and use the Digilent WaveForms VIs LabVIEW package, to control |
---- | ---- | ||
Line 12: | Line 12: | ||
<WRAP group> | <WRAP group> | ||
* A Digilent Test and Measurement device | * A Digilent Test and Measurement device | ||
- | * [[reference: | + | * [[test-and-measurement:analog-discovery-3: |
- | * [[reference: | + | * [[test-and-measurement: |
- | * [[reference:test-and-measurement: | + | * [[test-and-measurement: |
- | * [[reference:test-and-measurement: | + | * [[test-and-measurement:analog-discovery-pro-2230: |
- | * [[reference:test-and-measurement: | + | * [[test-and-measurement: |
- | * A Computer with the latest version of WaveForms and LabVIEW | + | * [[test-and-measurement: |
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * A Computer with the latest version of WaveForms and LabVIEW installed | ||
</ | </ | ||
**Note:** //If a Test and Measurement device without analog input and/or output channels (Digital Discovery), or without variable power supplies (Analog Discovery) is selected, certain examples in this guide will not work.// | **Note:** //If a Test and Measurement device without analog input and/or output channels (Digital Discovery), or without variable power supplies (Analog Discovery) is selected, certain examples in this guide will not work.// | ||
- | **Note:** //WaveForms can be downloaded | + | **Note:** //The latest installers for WaveForms can be downloaded |
- | **Note:** //To download LabVIEW, an NI account is needed. LabVIEW Community can be downloaded from [[https:// | + | **Note:** //To download LabVIEW, an NI account is needed. |
+ | |||
+ | If you're looking for LabVIEW support for // | ||
---- | ---- | ||
Line 34: | Line 40: | ||
Plug in the Test and Measurement device to the computer via an USB cable. | Plug in the Test and Measurement device to the computer via an USB cable. | ||
- | If your device requires external power, plug in its power supply to an outlet, then plug the power supply' | + | If your device requires external power, plug in its power supply to an outlet, then plug the power supply' |
</ | </ | ||
---- | ---- | ||
Line 41: | Line 47: | ||
<WRAP group>< | <WRAP group>< | ||
- | Open the VI Package Manager (VIPM) | + | Launch LabVIEW and click on the **Tools** menu. Select **VI Package Manager** from the list to open the VI Package Manager (VIPM). |
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | ---- | ||
+ | --> What to do if the VI Package Manager is not installed? # | ||
+ | <WRAP group>< | ||
+ | If the **VI Package Manager** option is not listed under the **Tools** menu, select the **Find LabVIEW Add-ons** option. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <WRAP group>< | ||
+ | The **NI Tools Network** web page will open. Enter **VI Package Manager** in the search field. Select the **JKI VI Package Manager Download** from the search results. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <WRAP group>< | ||
+ | Click on **DOWNLOAD** and proceed to install the VI Package Manager (VIPM) application onto the target Windows system. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <-- | ||
+ | ---- | ||
+ | <WRAP group>< | ||
+ | Select the LabVIEW version installed on the target system (1). Enter **Digilent** in the search field (2) to display related packages. Select the **Digilent WaveForms VIs** package (3) and then click the **Install** button (4). | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group>< | ||
+ | Click on an **agree** option in order to proceed. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group>< | ||
+ | Click the **I Accept** button to continue. | ||
+ | </ | ||
+ | {{ : | ||
+ | |||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group>< | ||
+ | At this point, a message window may appear prompting to restart LabVIEW, if it is open. Click **OK** on the message window. If the restart message does not appear and the system does not automatically restart LabVIEW, then the user should restart the LabVIEW application. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | ---- | ||
+ | --> What to do if you get a Batch Process Error? # | ||
+ | <WRAP group>< | ||
+ | If prompted with a **VIPM - Batch Process Error**, click the **OK** button. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <WRAP group>< | ||
+ | Next, click the **Finish** button and restart LabVIEW. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <WRAP group>< | ||
+ | Once back into LabVIEW, click on **Tools** from the top menu and then select **Options**. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <WRAP group>< | ||
+ | In the **Options** window, select **VI Server** and then scroll down on the right side until you reach **Machine Access**. | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <WRAP group>< | ||
+ | **Note: | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <-- | ||
+ | ---- | ||
+ | <WRAP group>< | ||
+ | Next, when prompted with **VIPM - Package License Agreements**, | ||
+ | </ | ||
+ | {{ : | ||
+ | </ | ||
+ | <WRAP group>< | ||
+ | Click the **Finish** button once the package has been installed and then restart LabVIEW. | ||
</ | </ | ||
- | {{ :learn: | + | {{ :test-and-measurement: |
</ | </ | ||
---- | ---- | ||
<WRAP group>< | <WRAP group>< | ||
- | Search for “Digilent”, open “Digilent WaveForms VIs” and click “Install”. | + | To access the Digilent |
</ | </ | ||
- | {{ :learn:instrumentation:tutorials: | + | {{ :test-and-measurement:analog-discovery-3:labview-help-digilent-reference.png? |Digilent WaveForms VIs Reference}} |
</ | </ | ||
---- | ---- | ||
<WRAP group>< | <WRAP group>< | ||
- | When finished close the current window and open the VI Package Manager. When it opens search for Digilent WaveForms | + | To access |
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group>< | <WRAP group>< | ||
- | Click the “Show Examples” button. | + | The Digilent WaveForms VI examples are located in the target system' |
</ | </ | ||
- | {{ :learn:instrumentation:tutorials: | + | {{ :test-and-measurement:analog-discovery-3:labview-digilentwf-examples-location.png? |Examples Location}} |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | From here you can open examples demonstrating the functionality of different instruments: examples for Analog Discovery, Analog Discovery 2 and Electronics Explorer Power Supplies, examples demonstrating the usage of digital input/ | + | From here, a user can open examples demonstrating the functionality of different instruments, |
</ | </ | ||
---- | ---- | ||
Line 73: | Line 161: | ||
--> Power Supply Example # | --> Power Supply Example # | ||
<WRAP group> | <WRAP group> | ||
- | Download and unzip the provided example file {{ reference: | + | Download and unzip the provided example file {{ reference: |
To use the //Power Supply// instrument within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → Power Supply container: | To use the //Power Supply// instrument within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → Power Supply container: | ||
Line 83: | Line 171: | ||
* Other subvis for reading the voltage, reading the current limit, checking whether the supplies are enabled or not, resetting | * Other subvis for reading the voltage, reading the current limit, checking whether the supplies are enabled or not, resetting | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following | + | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following |
</ | </ | ||
---- | ---- | ||
<WRAP group>< | <WRAP group>< | ||
- | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the Run button (1) and the panel itself (3). Control and indicator objects are placed in the panel. |
In this example the panel is separated in two parts with decorative elements. In the upper part there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The Stop button (2) is also found here. With this button the program can be stopped, and the power supplies turned off. | In this example the panel is separated in two parts with decorative elements. In the upper part there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The Stop button (2) is also found here. With this button the program can be stopped, and the power supplies turned off. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
The lower part contains the Master Enable switch and a virtual LED which signals the state of this switch, and two separated parts for the positive and negative power supply. Both parts contain an ON/OFF switch with a virtual LED which signals the power supply state and a slider, which sets the voltage level of the power supply. If the Digital Discovery is chosen in the upper part and the program is started with the **Run** button, the objects controlling the negative power supply will be disabled and grayed out. | The lower part contains the Master Enable switch and a virtual LED which signals the state of this switch, and two separated parts for the positive and negative power supply. Both parts contain an ON/OFF switch with a virtual LED which signals the power supply state and a slider, which sets the voltage level of the power supply. If the Digital Discovery is chosen in the upper part and the program is started with the **Run** button, the objects controlling the negative power supply will be disabled and grayed out. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the **Run** button (the program can also be started from here) and the panel itself. Control, indicator and data processing blocks and structures are placed in the panel and connected. |
<WRAP column half> | <WRAP column half> | ||
In this example the Block Diagram is separated in three parts with the help of decorative and functional structures. The first part named Device selection and initialization contains the combo box Device (control element), compares its output to predefined strings and initializes the //Power Supplies// instrument with the selected device name. This part has zero incoming and three outgoing signals: the //Power Supplies// instrument device handler, the errors and a flag which is true if the Digital Discovery, the ADP3450, or the ADP3250 was selected and false otherwise. | In this example the Block Diagram is separated in three parts with the help of decorative and functional structures. The first part named Device selection and initialization contains the combo box Device (control element), compares its output to predefined strings and initializes the //Power Supplies// instrument with the selected device name. This part has zero incoming and three outgoing signals: the //Power Supplies// instrument device handler, the errors and a flag which is true if the Digital Discovery, the ADP3450, or the ADP3250 was selected and false otherwise. | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
Line 118: | Line 206: | ||
The next section is in a while loop, so it is repeated until a certain condition is met, with 100ms wait time between iterations. This part has as incoming signals the three from the previous section. The error signal and the device handler are cascaded to the //Power Supply// instrument settings, which also receive data from other control elements: voltage level sliders (V+ voltage and V- voltage) and power supply state switches (V+ and V-). These settings blocks are followed by property nodes, which are able to modify different parameters of existing blocks, in this case according to the device type, the V- channel is enabled/ | The next section is in a while loop, so it is repeated until a certain condition is met, with 100ms wait time between iterations. This part has as incoming signals the three from the previous section. The error signal and the device handler are cascaded to the //Power Supply// instrument settings, which also receive data from other control elements: voltage level sliders (V+ voltage and V- voltage) and power supply state switches (V+ and V-). These settings blocks are followed by property nodes, which are able to modify different parameters of existing blocks, in this case according to the device type, the V- channel is enabled/ | ||
</ | </ | ||
- | {{ : | + | {{ : |
- | {{ : | + | {{ : |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
If the loop is exited, the device handler and the errors are passed to the next section, which turns off the supplies, closes the instrument and sets all switches and virtual LEDs to off state, then displays an error message if there was one. | If the loop is exited, the device handler and the errors are passed to the next section, which turns off the supplies, closes the instrument and sets all switches and virtual LEDs to off state, then displays an error message if there was one. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
Line 131: | Line 219: | ||
To run the VI, first on the front panel select the Test and Measurement device used, then press the **Run** button. | To run the VI, first on the front panel select the Test and Measurement device used, then press the **Run** button. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
From here the power supply channels can be enabled with the help of the switches and adjusted with the help of the sliders. To visualize the output voltage, an LED should be connected in series with a 220Ω | From here the power supply channels can be enabled with the help of the switches and adjusted with the help of the sliders. To visualize the output voltage, an LED should be connected in series with a 220Ω | ||
</ | </ | ||
- | {{ :learn: | + | {{ :test-and-measurement: |
</ | </ | ||
---- | ---- | ||
Line 143: | Line 231: | ||
--> Digital I/O Example 1 - Virtual I/O # | --> Digital I/O Example 1 - Virtual I/O # | ||
<WRAP group> | <WRAP group> | ||
- | Download and unzip the provided example file {{ reference: | + | Download and unzip the provided example file {{ reference: |
To access the digital I/O pins of the Test and Measurement device within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → Dig container: | To access the digital I/O pins of the Test and Measurement device within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → Dig container: | ||
Line 153: | Line 241: | ||
* Other subvis for adding tristate buffers to the I/O lines, resetting the instrument or getting information about the state of the lines (tristated/ | * Other subvis for adding tristate buffers to the I/O lines, resetting the instrument or getting information about the state of the lines (tristated/ | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following | + | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following |
</ | </ | ||
---- | ---- | ||
<WRAP group>< | <WRAP group>< | ||
- | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the **Run** button (1) and the panel itself (3). Control and indicator objects are placed in the panel. |
In this example the panel is separated in two parts with decorative elements. In the upper part there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The **Stop** button (2) is also found here. With this button the program can be stopped, and the digital I/O lines all set to LOW. | In this example the panel is separated in two parts with decorative elements. In the upper part there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The **Stop** button (2) is also found here. With this button the program can be stopped, and the digital I/O lines all set to LOW. | ||
Line 169: | Line 257: | ||
The lower part contains a slider ranging from 0 to 16 (control) and 16 virtual LEDs, each one named after a digital I/O line. When the program is running, the slider determines how many of the digital lines will be HIGH. By moving the slider, the number of lines set to HIGH can be modified. The virtual LEDs indicate if a line is HIGH (they are lit if HIGH and dark if LOW). | The lower part contains a slider ranging from 0 to 16 (control) and 16 virtual LEDs, each one named after a digital I/O line. When the program is running, the slider determines how many of the digital lines will be HIGH. By moving the slider, the number of lines set to HIGH can be modified. The virtual LEDs indicate if a line is HIGH (they are lit if HIGH and dark if LOW). | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the Run button (the program can also be started from here) and the panel itself. Control, indicator and data processing blocks and structures are placed in the panel and connected. |
<WRAP column half> | <WRAP column half> | ||
In this example the Block Diagram is separated in three parts with the help of decorative and functional structures. The first part named Device selection and initialization contains the combo box Device (control element) and initializes the //Digital IO// instrument with the selected device name. This part has zero incoming and two outgoing signals: the //Digital IO// instrument device handler and the error signal. | In this example the Block Diagram is separated in three parts with the help of decorative and functional structures. The first part named Device selection and initialization contains the combo box Device (control element) and initializes the //Digital IO// instrument with the selected device name. This part has zero incoming and two outgoing signals: the //Digital IO// instrument device handler and the error signal. | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
Line 185: | Line 273: | ||
The next section is in a while loop, so it is repeated until a certain condition is met, with 100ms wait time between iterations. This part has as incoming signals the two from the previous section. The error signal and the device handler are connected to the DIO-Write block, which also receives data from the input slider. The number outputted by the slider is converted to a Boolean array with 8 elements, then the content of this array is written to the digital I/O lines. The error and instrument handle signals are connected then to the DIO-Read block. With the help of this block, the program reads the values of digital I/O lines 0 to 15, then converts the Boolean array to a number. This number is compared to constant values and the result of each comparison decides the state of the virtual LEDs. The loop is exited if there is an error, or the **Stop** button is pressed on the Front Panel. The instrument handle and the errors are sent towards the next part. | The next section is in a while loop, so it is repeated until a certain condition is met, with 100ms wait time between iterations. This part has as incoming signals the two from the previous section. The error signal and the device handler are connected to the DIO-Write block, which also receives data from the input slider. The number outputted by the slider is converted to a Boolean array with 8 elements, then the content of this array is written to the digital I/O lines. The error and instrument handle signals are connected then to the DIO-Read block. With the help of this block, the program reads the values of digital I/O lines 0 to 15, then converts the Boolean array to a number. This number is compared to constant values and the result of each comparison decides the state of the virtual LEDs. The loop is exited if there is an error, or the **Stop** button is pressed on the Front Panel. The instrument handle and the errors are sent towards the next part. | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
If the loop is exited, the state of all virtual LEDs is set to false (LEDs are turned off) with the help of property nodes, then an all 0 boolean array is written to the digital I/O lines (all lines are set to LOW). The instrument is closed making it available to other programs, then an error message is displayed, if there were any errors. | If the loop is exited, the state of all virtual LEDs is set to false (LEDs are turned off) with the help of property nodes, then an all 0 boolean array is written to the digital I/O lines (all lines are set to LOW). The instrument is closed making it available to other programs, then an error message is displayed, if there were any errors. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
Line 199: | Line 287: | ||
From here the state of digital I/O lines 0 to 15 can be set by the slider. The state of the pins is also read back and displayed with the help of the virtual LEDs . The program can be terminated with the **Stop** button on the Front Panel. | From here the state of digital I/O lines 0 to 15 can be set by the slider. The state of the pins is also read back and displayed with the help of the virtual LEDs . The program can be terminated with the **Stop** button on the Front Panel. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
Line 206: | Line 294: | ||
--> Digital I/O Example 2 - Simple Loopback# | --> Digital I/O Example 2 - Simple Loopback# | ||
<WRAP group> | <WRAP group> | ||
- | Download and unzip the provided example file {{ reference: | + | Download and unzip the provided example file {{ reference: |
To access the digital I/O pins of the Test and Measurement device within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → Dig container: | To access the digital I/O pins of the Test and Measurement device within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → Dig container: | ||
Line 216: | Line 304: | ||
* Other subvis for adding tristate buffers to the I/O lines, resetting the instrument or getting information about the state of the lines (tristated/ | * Other subvis for adding tristate buffers to the I/O lines, resetting the instrument or getting information about the state of the lines (tristated/ | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following | + | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following |
</ | </ | ||
---- | ---- | ||
<WRAP group>< | <WRAP group>< | ||
- | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the **Run** button (1) and the panel itself (3). Control and indicator objects are placed in the panel. |
In this example the panel is separated in two parts with decorative elements. In the upper part there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The **Stop** button (2) is also found here. With this button the program can be stopped, and the digital I/O lines all set to LOW. | In this example the panel is separated in two parts with decorative elements. In the upper part there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The **Stop** button (2) is also found here. With this button the program can be stopped, and the digital I/O lines all set to LOW. | ||
Line 232: | Line 320: | ||
The lower part contains a slider ranging from 0 to 9 (control), two text fields (indicator), | The lower part contains a slider ranging from 0 to 9 (control), two text fields (indicator), | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the Run button (the program can also be started from here) and the panel itself. Control, indicator and data processing blocks and structures are placed in the panel and connected. |
<WRAP column half> | <WRAP column half> | ||
In this example the Block Diagram is separated in three parts with the help of decorative and functional structures. The first part named Device selection and initialization contains the combo box list Device (control element) and initializes the //Digital IO// instrument with the selected device name. This part has zero incoming and two outgoing signals: the //Digital IO// instrument device handler and the error signal. | In this example the Block Diagram is separated in three parts with the help of decorative and functional structures. The first part named Device selection and initialization contains the combo box list Device (control element) and initializes the //Digital IO// instrument with the selected device name. This part has zero incoming and two outgoing signals: the //Digital IO// instrument device handler and the error signal. | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
Line 250: | Line 338: | ||
As a next step, the state of the digital I/O lines 8-14 is read and the segments of the seven-segment display are controlled according to the received values. The loop is exited if there is an error, or the **Stop** button is pressed on the Front Panel. The instrument handle and the errors are sent towards the next part. | As a next step, the state of the digital I/O lines 8-14 is read and the segments of the seven-segment display are controlled according to the received values. The loop is exited if there is an error, or the **Stop** button is pressed on the Front Panel. The instrument handle and the errors are sent towards the next part. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
When the loop is exited, the state of all virtual LEDs is set to false (LEDs are turned off) with the help of property nodes, the strings are replaced with an empty string, then an all 0 Boolean array is written to the digital I/O lines (all lines are set to LOW). The instrument is closed making it available to other programs, then an error message is displayed, if there were any errors. | When the loop is exited, the state of all virtual LEDs is set to false (LEDs are turned off) with the help of property nodes, the strings are replaced with an empty string, then an all 0 Boolean array is written to the digital I/O lines (all lines are set to LOW). The instrument is closed making it available to other programs, then an error message is displayed, if there were any errors. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
Line 264: | Line 352: | ||
Connect DIO pins 0-6 to DIO pins 8-14, as seen in the diagram to the right. DIO lines 0-6 are used as output and are controlled by the slider. As the segments of the seven-segment display are connected to digital I/O lines 8-14, connecting the respective pins will display the number set on the slider. The program can be terminated with the **Stop** button on the Front Panel | Connect DIO pins 0-6 to DIO pins 8-14, as seen in the diagram to the right. DIO lines 0-6 are used as output and are controlled by the slider. As the segments of the seven-segment display are connected to digital I/O lines 8-14, connecting the respective pins will display the number set on the slider. The program can be terminated with the **Stop** button on the Front Panel | ||
</ | </ | ||
- | {{ :learn:instrumentation:tutorials: | + | {{ :test-and-measurement:analog-discovery-3:ad3-dio-short.png?& |
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
Line 272: | Line 360: | ||
--> Analog I/O Example # | --> Analog I/O Example # | ||
<WRAP group> | <WRAP group> | ||
- | Download and unzip the provided example file {{ reference: | + | Download and unzip the provided example file {{ reference: |
To use the //Waveform Generator// instrument within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → FGEN container: | To use the //Waveform Generator// instrument within LabVIEW, the following subvis are available in the Measurement I/O → Digilent WF VIs → FGEN container: | ||
Line 283: | Line 371: | ||
* Other subvis for generating arbitrary waveforms, returning data about the state of the function generator, resetting the instrument, etc. are also available (these are not used in the example program). | * Other subvis for generating arbitrary waveforms, returning data about the state of the function generator, resetting the instrument, etc. are also available (these are not used in the example program). | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
<WRAP group> | <WRAP group> | ||
Line 298: | Line 386: | ||
* Other subvis for setting channel and trigger properties, returning data about the state of the oscilloscope, | * Other subvis for setting channel and trigger properties, returning data about the state of the oscilloscope, | ||
</ | </ | ||
- | {{ : | + | {{ : |
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following | + | A LabVIEW Virtual Instrument consists of two parts: the Front Panel and the Block Diagram. The Front Panel contains all controls and indicators for data in- and output and serves as a user interface when the program is running. The Block Diagram contains the blocks which are present on the Front Panel, but also other block which are necessary for information processing and the connections between these blocks. One can add a new block to both windows by right clicking on a blank space in the corresponding window and selecting the required block from a library. Blocks already present in the window can be modified by right clicking on the respective block. In the following |
</ | </ | ||
---- | ---- | ||
<WRAP group>< | <WRAP group>< | ||
- | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Front Panel contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the **Run** button (1) and the panel itself (3). Control and indicator objects are placed in the panel. |
In this example the panel is separated in three parts with decorative elements. In the upper left part, there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The **Stop** button (2) is also found here. With this button the program and both the // | In this example the panel is separated in three parts with decorative elements. In the upper left part, there is a drop-down list with the name Device which is used to select the Test and Measurement device used. The **Stop** button (2) is also found here. With this button the program and both the // | ||
Line 315: | Line 403: | ||
The lower left part contains all the control elements for the //Wavegen// instrument: channel and function selector drop-down lists, sliders and text boxes for setting the amplitude and DC offset voltages and text boxes for setting the duty cycle, the starting and ending frequency and the frequency increment of the sweep. | The lower left part contains all the control elements for the //Wavegen// instrument: channel and function selector drop-down lists, sliders and text boxes for setting the amplitude and DC offset voltages and text boxes for setting the duty cycle, the starting and ending frequency and the frequency increment of the sweep. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
The right part named Oscilloscope contains four drop-down lists for scope channel selection, setting coupling type, setting trigger edge, and setting probe attenuation (by default this is set to 1X, should be modified if BNC probes are used) and a numeric control to set the speed of the measurements (it sets the acquisition time for every step). Beside of the control fields, a plot pane is also present: here will be displayed the measured signal. The range of the axis is set automatically. | The right part named Oscilloscope contains four drop-down lists for scope channel selection, setting coupling type, setting trigger edge, and setting probe attenuation (by default this is set to 1X, should be modified if BNC probes are used) and a numeric control to set the speed of the measurements (it sets the acquisition time for every step). Beside of the control fields, a plot pane is also present: here will be displayed the measured signal. The range of the axis is set automatically. | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
---- | ---- | ||
<WRAP group> | <WRAP group> | ||
- | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://learn.ni.com/ | + | The Block Diagram contains, along with the menu bar, the alignment setting, search buttons, etc. (see more at: [[https://labviewwiki.org/wiki/Getting_Started|LabVIEW Community Getting Started]]), the **Run** button (the program can also be started from here) and the panel itself. Control, indicator and data processing blocks and structures are placed in the panel and connected. |
</ | </ | ||
Line 339: | Line 427: | ||
The axis ranges of the plot pane are also set here: the X axis is ranging from 0 to the starting period and the Y axis is set to display the full peak-to-peak range of the signal. | The axis ranges of the plot pane are also set here: the X axis is ranging from 0 to the starting period and the Y axis is set to display the full peak-to-peak range of the signal. | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
Line 346: | Line 434: | ||
The loop also contains the **Run** block, which starts the Scope and takes a measurement, | The loop also contains the **Run** block, which starts the Scope and takes a measurement, | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
If the loop is exited, both instruments are stopped and closed, to make them available for other software. The two error signals are merged and handled: an error message is displayed, if there were any errors during execution. | If the loop is exited, both instruments are stopped and closed, to make them available for other software. The two error signals are merged and handled: an error message is displayed, if there were any errors during execution. | ||
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
---- | ---- | ||
Line 358: | Line 446: | ||
To run the VI, first, on the Front Panel select the Test and Measurement device used, set the attributes of the desired waveform and the parameters of the frequency sweep, then press the **Run** button. The measurement can be stopped at any time with the **Stop** button, or is finished when the ending frequency is reached. | To run the VI, first, on the Front Panel select the Test and Measurement device used, set the attributes of the desired waveform and the parameters of the frequency sweep, then press the **Run** button. The measurement can be stopped at any time with the **Stop** button, or is finished when the ending frequency is reached. | ||
</ | </ | ||
- | {{ reference: | + | {{ reference: |
</ | </ | ||
<WRAP group>< | <WRAP group>< | ||
- | To to test the example , connect the Test and Measurement device' | + | To to test the example , connect the Test and Measurement device' |
</ | </ | ||
- | {{ : | + | {{ : |
</ | </ | ||
//If your Digilent Test and Measurement device supports BNC cables, more options are available. Select your device, below, for instructions on using these cables.// | //If your Digilent Test and Measurement device supports BNC cables, more options are available. Select your device, below, for instructions on using these cables.// | ||
+ | |||
+ | --> Analog Discovery 3 with BNC Adapter # | ||
+ | <WRAP group> <WRAP column half> | ||
+ | Connect the [[test-and-measurement: | ||
+ | |||
+ | **Note:** //For this demo, both ground wires were not connected together, because the Oscilloscope channel shares the same ground as the Wavegen channel. While BNC Probes are single-ended (as is the Waveform Generator hardware), a connected circuit must still share a common ground with the device. No more than one ground should be connected, in order to avoid the creation of ground loops, which may damage your device.// | ||
+ | |||
+ | **Note:** //When using BNC Probes, make sure to take note of the probes' | ||
+ | </ | ||
+ | {{: | ||
+ | </ | ||
+ | |||
+ | <WRAP group> <WRAP column half> | ||
+ | Take note of the jumper that selects between AC and DC coupling on the BNC adapter. Either will work to measure the sine wave produced here, but some waveforms may find one setting or the other significantly more useful. | ||
+ | </ | ||
+ | {{: | ||
+ | </ | ||
+ | <-- | ||
+ | |||
+ | --> Analog Discovery Pro (ADP3450/ | ||
+ | <WRAP group> <WRAP column half> | ||
+ | Connect a BNC oscilloscope probe to the Analog Discovery Pro's Oscilloscope Channel 1 connector and a set of BNC minigrabbers to its Wavegen Out Channel 1 connector. Connect these together, as pictured, to form a loopback circuit. Check the input probe' | ||
+ | |||
+ | **Note:** //For this demo, both ground wires were not connected together, because the Oscilloscope channel shares the same ground as the Wavegen channel. While BNC Probes are single-ended (as is the Waveform Generator hardware), a connected circuit must still share a common ground with the device. No more than one ground should be connected, in order to avoid the creation of ground loops, which may damage your device.// | ||
+ | |||
+ | **Note:** //When using BNC Probes, make sure to take note of the probes' | ||
+ | </ | ||
+ | {{reference: | ||
+ | </ | ||
+ | <-- | ||
--> Analog Discovery Studio # | --> Analog Discovery Studio # | ||
Line 372: | Line 490: | ||
Connect BNC cables to the Test and Measurement device' | Connect BNC cables to the Test and Measurement device' | ||
- | **Note:** //While BNC Probes are single-ended (as is the Waveform Generator hardware), a connected circuit must still share a common ground with the device.// | + | **Note:** //For this demo, both ground wires were not connected together, because the Oscilloscope channel shares the same ground as the Wavegen channel. |
**Note:** //When using BNC Cables, make sure to take note of the probes' | **Note:** //When using BNC Cables, make sure to take note of the probes' | ||
Line 388: | Line 506: | ||
</ | </ | ||
<-- | <-- | ||
- | |||
--> Analog Discovery 2 with BNC Adapter # | --> Analog Discovery 2 with BNC Adapter # | ||
<WRAP group> <WRAP column half> | <WRAP group> <WRAP column half> | ||
- | Connect BNC cables to the Test and Measurement device' | + | Connect |
- | **Note:** //While BNC Probes are single-ended (as is the Waveform Generator hardware), a connected circuit must still share a common ground with the device.// | + | **Note:** //For this demo, both ground wires were not connected together, because the Oscilloscope channel shares the same ground as the Wavegen channel. |
**Note:** //When using BNC Probes, make sure to take note of the probes' | **Note:** //When using BNC Probes, make sure to take note of the probes' | ||
Line 404: | Line 521: | ||
</ | </ | ||
{{: | {{: | ||
- | </ | ||
- | <-- | ||
- | |||
- | --> Analog Discovery Pro (ADP3450/ | ||
- | <WRAP group> <WRAP column half> | ||
- | Connect a BNC oscilloscope probe to the Analog Discovery Pro's Oscilloscope Channel 1 connector and a set of BNC minigrabbers to its Wavegen Out channel 1 connector. Connect these together, as pictured, to form a loopback circuit. Check the input probe' | ||
- | |||
- | **Note:** //While BNC Probes are single-ended (as is the Waveform Generator hardware), a connected circuit must still share a common ground with the device. No more than one ground should be connected, in order to avoid the creation of ground loops, which may damage your device.// | ||
- | |||
- | **Note:** //When using BNC Probes, make sure to take note of the probes' | ||
- | </ | ||
- | {{reference: | ||
</ | </ | ||
<-- | <-- | ||
Line 424: | Line 529: | ||
===== Next Steps ===== | ===== Next Steps ===== | ||
- | For more guides on how to use the Digilent Test and Measurement Device, return to the device' | + | For more guides on how to use the Digilent Test and Measurement Device, return to the device' |
- | For technical support, please visit the [[https:// | + | For technical support, please visit the [[https:// |