LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

installing VISA USB device under Linux

    Well, well, well... I've never though that such a time will come, but...
Linux. The question is about it.
It so happend that i need to install a custom made usb device under that OS. I've created the driver using NI-VISA driver development wizard and my device works fine under windows. But i don't know how to create a driver for Linux and how to install it there.  Any ideas? Any???

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 1 of 9
(4,287 Views)


@Alexander khodarev wrote:
    Well, well, well... I've never though that such a time will come, but...
Linux. The question is about it.
It so happend that i need to install a custom made usb device under that OS. I've created the driver using NI-VISA driver development wizard and my device works fine under windows. But i don't know how to create a driver for Linux and how to install it there.  Any ideas? Any???


I haven't really checked but I think NI-VISA for Unix does not support the raw USB class. As such you would have to write a real kernel device driver for your device. This would involve writing C code and depending on your device might mean quite some time debugging in kernel space, which is not the most simple thing to do. Without some good basic understanding of the Linux kernel I would consider this an almost impossible task.

Alternatively you might be able to use the generic libusb kernel driver and approach it from a shared library you write in C. to communicate with your specific device. Then you could interface that shared library to LabVIEW through the Call Library Node.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 9
(4,276 Views)
Actually, NI-VISA does support USB Raw on Linux. As a matter of fact the NI DAQmx Base driver is built on top of it. Just open up the NI-VISA help on Windows or Linux. The information is under the Interface Specific/USB category. In most cases if you plug in a device that Linux doesn't ship a driver for it will automatically show up as a VISA resource and you LabVIEW NI-VISA USB programs should run the same on Linux or Mac OS X as they do on Windows.

Enjoy,
Josh
Message 3 of 9
(4,265 Views)
That is what i wanted to hear:) Actually i have some problem installing VISA on my mandrivia linux 10.0. You see the whole installation process goes well except one thing: when updatedrivers application is starting up it gives an error while updating "nikal" or something like that, and says that there are some problems with kernel. If you (or someone else around here) knows what it is about i can send you full description of the error. The result of the error is that every time i use visa labview shuts down. And more over i still can't see usb devices. And driver wizard doesn't allow me to cretate a driver for usb device (actually i don't know if it is supposed to work under linux). Any hints?

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 4 of 9
(4,245 Views)

I would first check the readme and make sure you have everything you need. For example I know that you will need to have your kernel source installed. 

-Josh

0 Kudos
Message 5 of 9
(4,232 Views)
    I've just read this document yesterday and tried to fix the problem that way but still recieve following error:

---------------------------------------
/usr/local/natinst/nikal/src make:
/bin/cp nikal.c objects/nikal.c
/bin/cp nikal.h objects/nikal.h
make -C /lib/modules/2.6.12-12mdk/source SUBDIRS=/usr/local/natinst/nikal/src/objects modules
make[1]: Entering directory `/usr/src/linux-2.6.12-12mdk'

  WARNING: Symbol version dump /usr/src/linux-2.6.12-12mdk/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /usr/local/natinst/nikal/src/objects/nikal.o
/usr/local/natinst/nikal/src/objects/nikal.c: In function 'nNIKAL100_getKernelPageTableEntry':
/usr/local/natinst/nikal/src/objects/nikal.c:1285: warning: passing argument 1 of 'pmd_offset' from incompatible pointer type
/usr/local/natinst/nikal/src/objects/nikal.c: In function 'nNIKAL100_mapUserPageTableEntry':
/usr/local/natinst/nikal/src/objects/nikal.c:1301: warning: passing argument 1 of 'pmd_offset' from incompatible pointer type
/usr/local/natinst/nikal/src/objects/nikal.c: In function 'nNIKAL100_getPhysicalAddress':
/usr/local/natinst/nikal/src/objects/nikal.c:1447: warning: passing argument 1 of 'pmd_offset' from incompatible pointer type
  Building modules, stage 2.
  MODPOST
  CC      /usr/local/natinst/nikal/src/objects/nikal.mod.o
  LD [M]  /usr/local/natinst/nikal/src/objects/nikal.ko
make[1]: Leaving directory `/usr/src/linux-2.6.12-12mdk'
________________________

i've already installed the source code and i don't get what else should i do. Maybe i just can not run visa under mandrivia linux that i'm running now.

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 6 of 9
(4,222 Views)
 

It looks like you are running Mandriva 2006 (as opposed to 10.0).  The version of NI-KAL that shipped with NI-VISA 3.4 does not support Mandriva 2006.  The good news is you can download a newer version of NI-KAL that will install on Mandriva 2006 from:

https://download.ni.com/#support/kal/1.2/

Install NI-KAL then run updateNIDrivers.

Shawn B.
National Instruments

 
Use NI products on Linux? Come join the NI Linux Users Community
Message 7 of 9
(4,196 Views)
Shawn B. wrote:

> It looks like you are running Mandriva 2006 (as opposed to 10.0). 
> The version of NI-KAL that shipped with NI-VISA 3.4 does not support
> Mandriva 2006.  The good news is you can download a newer version
> of NI-KAL that will install on Mandriva 2006 from:
>
> <a href="ftp://ftp.ni.com/support/kal/1.2/"
> target="_blank">ftp://ftp.ni.com/support/kal/1.2/</a>
>
> Install NI-KAL then run updateNIDrivers.
>
> Shawn B.
> National Instruments

This is not exactly an enlightening answer for a typical Linux user. I too
am having difficulty installing this under Debian Etch.

Linux distributions are made of components, the name on the label is a
little meaningless (in my years of experience with Linux, I am yet to find
a single program that will compile with one distro but not another, given
the same tools). So what components exactly does this driver depend upon ?


What am I missing here ? Is it my custom kernel (this is a Debian Etch
system) or some bug in the supplied drivers ?

The installer identified the following :

Checking required install tools...
Checking installer tool versions...
rpm 4.4.1 can be used with a default installation path
tar 1.15.1
Checking dependencies...
glibc 2.3.5
X /usr/X11R6/bin/X
Terminal /usr/X11R6/bin/xterm
Unpacking install files to /tmp/ni4882.install...

My error messages :


The following components, totalling 28444KB, have been selected
for installation:
LabVIEW 7.0 Run-Time Engine
NI-PAL
NI-KAL
NI-488.2 Help
NI-488.2 Utilities
NI-488.2 Driver
Continue? [Ynq] Y


********************************
* NI-KAL 1.0.0f0 for Linux/x86
********************************

This installer will install the NI software using the targz.
This software is covered by the included license file (LICENSE.txt).
By installing this software you are acknowledging acceptance of the
terms of the license.

The installation location for NI-KAL is /usr/local. A natinst/nikal
subdirectory will be created at the specified location.
Installing:
NI-KAL => /usr/local/natinst/nikal

Extracting /tmp/ni4882.install/kal/nikali-1.0.0-f0.tar.gz to /usr/local/...

Checking required tools...

Configuring for linux kernel version 2.6.14.3-raja.

********************************* NOTE *********************************
Using kernel headers found in /lib/modules/2.6.14.3-raja/source.
If this does not correspond to the location of the 2.6.14.3-raja headers,
then define KERNELHEADERS in your environment to point to the location
of the kernel headers, define KERNELTARGET as the version of the
kernel for which to compile, and then rerun ./configure.
********************************* NOTE *********************************

Kernel has reparent_to_init(): yes
Number of arguments for do_munmap(): 3
pte_offset function: pte_offset_kernel()
Number of arguments for remap_page_range(): 4
Kernel has get_user_pages(): yes
Kernel exports get_user_pages(): yes
USB altsetting name: cur_altsetting
Kernel has usb_get_intf(): yes
Kernel has intf_cache member in usb_host_config: yes
Kernel exports usb_set_configuration(): no
Kernel has usb_endpoint_running(): no

Storing configuration in Makefile.in
If the values stored are incorrect they can be changed before running make.

Installing Kernel module...
/bin/cp nikal.c objects/nikal.c
/bin/cp nikal.h objects/nikal.h
make -C /lib/modules/2.6.14.3-raja/source
SUBDIRS=/usr/local/natinst/nikal/src/objects modules
make[1]: Entering directory `/usr/src/linux-2.6.14.3'
CC [M] /usr/local/natinst/nikal/src/objects/nikal.o
In file included from /usr/local/natinst/nikal/src/objects/nikal.c:86:
/usr/local/natinst/nikal/src/objects/nikal.h:172: warning: 'packed'
attribute ignored
/usr/local/natinst/nikal/src/objects/nikal.c: In function
'nNIKAL100_vmaClose':
/usr/local/natinst/nikal/src/objects/nikal.c:196: sorry, unimplemen
0 Kudos
Message 8 of 9
(4,191 Views)
    Installed NI-KAL 1.2 and it solved my problem. Thank you very much.

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 9 of 9
(4,173 Views)