×

A2007U Labview manual

Table of Contents

1 Overview

This manual describes the usage of the LabVIEW driver created for usage in combination with a Divize A2007U Current Loop Tester.
The following details describe this driver project (following NI template):
Instrument Driver Technology Plug and Play (project)
Supported Language(s) LabVIEW 13
Supported Regional Settings English and Universal desktops
(period or comma separator for number decimal point)
Supported Models Divize USB Current Loop Testers
Models Tested Divize A2007U USB/NFC Current Loop Tester
Interfaces USB 2.0
Firmware Revision Tested ...
Certified NO
NI Supported NO
Source Code Available YES
Driver Revision 1.0, 08/2014, LV_13
Original Release Date August 2014
Current Revision Date August 2014

2 Required Software

Some software components need to be installed before using this instrument driver. The minimum versions of these components are listed below, and can be downloaded from the download Web site.
LabVIEW:
  • LabVIEW 2010
  • LabVIEW 2013
NI VISA:
  • VISA 5.0 for LabVIEW 2010 compatibility
  • VISA 5.4 for LabVIEW 2013 compatibility
Note: VISA has additional software requirements.
For example, if using the IEEE-488 port, NI-VISA requires that NI-488.2 be installed on your system. Check with VISA help for additional support software and hardware requirements.
LabVIEW (and other programs) require to have the FTDI FT231X serial driver installed. On Windows this driver should get installed automatically, on Linux it most likely is installed by default.

3 Installation Instructions

Obtain a copy of the driver software. It is packaged in a archive file. The software is available from the Divize website.

3.1 Microsoft Windows

  1. Use Windows® Explorer and navigate to folder: ...\Program Files \National Instruments \LabVIEW...\instr.lib
  2. Create a new folder: A2007U
  3. Extract the file you downloaded into the "A2007U" folder
  4. You will now have a "...\instr.lib\A2007U\" folder containing multiple files and the "Public", "Private" and "Examples" folders
These files make up an instrument driver. The menu files allow you to view the instrument driver VIs from the Functions palette. The other files contain the instrument driver VIs.

3.2 Linux

  1. Use your file explorer and navigate to folder: /usr/local/natinst/LabVIEW.../instr.lib (installation location may differ, please refer your local LabVIEW installation for exact location)
  2. Create a new folder: A2007U
  3. Extract the file you downloaded into the "A2007U" folder
  4. You will now have a ".../instr.lib/A2007U/" folder containing multiple files and the "Public", "Private" and "Examples" folders
These files make up an instrument driver. The menu files allow you to view the instrument driver VIs from the Functions palette. The other file contain the instrument driver VIs.

4 Accessing the Driver in LabVIEW

There is normally no need to view the library file because the driver functions may be picked from a palette menu.
  • Right-click on a blank place on the VI diagram See the "Functions" palette open. Navigate:
    Functions → Instrument I/O → Instrument Drivers → Divize A2007U
  • Alternately, click diagram’s menu bar: Window → "Show Functions Palette" and navigate the above menus
figure a2007u_menu.png
Figure 4.1 The A2007U palette

5 Using the Instrument Driver

5.1 Explaination of Device VIs

5.1.1 Initialize.vi – Device Connection Initialization

figure initialize_vi.png
Figure 5.1 Initialize.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
Serial Configuration in optional Alternative serial configuration. Default should suffice
error in (no error) in optional Error input, used to chain multiple VIs
VISA resource name out out required Resource name output, connect to other device VIs
error out out optional Error output, used to chain multiple VIs and/or diagnose problems
Establishes communication with the instrument, performs an instrument identification query and resets the instrument.
Call this VI before calling other instrument driver VIs for this instrument. Generally you need to call the Initialize VI only once at the beginning of an application.

5.1.2 Close.vi – Close Device Connection

figure close_vi.png
Figure 5.2 Close.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
error in (no error) in optional Error input, used to chain multiple VIs
error out out optional Error output, used to chain multiple VIs and/or diagnose problems
Terminates software connection to the instrument.

5.1.3 Reset.vi – Reset Device

figure reset_vi.png
Figure 5.3 Reset.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
error in (no error) in optional Error input, used to chain multiple VIs
VISA resource name out out required Resource name output, connect to other device VIs
error out out optional Error output, used to chain multiple VIs and/or diagnose problems
Resets the instrument buffers and sends default setup commands to the instrument.

5.1.4 Revision Query.vi – Get Device Firmware Revision

figure revision_vi.png
Figure 5.4 Revision Query.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
error in (no error) in optional Error input, used to chain multiple VIs
VISA resource name out out required Resource name output, connect to other device VIs
Instrument Driver Revision out optional The LabVIEW instrument driver revision
Instrument Firmware Revision out optional The instrument firmware revision
error out out optional Error output, used to chain multiple VIs and/or diagnose problems

5.1.5 Serial Query.vi – Get Device Serial Number

figure serial_vi.png
Figure 5.5 Serial Query.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
error in (no error) in optional Error input, used to chain multiple VIs
VISA resource name out out required Resource name output, connect to other device VIs
Instrument Serial out required Instrument serial number
error out out optional Error output, used to chain multiple VIs and/or diagnose problems

5.1.6 Set Output.vi – Set Output Value

figure set_vi.png
Figure 5.6 Set Output.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
Current Level in required Current level to set the instrument to. Measured in mA.
error in (no error) in optional Error input, used to chain multiple VIs
VISA resource name out out required Resource name output, connect to other device VIs
error out out optional Error output, used to chain multiple VIs and/or diagnose problems

5.1.7 Fetch Output.vi – Get Output Value

figure fetch_vi.png
Figure 5.7 Fetch Output.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
error in (no error) in optional Error input, used to chain multiple VIs
VISA resource name out out required Resource name output, connect to other device VIs
Actual Current Level out required Current level the instrument is set to. Measured in mA
error out out optional Error output, used to chain multiple VIs and/or diagnose problems

5.1.8 Enable Power.vi – Enable Current Loop Powering

figure power_vi.png
Figure 5.8 Enable Power.vi external interfaces
Port Direction Required Description
VISA resource name in required Resource name input, holds VISA name to device port
Enable Loop Power in required Enable or Disable the loop powering feature of the instrument
error in (no error) in optional Error input, used to chain multiple VIs
VISA resource name out out required Resource name output, connect to other device VIs
error out out optional Error output, used to chain multiple VIs and/or diagnose problems
Warning: Wrongly enabling the loop power can damage the instrument and/or other devices connected to it.

5.2 Examples

To verify communication with your instrument and test a typical programmatic instrument operation, you should first open the Getting Started or Example VIs the instrument driver. Look over each of the controls and set them appropriately. Generally, with the exception of the address field, the defaults for most controls will be sufficient for your first run. You will need to set the instrument resource name appropriately. After running the VI, check to see that reasonable data was returned and an error was not reported in the error cluster.
After you have verified basic communication with your instrument, you might want to customize instrument control for your needs. If your application needs are similar to the Getting Started or Example VI, the simplest means of creating a customized VI is to save a copy of the Getting Started or Example VI by selecting "Save As" from the File menu. You can then modify this example to meet your specific needs.
For more details, reference the LabVIEW Help under Help → VI, Function, & How-To Help.

5.2.1 Loop Powered.vi – Basic Usage

figure loop-powered_example.png
Figure 5.9 Loop Powered.vi example block diagram
This example shows the basic usage of the most common VIs.
From left to right: the device connected as VISA resource name is initialized, the loop power is enabled/disabled based on the value of the Enable Loop Power front panel switch. A new current value is set according to the value of the Current Level dial. The value of the Current Loop Tester is fetched and shown on the Actual Current Level indicator. At last the device connection is closed.

5.2.2 Random.vi – Setting a Random Value

figure random_example.png
Figure 5.10 Random.vi example block diagram
This example is based on the previous example. In this demo however the new current value is based on a random value. This VI can be run continuously while waiting Wait for seconds between itterations.

6 Trouble Shooting

Some common issues are discussed throughout this chapter.

6.1 The A2007U is not recognized as serial device on Linux

Because of the internal settings of the used communication hardware it is possible that Linux refrains from automatically mounting the A2007U Current Loop Tester as serial device.
The following steps may solve this issue:
  1. Plug the device into a free USB port
  2. The device could be recognized, to check run following command to list all USB serial devices
    ls -al /dev/ttyUSB*
  3. We need the device id. Run the following command and search for the device with iSerial set to A2007U-00X
    lsusb -v
  4. Note the idVendor and idProduct for the found device
  5. Unload the FTDI kernel module
    modprobe -r ftdi_sio
  6. Reload the FTDI kernel module while forcing to recognize the A2007U Current Loop Tester. Replace the idVendor and idProduct (without < and >)
    modprobe ftdi_sio vendor=<idVendor> product=<idProduct>
  7. The device should now be recognized, to check run the following command to list all USB serial devices
    ls -al /dev/ttyUSB*

6.2 Permissions on Linux prevent my from using the A2007U

Some Linux distributions need root rights to be able to access serial devices.
One method of solving this issue is adding the user which needs access to the appropriate group:
  1. Add user to the dialout [A]  [A] The name of this user group may differ for your distribution. group using the following command replacing the user placeholder:
    usermod -a -G dialout <user>

6.3 LabVIEW does not show the A2007U device as VISA resource on Linux

Sometimes LabVIEW does not automatically add USB serial devices to the VISA resource list. This problem however could also have other causes, please also check the other trouble solving sections.
Adding a USB serial device to NI VISA:
  1. Add USB serial devices to serial devices list (add as many device names as needed):
    echo "labview.serialDevices: /dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2/" > ~/.labviewrc
If the above step does not solve the issue please refer to the NI VISA manual provided with your installation.

6.4 Test communication with terminal emulator.

The communication to the A2007U can be verified with a terminal emulation program. Teraterm for Windows or GTKTerm for Linux.
To test the communication:
  1. Start the terminal emulation program.
  2. Select the USB-com port the A2007U is connected to.
  3. Set the baudrate to 9600 baud, 8 databits, No parity, 1 stop bit.
  4. Enter *hlp;
  5. The A2007U will display a command summary.

A detailed explanation of the CLI commands is listed on the A2007U software page.

Tera Term terminal emulator for Windowsl
© Divize b.v. ; February 17, 2016 Last update: February 14, 2021.
© 2006-2024 DIVIZE b.v.