Programming the NI SwitchBlock

Overview

The NI SwitchBlock offers a comprehensive software package to simplify matrix configuration, control, debugging, and maintenance. You can combine SwitchBlock relay cards of the same type in software and program them as a single device. In addition, you can use the 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 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 NI recommends using NI Switch Executive to program the NI SwitchBlock, it is also possible to program the NI SwitchBlock using the NI-SWITCH driver API. 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.

 

Download the entire Getting Started with the NI SwitchBlock series

Contents

 

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 8 x 276 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.

 

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.

 

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.

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

 

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, you should use this application 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.

 

Was this information helpful?

Yes

No