Skip to main content

LabVIEW

Introduction

LabView (National Instruments link) is used extensively through the undergraduate labs, in particular in levels two, three and four.

 

For an introduction to LabView, please see the following document that is used in L2 labs.

 

This page is maintained as resource for LabView drivers for hardware that is currently in use. If you have a driver that is not here that you think would be useful to others, please contact the maintainer of this page.

 

The drivers are linked from the respective hardware pages, and require your Durham CIS login to access. Details of the use of each driver can be found on the respective pages.

 

This is an evolving resource. You should be aware that the information here is not exhaustive nor even necessarily correct. The drivers are supplied for you to develop your own LabView virtual instruments.

 

Demo and Tutorials

National Instruments also have a number of tutorials that you may find useful, and also an evaluation version of the student edition of LabView.

 

Note that the Evaluation edition is for your personal study and not for you to prepare you lab project with. A full version of Labview is provided in the physics department laboratory computers.

 

You can also refer to the Physics Departement's own guide below:

 

Resources

Mercury iTC

Although you can download a driver from Oxford Instruments to work with labview we do not recommend this at this moment (Jan 2013), as it has reliability issues. Although it runs fine initially, over many repeat readings the instrument stops responding.

 

Instead we recommend using the standard Labview Instrument IO module.

 

Before you try to using, I strongly recommend that you check the instrument is communicating properly using NI MAX. The standard IDN? does not work, however querying READ:SYS:CAT\n when communicating with the instrument should return all the modules in the instrument. Equally (assuming one of the instruments is MB1.T1, then READ:DEV:MB1.T1:TEMP:SIG:TEMP\n should return the sample temperature.

 

NOTE: Querying the temperature when there is not a probe connected will not work - make sure there is a sensible temperature on the instrument display.

 

The Mercury uses it's own SCPI commands, which are non-standard; therefore the IDN? query will not respond.

 

To add an Instrument IO to your block diagram, select 'Express', then 'Input', then 'Inst Assist'.

 

To query the instrument add a step 'Query and Parse'

 

The return of READ:SYS:CAT\n is the modules in the system. This will return something like

STAT:SYS:CAT:DEV:MB1.T1:TEMP:DEV:MB0.H1:HTR This means that there are two units with names or Unit ID's (UID); a temperature sensor module called MB1.T1 and a heater module called MH0.H1. Once you have this information you can query useful commands. With the Temperature module (in this case UID = MB1.T1) then the following commands hold

 

CommandExplanation
READ:DEV:MB1.T1:TEMP:SIG:TEMP Read Cryostat Temperature (MB1.T1)
SET:DEV:MB1.T1:TEMP:LOOP:TSET:20 Set temperature to 20K
SET:DEV:MB1.T1:TEMP:LOOP:TSET:20.56 Set temperature to 20.56K
READ:DEV:MB1.T1:TEMP:LOOP:TSET Read Set Temperature (MB1.T1)

Keithley 2000 Multimeter

Driver

K2000.zip (CIS Password Required)

 

Use of Driver

The labview drivers for the Keithley 2000 multimeter provided by Keithley are straightforward to use. In the Data folder, there are two vi's 'Data Read Single.vi' and 'Data Read Multiple.vi'. The single reads a single value, whereas the multiple takes a number of values and finds the average.

Tips and Tricks

You can find download links for all these examples at the bottom of the page.

 

Shift Registers

Shift registers are the easiest way of using a iterator within a loop. Where in Python one might write

 

for ii in range(0,...) print ii

 

In Labview the equivalent can be composed with Shift registers. These take the value from the end of a loop iteration and feed it into the beginning of the next iteration. They are created in pairs opposite each other. Below is a simple example

 

A more complicated setup is shown below. This monitors the value of an integer and allows you to step forward or backwards, or reset to a defined value the starting value.

 

The triangular symbol () is a select function and allows different input values for a boolean input. It makes an easy switch.

 

Write to Measurements / Dynamic Data

This is the easiest way to write data to a file. In order to name the columns you need to edit the Data Atributes. This can be done through the "Set Dynamic Data Attributes" express vi. Using this you can name column headers (only one per vi). Note if you have more than one column you need to set the signal index before connecting to the Signal Name string. You cannot connect an array of strings :-(. You can also use this to set a timestamp. Note that a timestamp can be done using the write to measurements file, however adding a 'Set Dynamic Data Attributes' will break that. 

 

Lower level File Writing

The "Write to Measurements" only works for data (i.e. floating values). If you want to write a mix of data and strings then you are better using the lower level file controls as shown below. You need to format everything into a string (using \t as tabs between columns), and then write this to the file. Note that if you want headers / column titles you will have to do this yourself. 

 

Resources