Differences

This shows you the differences between two versions of the page.

Link to this comparison view

test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start [2021/05/14 23:05] – ↷ Page moved from reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start to test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start Arthur Browntest-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start [2022/10/04 11:38] (current) – external edit 127.0.0.1
Line 8: Line 8:
 <WRAP group> <WRAP group>
 == Hardware == == Hardware ==
-  * [[https://store.digilentinc.com/digital-discovery-portable-usb-logic-analyzer-and-digital-pattern-generator/|Digital Discovery]]+  * [[https://digilent.com/shop/digital-discovery-portable-usb-logic-analyzer-and-digital-pattern-generator/|Digital Discovery]]
   * [[https://store.arduino.cc/arduino-uno-rev3|Arduino UNO]]   * [[https://store.arduino.cc/arduino-uno-rev3|Arduino UNO]]
   * Jumper wires   * Jumper wires
-  * [[https://store.digilentinc.com/pmod-tmp3-digital-temperature-sensor/|Pmod TMP3]] - required for the //Spying on I2C Communication// example+  * [[https://digilent.com/shop/pmod-tmp3-digital-temperature-sensor/|Pmod TMP3]] - required for the //Spying on I2C Communication// example
   * [[https://https://store.arduino.cc/arduino-pro-mini|Arduino Pro Mini]] with 8MHz ATmega328P, or other 3V3 microcontroller (LilyPad, Arduino Fio, etc.) - required for the //Programming an AVR Microcontroller// example   * [[https://https://store.arduino.cc/arduino-pro-mini|Arduino Pro Mini]] with 8MHz ATmega328P, or other 3V3 microcontroller (LilyPad, Arduino Fio, etc.) - required for the //Programming an AVR Microcontroller// example
-  * [[https://store.digilentinc.com/pmod-lvlshft-logic-level-shifter/|Pmod LVLSHFT]] - required for the //Programming an AVR Microcontroller// example if a 5V microcontroller (like Arduino UNO) is used +  * [[https://digilent.com/shop/pmod-lvlshft-logic-level-shifter/|Pmod LVLSHFT]] - required for the //Programming an AVR Microcontroller// example if a 5V microcontroller (like Arduino UNO) is used 
-  * [[https://store.digilentinc.com/pmod-usbuart-usb-to-uart-interface/|Pmod USBUART]] - required for the //Using Different Logic Voltages// example +  * [[https://digilent.com/shop/pmod-usbuart-usb-to-uart-interface/|Pmod USBUART]] - required for the //Using Different Logic Voltages// example 
-  * [[https://store.digilentinc.com/pmod-da1-four-8-bit-d-a-outputs/|Pmod DA1]] - required for the //Using Different Logic Voltages// example+  * [[https://digilent.com/shop/pmod-da1-four-8-bit-d-a-outputs/|Pmod DA1]] - required for the //Using Different Logic Voltages// example
   * red LED - required for the //Using Different Logic Voltages// example   * red LED - required for the //Using Different Logic Voltages// example
   * 10KΩ resistor (brown-black-orange-gold) - required for the //Using Different Logic Voltages// example   * 10KΩ resistor (brown-black-orange-gold) - required for the //Using Different Logic Voltages// example
  
 == Software == == Software ==
-  * [[reference:software:waveforms:waveforms-3:start|]]+  * [[software:waveforms:waveforms-3:start]]
   * [[https://www.ni.com/ro-ro/shop/labview/select-edition/labview-community-edition.html/|LabVIEW Community]]   * [[https://www.ni.com/ro-ro/shop/labview/select-edition/labview-community-edition.html/|LabVIEW Community]]
   * [[https://www.arduino.cc/en/Main/Software|Arduino IDE]]   * [[https://www.arduino.cc/en/Main/Software|Arduino IDE]]
 </WRAP> </WRAP>
  
-**Note:** //WaveForms can be installed by following the [[reference:software:waveforms:waveforms-3:getting-started-guide]]. By installing WaveForms, WaveForms SDK will be installed, which is needed later in this guide.//+**Note:** //WaveForms can be installed by following the [[software:waveforms:waveforms-3:getting-started-guide]]. By installing WaveForms, WaveForms SDK will be installed, which is needed later in this guide.//
 ---- ----
  
 ===== Creating VIs for a Shared Library ===== ===== Creating VIs for a Shared Library =====
 <WRAP group> <WRAP group>
-Digital Discovery, as well as other Test and Measurement Devices, can be controlled using the functions available in WaveForms SDK. For the list and description of the available functions see C:\Program Files (x86)\Digilent\WaveFormsSDK\WaveForms SDK Reference Manual.pdf, or [[reference:software:waveforms:waveforms-sdk:reference-manual]]. For examples in C and Python languages see C:\Program Files (x86)\Digilent\WaveFormsSDK\samples.+Digital Discovery, as well as other Test and Measurement Devices, can be controlled using the functions available in WaveForms SDK. For the list and description of the available functions see C:\Program Files (x86)\Digilent\WaveFormsSDK\WaveForms SDK Reference Manual.pdf, or [[software:waveforms:waveforms-sdk:reference-manual]]. For examples in C and Python languages see C:\Program Files (x86)\Digilent\WaveFormsSDK\samples.
  
 To use the functions available in WaveForms SDK within LabVIEW, virtual instruments (VIs) have to be created from these functions. Follow the instructions in this guide to see, how to import the WaveForms SDK shared library in LabVIEW. To use the functions available in WaveForms SDK within LabVIEW, virtual instruments (VIs) have to be created from these functions. Follow the instructions in this guide to see, how to import the WaveForms SDK shared library in LabVIEW.
Line 63: Line 63:
  
 <WRAP group><WRAP column half> <WRAP group><WRAP column half>
-Certain properties of every function can be edited in the following, but as the dwf library contains several hundred functions, it is more time efficient to leave every function with the default settings and edit just certain functions before using them (this is discussed in the [[reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#editing_generated_vis|Editing Generated VIs]] section). After displaying a Generation Summary, the wizard starts to generate the VIs from the shared library functions. The process takes time, so be patient.+Certain properties of every function can be edited in the following, but as the dwf library contains several hundred functions, it is more time efficient to leave every function with the default settings and edit just certain functions before using them (this is discussed in the [[test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#editing_generated_vis|Editing Generated VIs]] section). After displaying a Generation Summary, the wizard starts to generate the VIs from the shared library functions. The process takes time, so be patient.
  
 When the Generation Process is finished, the VI library is ready to use. However, in the case of certain functions, an edit to the generated VI is necessary. When the Generation Process is finished, the VI library is ready to use. However, in the case of certain functions, an edit to the generated VI is necessary.
Line 91: Line 91:
  
 <WRAP group><WRAP column half> <WRAP group><WRAP column half>
-In the [[reference:software:waveforms:waveforms-sdk:reference-manual]] search for the chosen function. In this case it is the FDwfDigitalI2cRead function. The function description shows that the buffer for the read data is rgbRx of type unsigned char*.+In the [[software:waveforms:waveforms-sdk:reference-manual]] search for the chosen function. In this case it is the FDwfDigitalI2cRead function. The function description shows that the buffer for the read data is rgbRx of type unsigned char*.
 </WRAP><WRAP column half> </WRAP><WRAP column half>
 {{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:edit_3.png?nolink&600 |}} {{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:edit_3.png?nolink&600 |}}
Line 148: Line 148:
 Download and unzip the provided example file {{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:spy_tmp3.zip |spy_tmp3.zip}} then double click on it to open it with LabVIEW Community. All the functions used in the example can be used in your own VI, play around and see what else you can create. Download and unzip the provided example file {{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:spy_tmp3.zip |spy_tmp3.zip}} then double click on it to open it with LabVIEW Community. All the functions used in the example can be used in your own VI, play around and see what else you can create.
  
-**Note:** //For this VI to work, the dwf VI library is necessary (see: [[reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#creating_vis_for_a_shared_library|Creating VIs for a Shared Library]]).//+**Note:** //For this VI to work, the dwf VI library is necessary (see: [[test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#creating_vis_for_a_shared_library|Creating VIs for a Shared Library]]).//
 </WRAP> </WRAP>
 ---- ----
Line 174: Line 174:
 Continuous reception of data is only started if there was no error at the pull-up check. If the check fails, an error message is displayed and data reception is not started. Continuous reception of data is only started if there was no error at the pull-up check. If the check fails, an error message is displayed and data reception is not started.
  
-At every iteration of a while loop, 2 bytes of data are received from the address defined on the front panel. The function F Dwf Digital I2c Read is edited, so the read data buffer is outputted to an Unsigned 8-bit Integer Array and not to a String (see: [[reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#editing_generated_vis|Editing Generated VIs]]).+At every iteration of a while loop, 2 bytes of data are received from the address defined on the front panel. The function F Dwf Digital I2c Read is edited, so the read data buffer is outputted to an Unsigned 8-bit Integer Array and not to a String (see: [[test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#editing_generated_vis|Editing Generated VIs]]).
  
 The two received bytes are concatenated and shifted to the right with four bits, then raw data is converted to degrees Celsius and Fahrenheit and displayed on the Front Panel with the help of the thermometers. The received bytes are converted to hexadecimal strings, then concatenated with "0x" and displayed in the respective field on the Front Panel. The two received bytes are concatenated and shifted to the right with four bits, then raw data is converted to degrees Celsius and Fahrenheit and displayed on the Front Panel with the help of the thermometers. The received bytes are converted to hexadecimal strings, then concatenated with "0x" and displayed in the respective field on the Front Panel.
Line 240: Line 240:
 Download and unzip the provided example file ({{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:avr_programmer.zip |avr_programmer.zip}}) then double click on the main VI (program_AVR.vi) to open it with LabVIEW Community. All the functions and subVIs used in the example can be used in your own VI, play around and see what else you can create. Download and unzip the provided example file ({{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:avr_programmer.zip |avr_programmer.zip}}) then double click on the main VI (program_AVR.vi) to open it with LabVIEW Community. All the functions and subVIs used in the example can be used in your own VI, play around and see what else you can create.
  
-**Note:** //For this VI to work, the dwf VI library is necessary (see: [[reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#creating_vis_for_a_shared_library#creating_vis_for_a_shared_library|Creating VIs for a Shared Library]]).//+**Note:** //For this VI to work, the dwf VI library is necessary (see: [[test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#creating_vis_for_a_shared_library#creating_vis_for_a_shared_library|Creating VIs for a Shared Library]]).//
 </WRAP> </WRAP>
 ---- ----
Line 258: Line 258:
 The main VI (program_AVR.vi) contains several parts separated by decorative and functional structures, as well as multiple subVIs. In the following, these will be presented. The main VI (program_AVR.vi) contains several parts separated by decorative and functional structures, as well as multiple subVIs. In the following, these will be presented.
  
-The first block contains functions for first closing every opened Test and Measurement device, then opening the first available device. Following that, the digital voltage is configured to be 3.3V, then power on the VIO pins is turned on. For more information on these functions, see: [[reference:software:waveforms:waveforms-sdk:reference-manual-legacy]]. The power on indicator LED is turned on after the functions are executed.+The first block contains functions for first closing every opened Test and Measurement device, then opening the first available device. Following that, the digital voltage is configured to be 3.3V, then power on the VIO pins is turned on. For more information on these functions, see: [[software:waveforms:waveforms-sdk:reference-manual-legacy]]. The power on indicator LED is turned on after the functions are executed.
 </WRAP><WRAP column half> </WRAP><WRAP column half>
 {{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:block_diagram_programmer_1.png?600 |}} {{ reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:block_diagram_programmer_1.png?600 |}}
Line 278: Line 278:
 After 100ms, the content of the HEX file is read, and the data to be written in the flash memory of the MCU is put into an array. The program offset is also extracted from the file. The next block (AVR_write.vi) gets the flash memory size, the flash page size, the program offset, and the data from the previous block as parameters, and saves this data in the flash memory of the MCU. After 100ms, the content of the HEX file is read, and the data to be written in the flash memory of the MCU is put into an array. The program offset is also extracted from the file. The next block (AVR_write.vi) gets the flash memory size, the flash page size, the program offset, and the data from the previous block as parameters, and saves this data in the flash memory of the MCU.
  
-The function **F Dwf Digital Spi Write**, from the dwf VI libary, used in the AVR_write subVI, has to be edited: The type of parameter **rgTX** needs to be changed from String to an **Array of Unsigned 8-bit Integers**. A terminal should be also connected to the control field of this parameter. For more information see [[reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#editing_generated_vis|Editing Generated VIs]].+The function **F Dwf Digital Spi Write**, from the dwf VI libary, used in the AVR_write subVI, has to be edited: The type of parameter **rgTX** needs to be changed from String to an **Array of Unsigned 8-bit Integers**. A terminal should be also connected to the control field of this parameter. For more information see [[test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#editing_generated_vis|Editing Generated VIs]].
  
 After the **Uploaded** indicator is turned on, the digital in- and out instruments of the Digital Discovery are reset, to ensure the proper functioning of the MCU. After the **Uploaded** indicator is turned on, the digital in- and out instruments of the Digital Discovery are reset, to ensure the proper functioning of the MCU.
Line 395: Line 395:
 Double click on the main VI (variable_logic_voltage.vi) of the downloaded example to open it with LabVIEW Community. All the functions and subVIs used in the example can be used in your own VI, play around and see what else you can create. Double click on the main VI (variable_logic_voltage.vi) of the downloaded example to open it with LabVIEW Community. All the functions and subVIs used in the example can be used in your own VI, play around and see what else you can create.
  
-**Note:** //For this VI to work, the dwf VI library is necessary (see: [[reference:test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#creating_vis_for_a_shared_library#creating_vis_for_a_shared_library|Creating VIs for a Shared Library]]).//+**Note:** //For this VI to work, the dwf VI library is necessary (see: [[test-and-measurement:digital-discovery:controlling-digital-discovery-with-labview:start#creating_vis_for_a_shared_library#creating_vis_for_a_shared_library|Creating VIs for a Shared Library]]).//
 </WRAP> </WRAP>
 ---- ----
Line 503: Line 503:
 ===== References ===== ===== References =====
 <WRAP group> <WRAP group>
-  * [[reference:software:waveforms:waveforms-sdk:reference-manual]]+  * [[software:waveforms:waveforms-sdk:reference-manual]]
   * [[https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019Ls1SAE&l=en-US|Calling a Dynamic Library (DLL) from LabVIEW]]   * [[https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019Ls1SAE&l=en-US|Calling a Dynamic Library (DLL) from LabVIEW]]
-  * [[reference:pmod:pmodtmp3:reference-manual|]]+  * [[pmod:pmodtmp3:reference-manual]]
   * [[https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc|Arduino Manual Page]]   * [[https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc|Arduino Manual Page]]
   * [[http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf|ATmega48A/PA/88A/PA/168A/PA/328/P datasheet]]   * [[http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf|ATmega48A/PA/88A/PA/168A/PA/328/P datasheet]]
   * [[http://ww1.microchip.com/downloads/en/DeviceDoc/40001906A.pdf|ATmega328PB datasheet]]   * [[http://ww1.microchip.com/downloads/en/DeviceDoc/40001906A.pdf|ATmega328PB datasheet]]
   * [[https://www.arduino.cc/en/Tutorial/ArduinoISP|ArduinoISP]]   * [[https://www.arduino.cc/en/Tutorial/ArduinoISP|ArduinoISP]]
-  * [[reference:pmod:pmodlvlshft:reference-manual|]] +  * [[pmod:pmodlvlshft:reference-manual]] 
-  * [[reference:pmod:pmodda1:reference-manual|]] +  * [[pmod:pmodda1:reference-manual]] 
-  * [[reference:pmod:pmodusbuart:reference-manual|]]+  * [[pmod:pmodusbuart:reference-manual]]
   * [[https://www.engbedded.com/fusecalc/|Engbedded Atmel AVR® Fuse Calculator]]   * [[https://www.engbedded.com/fusecalc/|Engbedded Atmel AVR® Fuse Calculator]]
 </WRAP> </WRAP>
Line 518: Line 518:
  
 ===== Final Notes ===== ===== Final Notes =====
-For more guides and example projects for your Digital Discovery, please visit its [[reference:test-and-measurement:digital-discovery:start]].+For more guides and example projects for your Digital Discovery, please visit its [[test-and-measurement:digital-discovery:start]].
  
-For more information about how to use the software featured in this demo, please visit its respective guide: [[reference:test-and-measurement:guides:getting-started-with-labview]].+For more information about how to use the software featured in this demo, please visit its respective guide: [[test-and-measurement:guides:getting-started-with-labview]].
  
 For technical support, please visit the [[https://forum.digilentinc.com|Digilent Forums]]. For technical support, please visit the [[https://forum.digilentinc.com|Digilent Forums]].
  
 {{tag>project digital-discovery pmod pmod-start pmod-i2c pmodtmp3 temperature-sensor pmodlvlshft pmod-uart pmodusbuart pmodda1}} {{tag>project digital-discovery pmod pmod-start pmod-i2c pmodtmp3 temperature-sensor pmodlvlshft pmod-uart pmodusbuart pmodda1}}