Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Using the LabVIEW VISA Find Resource Function with the NI-845x Device

Primary Software: Driver Software>>NI-CAN
Primary Software Version: 1.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>LabVIEW Base Package

Problem:
I am trying to use the VISA Find Resource function to locate my NI-845x. How can I wire the VISA resource output into an NI-845x Property Node resource input?

Solution:
Directly wiring the output of the VISA Find Resource function to the NI-845x will create a broken wire. This is because the output of the VISA Find Resource function is a VISA device resource data type and the input to the NI-845x property node is a device specific NI-845x device resource data type. The connection between the two can be made using a type cast function. The SubVI attached below implements this.

The string output of the VISA Find Resource can be wired to this SubVI which then uses the Type Cast function to change the reference from a VISA device reference to an NI-845x device reference. When doing this make sure you use the NI-845x device reference as the type input to the Type Cast. This reference looks similar to the VISA device reference but is found in the NI-845x function pallet.

Some of the NI-845x VIs will directly connect with a small red dot at the input terminal. This is a coercion dot and shows you that the input is being forced to the correct type, basically doing the same thing as a type cast. The NI-845x property node does not coerce so the Type Cast needs to be manually implemented.

This SubVI could also be used for other drivers that may encounter this issue. Simply replace the NI-845x device reference with one from the specific driver of the device you are using.

For more information on how to use the VISA Find Resource see the KnowledgeBase linked below.

Related Links:
KnowledgeBase 3WADAH2W: How to Programmatically Detect USB-8451 i2c/SPI Interfaces
KnowledgeBase 42GHNJAC: Programmatically Retrieving VISA Resource Names in LabVIEW
Developer Zone Tutorial: New USB I2C and SPI Interface
Drivers and Updates: I2C & SPI

Attachments:


NI-8451x convert reference VI.JPG - NI-8451x convert reference VI.JPG NI-8451x convert Reference.vi


Report Date: 05/04/2007
Last Updated: 02/14/2008
Document ID: 4939HDPS

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