Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 2 out of 5     Rate this Document

Choosing Between the NI-SWITCH API and the DAQmx Switch API for Switch Applications

Primary Software: Driver Software>>NI-SWITCH
Primary Software Version: 3.3
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-DAQmx

Problem:
I am creating a new switch application and I see that I have two programming options, the NI-SWITCH Application Programming Interface (API) and the DAQmx Switch API. Which one should I use for my application?

Solution:
While the NI-SWITCH and DAQmx Switch APIs are very similar in terms of switching functionality, there are a couple of fundamental differences between the two interfaces. It is possible both APIs will work for your application, but often the application and your personal coding preferences will determine the correct API to use. Refer to the following information to choose between the NI-SWITCH and DAQmx Switch API. Note that both the NI-SWITCH and DAQmx Switch APIs are compatible with LabVIEW Real-Time.

NI-SWITCH is an IVI specific driver which would maintain consistent programming techniques if other IVI specific drivers (like NI-SCOPE or NI-DMM) are being used in the system. If you are familiar with the programming style of NI’s IVI-specific drivers, this may be your preferred way to program. However, because communication is session-based, you must open a unique session for every switch module. Therefore this option is less-efficient when working with multiple switches and performing multi-module scanning. Examples to get you started with the NI-SWITCH API can be found in the following directories:
  • C:\Program Files\National Instruments\LabVIEW 8.2\examples\instr\niSwitch (LabVIEW)
  • C:\Program Files\IVI\Drivers\iviswtch\Examples\CVI (CVI)
NI-DAQmx is not IVI-compliant, but brings advantages to multi-module scanning. The DAQmx Switch API gives you the ability to create scan lists that span multiple devices and therefore eliminates the session overhead you see with the NI-SWITCH API. Examples to get you started with the DAQmx Switch API can be found in the following directories:
  • C:\Program Files\National Instruments\LabVIEW 8.2\examples\DAQmx\Switches (LabVIEW)
  • C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Switches (ANSI C)


Related Links:
Developer Zone Tutorial: Multi-module Scanning with National Instruments Switches
IVI: Interchangeable Virtual Instruments

Attachments:





Report Date: 11/13/2006
Last Updated: 11/14/2006
Document ID: 43CFNUAY

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit