Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

opensuse 10.3, NI-VISA 4.2 and Prologix GPIB-USB controller: almost (?) working

Hallo

Like the subject line says: I think I am struggeling on the last couple meters
with getting the Prologix GPIB-USB controller working using NI-VISA.

********** What works: ***********************************************************************
1)   The device: http://prologix.googlepages.com/   is recognized by the kernel:
> lsusb:
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd 8-bit FIFO

> ls -l /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0 Dec  4 15:39 /dev/ttyUSB0

> lsmod | grep ftdi
ftdi_sio               37128  0
usbserial              35252  1 ftdi_sio
usbcore               123756  6 ftdi_sio,usbserial,nikal,ehci_hcd,uhci_hcd

2) NI-VISA 4.2 installs fine:
> uname -r
2.6.22.13-0.3-default

- kernel-source and kernel-syms packages are istalled
- make cloneconfig
- make modules_prepare
- make modules
- install NI-VISA 4.2  im kernel source directory:
    .......
    Running NI-KAL Post Installation Script ...
    Running NI-PAL Post Installation Script ...
    Running NI-RPC Post Installation Script ...
    Running NI-ORB Post Installation Script ...
    Running NI-DIM Post Installation Script ...
    Running PXI Services Post Installation Script ...
    Running NI-VISA Runtime Post Installation Script ...
    Installation completed successfully.

> cat /etc/profile.local
VXIPNPPATH=/usr/local/vxipnp
export VXIPNPPATH
export LD_LIBRARY_PATH=/usr/local/vxipnp/linux/bin:$LD_LIBRARY_PATH

- reboot

********** not sure how to interprete ********************************************
all done as root on a laptop without generic serial port:

> visaconf
->  Warning! Could not find any dynamic Visa Resources.
       Maybe the adapter is a static resource?

-> edit ASRL1::INSTR
binding: /dev/ttyUSB0
Baudrate (9600), parity  (none), stop bits (1), flow control (none) remain unchanged as prologix manual states that they are irrelevant.

Good sign:
State of device changes with plugging in from: uncertain to ready.

********** surely not good *******************************************************
> NIvisaic
-> unable to find resources using expression "?*"
Return status code 0xBFFF0011
Status name: VI_Error_RSRC_NFOUND


Any help would be appreciated, thanks

                Matthias





0 Kudos
Message 1 of 7
(9,616 Views)
Matthias,

To use a GPIB device you will need to install NI-488.2. We currently do not have a driver that is available specifically for SUSE 10.3. We do have a driver that have been tested on SUSE 10.0-10.1 - which is NI-488.2 2.5 - Linux - 32 Bit. Also there is a Beta driver that has been tested for SUSE 10.2 - which is NI-488.2 2.5 - Linux - Beta.

These driver may work on your system. But please remember that they have not been tested on SUSE 10.3

Thank you very much.


Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 7
(9,596 Views)
Dear Sarah

Thanks for the quick answer, but I am afraid the missing NI-488.2 drivers are not the source of the problem.
The Prologix webpage states:
Prologix GPIB-USB controller provides a virtual serial interface to communicate with instruments, while handling all GPIB protocol details for you. Any test framework, or programming environment, that provides access to serial ports is compatible with Prologix GPIB-USB controller.

Also I am able to talk to the adapter using the terminal program kermit:

    > kermit
    C-Kermit 8.0.211, 10 Apr 2004, for Linux
     Copyright (C) 1985, 2004,
      Trustees of Columbia University in the City of New York.
    Type ? or HELP for help.
    (/root/) C-Kermit>set line /dev/ttyUSB0
    (/root/) C-Kermit>set terminal echo on
    (/root/) C-Kermit>connect
    Connecting to /dev/ttyUSB0, speed 9600
     Escape character: Ctrl-\ (ASCII 28, FS): enabled
    Type the escape character followed by C to get back,
    or followed by ? to see other options.
    ----------------------------------------------------
    ++ver     (enter)
    Prologix GPIB-USB Controller version 5.0

Which also excludes a faulty device as source of the problem.

Best regards
            
             Matthias

P.S. As I live in Austin, I can come by if you want to look yourself at the adapter 🙂  .





0 Kudos
Message 3 of 7
(9,582 Views)
Matthias,

If this device simply appears as a serial port then using it with NI-VISA should be fairly simple.  From what you posted it looks like everything is working as expected, but I'm guessing your problem is that your serial ports are only readable and writeable as root.

bohrer sbohrer # ls -l /dev/ttyS*
crw-rw---- 1 root uucp 4, 64 Oct 18 08:51 /dev/ttyS0
crw-rw---- 1 root uucp 4, 65 Oct 18 08:51 /dev/ttyS1
crw-rw---- 1 root uucp 4, 66 Oct 18 08:51 /dev/ttyS2
crw-rw---- 1 root uucp 4, 67 Oct 18 08:51 /dev/ttyS3

So you can either run NIvisaic as root, or add permissions to your serial port.  A "chmod 666 /dev/ttyUSB0" may be all you need to do.

Shawn Bohrer
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 4 of 7
(9,574 Views)
Shawn,

I do work as root (at least right now in the debugging phase) ;  I also tried
> chmod 666 /dev/ttyUSB0
which didn't help.
However I regonized that NIvisaic never tries to open /dev/ttyUSB0 while visaconf does:

    > strace  visaconf  2>&1 |grep tty
    open("/dev/ttyUSB0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
    open("/dev/ttyS1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
    open("/dev/ttyS2", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
    open("/dev/ttyS3", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
    open("/dev/ttyS7", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS6", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS5", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS4", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS3", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
    open("/dev/ttyS2", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
    open("/dev/ttyS1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
    open("/dev/ttyS0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9

    >strace  NIvisaic  2>&1 |grep tty
    open("/dev/ttyS7", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)   
    open("/dev/ttyS6", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS5", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS4", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS3", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS2", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10

Where does NIvisaic lern from which devices to open?

Thanks
             Matthias


0 Kudos
Message 5 of 7
(9,559 Views)
Sarah and Shawn

If the mountain doesn't come to the prophet ..... I tried a hardlink:
    > rm /dev/ttyS4
    > ln /dev/ttyUSB0 /dev/ttyS4
    > ls -l /dev/ttyS4
    crw-rw---- 2 root uucp 188, 0 Dec  7 10:17 /dev/ttyS4

So if I now start NIvisaic:
    > strace  NIvisaic  2>&1 |grep tty
    open("/dev/ttyS4", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS7", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS6", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS5", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
    open("/dev/ttyS3", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS2", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyUSB0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS2", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS3", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyUSB0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10
    open("/dev/ttyS4", O_RDWR|O_NOCTTY|O_NONBLOCK) = 10

in the NIvisaic window the prologix device shows up  twice, as ASRL1::INSTR and ASRL5::INSTR.
And the best: BOTH ENTRIES WORK e.g.  with the Basic Serial Read and Write.vi
(set enable Termination char to off in the Visa Configure Serial Port  SubVI).

This looks like very much as if NIvisaic stops scanning if it doesn't find anything
at /dev/ttyS? but does go further otherwise.

Matthias

0 Kudos
Message 6 of 7
(9,519 Views)
P.S. I just installed everything on a desktop machine with two standard serial ports:
everything worked out of the box, no need to set the link.

P.P.S.  Don"t forget the linux-kernel-headers package , otherwise make cloneconfig will fail.
    > rpm -qa | grep kernel
    kernel-default-2.6.22.13-0.3
    kernel-source-2.6.22.13-0.3
    linux-kernel-headers-2.6.22-19
    kernel-syms-2.6.22.13-0.3

0 Kudos
Message 7 of 7
(9,491 Views)