Example Code

Software Timed Switch Scanning

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

  • Data Acquisition (DAQ)
  • Modular Instrumentation

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview
This VI will make an explicit path connection from one column to another in multiple NI SwitchBlock devices using NI-DAQmx.

 

Description 

This example demonstrates how to scan a series of channels on a switch using software timed scanning.

This example will work with all NI Switching hardware. This includes the following devices that do NOT support hardware timed scanning:

NI 2810

NI 2811

NI 2812

NI 2813

NI 2814

NI 2815

NI 2816

NI 2817

NI 2833

NI 2834

SCXI-1160

SCXI-1161

SCXI-1163R

SCXI-1190

SCXI-1191

SCXI-1192

Requirements

Software

    1. LabVIEW 2012 (or compatible)
    2. NI-DAQmx 9.3.5
    3. NI-SWITCH

Hardware

    1. NI SwitchBlock Module


Steps to Implement or Execute Code

  1. Change Switch Device Name and Topology Name as necessary.
  2. Change Scan List as necessary.
  3. Hit run.

 

Block Diagram Steps:

  1. Set topology.
  2. Specify scan list (SubVI creates a list of trigger counts, DAQmx Multiconnect strings, and channel connections) .
  3. Connect Channels from DAQmx Multiconnect String (DAQmx) or from Channel connection lists (NI-SWITCH).
  4. Perform Operations
  5. Disconnect Channels
  6. Continue until all items in array have been switched
  7. Display errors (if any).

I/O Connections Overview:

 

Refer to the NI Switches Getting Started Guide and NI Switches Help for information about connecting signals to your switch module.

 

NOTE: These examples do NOT support "No-Action Mode".

 

Additional Information or References

VI Snippet

1111.png

 

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

 

Frank,
National Instruments
Software Group Manager

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