Example Code

Active Technologies AT 1212 Getting Started Example

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Modular Instrumentation

    Software

  • LabVIEW FPGA Module
  • LabVIEW

    Driver

  • NI RIO

Code and Documents

Attachment

Overview
The following example demonstrates how to generate analog data using the AT 1212.


Description
This example shows how to continuously generate analog output data from the AT 1212 adapter module. It allows the user to enable each channel individually as well as dynamically modify the output waveform. This VI is compiled for all FPGA targets by default.


Requirements

  1. LabVIEW 2012 (or compatible)
  2. LabVIEW FPGA 2012 (or compatible)
  3. NI RIO 12.0 (or compatible)
  4. CLIP for the AT 1212


Steps to Implement or Execute Code

  1. Open a session to the FPGA VI and run the VI.
  2. Wait for the adapter module to load its default configuration.
  3. (a) The AO Waveforms are configured and (b) outputs are enabled/disabled.
  4. Reset the FPGA Memory address counter to 0.
  5. Set the counter limit for the deserialization algorithm on the FPGA.
  6. Send the waveforms to the FPGA through DMA FIFOs.
  7. Reset Front Panel Controls/Indicators
  8. Close the FPGA VI reference and display any errors.

Additional Information or References

Host VI Front Panel Screenshot:

at1212fp.png

VI Snippet

11111.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
o.fujioka
NI Employee (retired)
on

Hi, thanks for this example code to get started with AT module.

Just running this example, I get error -304003 from time to time at the very beginning.

It seems that this error is related to initialization of AT adapter module.

AT error 304003.png

  It is found that, in AT's code, there is a subVI called "SerialRead.vi" (........\AT 1212 - Getting Started.zip\AT 1212 - Getting Started\EEPROM\SerialRead.vi ). That VI doesn't properly handle dataflow (or error handling) and as a result there is a potential race condition between two VIs that does a part of initializaion process. 

image 01.png

  I forced data flow between the VIs, then, the error stops occuring.

image 02.png

Thanks!

Osamu

Tim_W.
NI Employee (retired)
on

Can this be re-done to accommodate a PXIe-7976R / LabVIEW 2015?

Aditya_Dhananjay
Member
Member
on

Thanks for sharing this example code.

I'm facing a weird issue, which can be replicated as follows: Configure the host code to generate identical CH 0 and CH 1 waveforms. Connect the "AO 0+" and the "AO 1+" outputs to a spectrum analyzer, and terminate the "AO 0-" and "AO 1-' outputs with 50 ohm terminators. On the spectrum analyzer, I observe that the power on the "AO 1+" output is about 40 dB lower than the output on the "AO 0+" output.

I'm running this code on LV 2014 SP 1. Has anyone else faced a similar issue?

Edit 1: I replaced the AT 1212 card with a different one, but the problem remains.

Thanks,

Aditya

Aditya_Dhananjay
Member
Member
on

Update: SOLVED.

Here is how we solved the problem: Download the AT-1212 "AT_HS_Signal_Generator_V2014_1_9_1" files from the AT website (dated October 27, 2015), and use the initialization routines provided in that set. Specifically, use the InitModule1212(Host).vi in your RT host VI. Now, the power in the "AO 0" and "AO 1" ports is the same.

Ben_S
Active Participant
Active Participant
on

Thanks for letting us know how you solved that issue!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -