Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Jul 25, 2012


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links -Products and Services

Programming the NI SwitchBlock

0 Ratings | 0.00 out of 5
Read in  |  Print |  PDF

Overview

This paper is part of the Getting Started with the NI SwitchBlock series.

Download the entire Getting Started with the NI SwitchBlock white paper series

The NI SwitchBlock is shipped with a comprehensive software package to simplify matrix configuration, control, debugging, and maintenance. You can combine NI SwitchBlock relay cards of the same type in software and program them as a single device. In addition, you can use the NI Switch Executive route management software to graphically configure switch systems one relay at a time for total control, or to automatically route signals between specified switch endpoints using an intelligent routing algorithm. With NI Switch Executive, you also can export your configurations to Microsoft Excel where hundreds or even thousands of routes can be defined in just a few minutes. These features greatly reduce development time in large switch systems while making it easy to visualize and document switch configurations.

Although National Instruments recommends using NI Switch Executive to program the NI SwitchBlock, it is also possible to program the NI SwitchBlock using the NI-SWITCH and NI-DAQmx driver APIs. Programming the NI SwitchBlock in NI-SWITCH and NI-DAQmx explains how to program the NI SwitchBlock with the NI-SWITCH and NI-DAQmx driver APIs.

Table of Contents

  1. Configuring an NI SwitchBlock in NI Measurement & Automation Explorer (MAX)
  2. NI Switch Executive
  3. Programming the NI SwitchBlock in LabVIEW
  4. Debugging Switch Code Using the NI Switch Executive Debug Panel and Switch Soft Front Panel
  5. Programming the NI SwitchBlock in NI TestStand
  6. Next Steps

Configuring an NI SwitchBlock in NI Measurement & Automation Explorer (MAX)

You can program relay cards of the same type as individual matrices or combine them in software and program them as a single device. By combining relay cards, you reduce the complexity of programming multiple devices and take advantage of one continuous span of column numbers across the large matrix.

Figure 1. Six 8x46 NI SwitchBlock relay cards are combined in software to form an 8x276 matrix.

Note: You can mix and match relay cards using different relays or topologies in a single carrier but you cannot program them as a single device in software.

NI Switch Executive

NI Switch Executive is an intelligent switch management and routing application that accelerates development and simplifies maintenance of complex switch systems. The point-and-click graphical configuration and automatic routing capabilities make it easy to program large switch matrices. Using intuitive channel aliases and route names keeps your system documented for future updates.

NI SwitchBlock Configuration Wizard

NI Switch Executive 3.5 includes a wizard that creates hardwires and route reservations for the NI SwitchBlock before you enter the configuration environment. In the first screen of the wizard, you are asked if you want to configure your routes by automatically routing signals between endpoints or by manually selecting relays for each route one at a time. It is important to understand the difference between the two programming options:

Figure 2. The NI SwitchBlock Configuration Wizard automatically creates hardwires and route reservations based on your preferred route creation interface.

End-to-End Configuration

By choosing the end-to-end programming option, you can take advantage of the intelligent routing in NI Switch Executive. Simply click on any row-column or column-column combination inside Routes/Groups, and NI Switch Executive automatically finds a path between the two endpoints.

Figure 3. Given the endpoints, NI Switch Executive automatically creates a route through the NI SwitchBlock.

Note: When using end-to-end programming with the NI SwitchBlock, the graphical configuration on the Schematic tab becomes read-only.

Graphical Configuration

By choosing the graphical programming option, you can specify every relay closure in your route or route group using the Schematic tab in NI Switch Executive. This is most beneficial when configuring routes that you wish to pass through a particular matrix row or analog bus line. The complete control offered in the Schematic tab is also used to optimize relay utilization through relay count tracking. See NI Switch Health Center for more information.

 

Figure 4. Programming with the graphical configuration gives you total control over each relay in the NI SwitchBlock.

Watch the "Programming the NI SwitchBlock" webcast.

Scaling a Switch Configuration in Microsoft Excel

You can drastically reduce the time it takes to program large switch systems by using the Excel Integration feature in NI Switch Executive. After creating a few channel aliases and routes using the configuration options listed above, you can choose to scale your configuration for hundreds or thousands of channels in just a few minutes. This is achieved by manipulating your NI Switch Executive configuration file in Microsoft Excel using the familiar text editing features such as find/replace and click-and-drag formulas.

 Figure 5. Use the text editing features in Microsoft Excel to scale your NI Switch Executive configuration.

Watch the "Simplify Matrix Programming and Scale Large Switch Systems with NI Switch Executive" webcast.

Programming the NI SwitchBlock in LabVIEW

You can program the NI SwitchBlock in the NI LabVIEW graphical system design environment using either the low-level NI-SWITCH and NI-DAQmx drivers or the high-level NI Switch Executive API.

With the NI Switch Executive API, routes that have been preconfigured using the end-to-end routing or graphical configuration can be connected by passing the route name into a single function call. For high-channel-count applications, you can use the string functions to automatically increment route names and dynamically close a large number of routes while minimizing the code.

As an alternative, you can close relays by dynamically finding routes between endpoints using the niSE Find Route VI and passing the resulting string into the niSE Connect VI.

http:/zone.ni.com/cms/images/devzone/tut/a/5054fd41553.gif

Figure 6. The NI Switch Executive API greatly reduces the number of function calls you need to program large switching applications.

Watch the "Reduce the Number of Function Calls by Using the NI Switch Executive API" webcast.

Debugging Switch Code Using the NI Switch Executive Debug Panel and Switch Soft Front Panel

At run time, the NI Switch Executive Debug Panel monitors the state of your live NI Switch Executive session and creates a log of relay activities. Entries in the log are documented using the route and route group names configured in your virtual device. To save time during the debugging process, this application should be used during development to validate the proper execution sequence of switching function calls.

For a graphical representation of the matrix topology, you can launch the Switch Soft Front Panel at run time.

Figure 7. The comprehensive switching software for the NI SwitchBlock includes the NI Switch Executive Debug Panel and the Switch Soft Front Panel.

Programming the NI SwitchBlock in NI TestStand

By programming your NI SwitchBlock with NI Switch Executive, you maximize code reuse between steps in NI TestStand ready-to-run test management software. The NI TestStand switching property is used to quickly add switching to existing tests without modifying code modules. For high-channel-count test systems, you can call routes dynamically using local variables.

Read more about using switches in NI TestStand.

Figure 8. NI Switch Executive is integrated into NI TestStand through the switching property.

Watch the "Integrate Your Switch Configuration into NI TestStand for Automated Test Applications" webcast.

Next Steps

Visit the NI Switch Health Center (Part 3 of 4)

Configure an NI SwitchBlock for Your Application

Watch the Programming the NI SwitchBlock Webcast

Learn More about NI Switch Executive

0 Ratings | 0.00 out of 5
Read in  |  Print |  PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).