If you are not yet familiar with LabVIEW we recommend using the training "Learn LabVIEW " to become better acquainted with the software. These multi-media modules are free and self-guided.
As you continue through the rest of this article, please note that a basic understanding of LabVIEW including the environment and structures is required.
There are two options for installation: either install the NI ELVIS III Software Bundle which will include LabVIEW, Real-Time, the NI ELVIS III Toolkit, and everything else needed to program NI ELVIS III or you can just install the NI ELVIS III Toolkit. See "Installing the NI ELVIS III Software Bundle" for further details including where to find the download.
Figure 1: LabVIEW Pallet for NI ELVIS III APIs
NI ELVIS III has seven instruments that can be accessed through a soft front panel that represents the same controls as a traditional benchtop instrument panel to measure, output, and customize the instrument. For NI ELVIS III, videos of how to use instruments including the oscilloscope and bode analyzer see Explore NI ELVIS Instruments.
However, if there is a need to automate measurements or there is a requirement for post-processing data, the LabVIEW API for the instruments can be used to program a fully customizable interface.
Each instrument API closely follows a standard pattern you will find throughout LabVIEW. This pattern is found in thousands of LabVIEW instrument drivers and APIs used by professionals in industry around the world.
Understanding this pattern enables the rapid use of any of those drivers in your application. The pattern is as follows:
Figure 2: Standard LabVIEW instrument program
The complete set of instruments can be found in the Instrument pallet.
Figure 3: Oscilloscope Pallet
An example of how these VIs can be connected together to program an instrument is seen below. The Function Generator and Variable Power Supply Instruments are demonstrated in a singular automated dataflow below.
Depending upon the instrument, an explicit Run command might be required in the code to begin execution, and if used in a loop must be stopped before changing its configuration.It is a good rule of thumb to stop an instrument before making changes to its settings.
Figure 4: Example of FGen and VPS program in LabVIEW
LabVIEW can be used to quickly and simply automate a sequence of tasks and record the data. The built-in IV Analyzer is perfect for BJT and diode analysis but if you want to go further and automate your own MOSFET analysis LabVIEW is the perfect tool for the job.To test a MOSFET we need to set the gate voltage and then sweep the drain voltage while monitoring its current. We then repeat this for a series of gate voltages. This results in a graph like this:Figure 5: Output Characteristics Graph for ZVN2110AWhen written in LabVIEW, this is implemented using nested for loops where the outer loop sets the gate voltage and the inner loop sweeps the drain voltage.Figure 6: Sweeping gate and drain voltagesThe Function Generator and the Variable Power Supply will be included within the code to fulfill the functions we need. The Function Generator will control the gate voltage while the Variable Power Supply will control the drain voltage. The Variable Power Supply instrument will report the actual output voltage and current. Implementing this results in the following example code:
Figure 7: Completed MOSFET IV curve traceAll that is now needed to test the code is to grab a MOSFET. To Utilize a MOSFET:
Download the full, completed example code here.
Place the MOSFET onto the prototyping board and add a jumper wire to each MOSFET connection
Connect a BNC Scope Probe to Function Generator CH 1 and a pair of Banana to Alligator Clip Set to the Variable Power Supply Ground and +15V.
Connect probes to MOSFET jumper wires as shown below:
Figure 8: MOSFET Jumper Wire Connections
Click run on the example code and view the VI to display the graph of the automated measurements. Figure 9: Example Code Front Panel
The control I/O pallet consists of a set of Express VIs and low-level VIs which allow direct command over the NI ELVIS III control I/O. These commands are implemented on a real-time processor based upon a reconfigurable I/O (RIO) architecture. The RIO architecture is the exact same technology used in over 35,000 companies around the world.Unlike the Instruments I/O, the control I/O prompts users to drop an Express VI (a VI whose settings you can configure interactively through a dialog box).The Express VI configuration dialog contains the open, configuration, and read/write commands in a single setting.Figure 10: Details of the Control I/O pallet By placing an Express VI onto a block diagram, it automatically opens its configuration window. All Express VIs can be reconfigured by double clicking on them at any time. As an example, the Analog Output configuration window is seen below:Figure 11: Analog output configuration window As can be seen above, the configuration window sets the mode (single vs n sample), what channel is used, and the sample rate. The data to output is fed into the input that is automatically generated on the Express VI when the configuration window is closed. If more customization is needed than the Express VI configuration window, then low-level VIs can be used to achieve the same outcome.
In addition to the instruments available with the NI ELVIS III, there are integrated Analog Inputs, Analog Outputs, and Digital I/O connections. Internally they are used in various ways to read encoders, output PWM signals, and communicate via digital protocols like SPI and I2C.In this example, we will build a simple temperature control application to limit a BJTs temperature so that it stays near a target temperature value. Most control applications require tight timing and most instruments are designed to deliver a set of data which it has collected during a previous time period and not simply return the value as quickly as possible. This can introduce an unnecessary time delay if they were used. Instead, we will read a Thermistors value directly using the Analog Input, condition the voltage value to convert to resistance, convert the resistance to Temperature, and finally evaluate the temperature to control the BJT. The final circuit diagram will be:Figure 12: Thermal Plant Circuit Diagram Start by building the Sensing Circuit as follows:
Supply 5V and ground signal from the workstation to the breadboard.
Using a jumper wire, connect the +5 V DC from the breadboard strip to the + rail of breadboard.
With another jumper wire, connect the AGND from the breadboard strip to the – rail of the breadboard.
Connect the 10 K resistor R1 to 5V DC.
Locate a 10 kΩ resistor in the kit, the color code is brown, black, orange. Connect one end to the + rail of the breadboard.
Connect the other end to an empty area in the breadboard.
Connect thermistor to the R1 and ground.
Connect one end of the thermistor to the same node as R1.
Connect the other end to the – rail, to ground the circuit.
Connect AI0 (analog input) from bank A to measure the voltage divider.
Use a jumper wire to connect from analog input AI0 to the same node as the voltage divider RI and thermistor.
It should look like this image:Figure 13: Sensing Circuit With the Temperature Sensing circuit in place we can now build the Thermal Plant. We will add the BJT and attach it to the Thermistor.
Place the BJT on the breadboard such that it is in contact with the Thermistor
Ideally heat shrink can be used to keep the Thermistor and BJT touching so that the heat can be measured. Tape can be used if heat shrink is not available.
Connect the 10 K resistor R2 to the NPN Transistors Base.
Locate a 10 kΩ resistor in the kit, the color code is brown, black, orange. Connect one end to the Base connection of the BJT.
Connect AO0 (analog output) from bank A to control the BJT.
Use a jumper wire to connect from analog output AO0 to the empty area connected 10kΩ resistor.
Connect the BJT to the Ground and Voltage Rails.
Connect the Collector to the 5V rail of the Breadboard.
Connect the Emitter to the Ground rail of the Breadboard.
Figure 14: Final Thermal Plant Circuit The code itself is quite simple and broke into several steps. The overall flow will be described below and then the two conversion steps will be covered in more detail. The code accomplishes the following:
The Analog Input VI reads a single sample from A/AI0 (Pin 0)
The value is converted from Voltage to the Thermistor's Resistance (Ohm) based on the Voltage Divider Parameters.
The Thermistor Resistance is then converted to Temperature (C) using the Thermistor Parameters.
The Temperature is then compared to the Temperature Setting (C) to determine whether the Analog Output A/AO0 (Pin 48) is turned on or off.
The current status of the Analog Output is indicated by LED0
Figure 15: LabVIEW Top Level Thermal Plant Control Code Figure 16: Voltage Divider SubVIFigure 17: Thermistor Volt to C Conversion SubVIWith the circuit constructed and the example code downloaded you are now ready to open and run the example.
Extract the bjt_thermistor_control.zip which can be downloaded from here.
Open the Academic IO - Control IO - BJT Temperature Control.lvproj
Open the RT Main.vi from the Project Window.
Run the VI
You can adjust the temperature using the Temperature Setting knob.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.