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

Controlling a Third-Party USB Serial Interface in Linux Using NI-VISA

Primary Software: Driver Software>>NI-VISA
Primary Software Version: 3.0
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Instrument Connectivity Other>>USB>>USB-232, Instrument Connectivity Other>>USB>>USB-232/2, Instrument Connectivity Other>>USB>>USB-232/4

Problem:
I have a third-party USB serial interface that I will be using on a Linux machine. How do I control this interface with NI-VISA?

Solution:
To use your third-party USB serial interface with NI-VISA in Linux, you will have to add it as a static resource using the NI-VISA configuration utility (visaconf). Visaconf installs with NI-VISA so you need to have NI-VISA installed. See the related link below for the most recent version of VISA for Linux.
Follow the steps below to set up your device:
  • Open a terminal window and type "visaconf" to open the VISA configuration utility window.
  • Click on the "Add Static" button to bring up the "Add new static resource" window, and choose "local serial port" from the Select Interface list.
  • Pick an interface number, and type /dev/ttyUSBx in the "Binding" field, where x stands for the port number on the USB serial interface; so for instance, if you have a 2-port interface, you would type /dev/ttyUSB0 for the first port, and /dev/ttyUSB1 for the second port.


Please note that Linux treats serial ports like files and you must have the appropriate permissions to read/write to the port. See the link below for more information.

Another work around would be to try adding a token to the visaconf file: "WriteTimeoutGranularity = 0" under section "[ASRL-RSRC-ALIAS]".

Note: NI USB-Serial devices require the NI-Serial driver, which is currently only available for Windows



Related Links:
Drivers and Updates: NI-VISA
KnowledgeBase 25OF9TUZ: Why Do I Receive Error 37 When I Run a Serial VI in LabVIEW for Linux?
KnowledgeBase 2LC8I2IT: Troubleshooting Serial Communication in Linux

Attachments:





Report Date: 05/26/2006
Last Updated: 08/23/2007
Document ID: 3XPB9F5N

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