LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with VISA serial config linux

Highlighted
I am having problems configuring a serial port in Linux.
I use Redhat9.0 and am attempting to configure a serial port using the "Visa Configure Serial Port.vi"
When I try to configure the VISA serial port, I always get the same error: "code: -1073807346, property node in VISA Configure Serial Port." That code isn't listed in the database.
I think I have most all of the property nodes properly set (the baud rate, termination character etc.) But I am unsure about VISA resource name. I tried entering "COM1" "COM2" "ttya" "tty0" "ASRL2:INSTR" None of these worked. I tried changing the resource type to "Serial Instr" but that didn't seem to matter either.
Any ideas on how to fix this? Is there some configuration of t
he port I need to do before I can use it with Labview?

I've attached my Labview program (SerialInit.vi) with the configVI that's giving me troubles.
Thanks for your help.
0 Kudos
Message 1 of 8
(2,926 Views)
Highlighted
Have you tried with a program how hyperterminal in windows? If you find it in Linux, you can communicate with instrument serial without labview, when communication it's ok, you can bring right settings and tried with LV.If with hyperterminal you don't communicate then the problem is in the cable or in the port
0 Kudos
Message 2 of 8
(2,926 Views)
Highlighted
Hi jonny

I can run it with LV 7.0 on my slackware box. However, I always get a warning: "code: 1073676424, Visa Set I/O Buffer Size in SerialInit.vi"

To answer your question, looks like you don't have VISA configured properly. Try going to /usr/local/vxipnp/linux/NIvisa/ to run 'visaconf' and 'NIvisaic' for configuration and intereaction, respectively. You may have to do this as root. When done, the VISA resource name should magically appear in the control pull-down of your app. If you don't see it in the control, then it usually means that visaconf hasn't been run properly.

When using Linux there can be any number of gotchas. Like the other poster said, you may want to use a hyper terminal-like interface to validate port config. I use minicom.
Message 3 of 8
(2,926 Views)
Highlighted
Methis:

The warning code in Set I/O Buffer Size is expected behavior on Unix platforms. The Win32 API allows the user to specify the size of a preallocated buffer that the kernel will keep inbound data in. This is not a feature that the Posix API supports, at least not that I am aware of.

The reason we give a warning rather than an error is that the OS buffer is usually large enough for most customer applications. The reason we give a warning at all is that we want users to realize that VISA can't satisfy the request completely by itself.

Dan Mondrik
National Instruments
0 Kudos
Message 4 of 8
(2,926 Views)
Highlighted
Hi again-
I tried to run the visaconf and NIvisaic tools (as root, of course). But I could not run them . I get the following error message:
/usr/local/vxipnp/linux/NIvisa/visaconf

./visaconf: error while loading shared libraries: libvisa.so: cannot open shared object file: No such file or directory

same happened for NIvisaic.
what am i missing?
Another discussion thread (http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/c9858cb0446896a786256bb800503692?OpenDocument)
said something about linking linking libvisa.so to the user library--but I couldn't interpret this nebulous instruction.
thanks again for your help 😃
0 Kudos
Message 5 of 8
(2,926 Views)
Highlighted
In article <506500000005000000EF330100-1066448259000@exchange.ni.com>,
"jonny e" wrote:

> Hi again-
> I tried to run the visaconf and NIvisaic tools (as root, of course). But
> I could not run them . I get the following error message:
> /usr/local/vxipnp/linux/NIvisa/visaconf
>
> ./visaconf: error while loading shared libraries: libvisa.so: cannot
> open shared object file: No such file or directory
>
> same happened for NIvisaic.
> what am i missing?

Hey, you found another gotcha! This is good coz it's common with many app
installations. Long story short, place the following in your
/etc/ld.so.conf

/usr/local/vxipnp/linux/lib
/usr/local/cvirte/lib

Then run 'ldconfig' as root. This will configure the run-time bindings to
the shared libraries. Look at the man page for details.

Some more details...
Whenever you get an error message like that, try using 'ldd' against the
executable. For example, 'ldd /usr/local/vxipnp/linux/NIvisa/visaconf'
(as any user) will produce the following:

libvisa.so => /usr/local/vxipnp/linux/lib/libvisa.so (0x40022000)
libcvi.so.5 => /usr/local/cvirte/lib/libcvi.so.5 (0x40054000) libc.so.6
=> /lib/libc.so.6 (0x40288000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2
(0x40000000) libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40399000)
libnsl.so.1 => /lib/libnsl.so.1 (0x40472000) libpthread.so.0 =>
/lib/libpthread.so.0 (0x40487000) libdl.so.2 => /lib/libdl.so.2
(0x4049e000) libm.so.6 => /lib/libm.so.6 (0x404a2000)


In your case some of the paths should show something like "not found".
After running ldconfig with the new lib paths in your ld.so.conf file,
they will appear. Then you should be able to run visaconf, unless there
are more problems.

BTW, I assume that since I don't use Redhat the paths to ld.so.conf may be
different. Perhaps they have a totally different mechanism. If you can't
find the file, you can always test this method by passing the path of the
library to the 'ldconfig' command directly with the -l option (see man
page).

I would think the RPMs or the install script would handle this stuff but
since I've never used them...

Let me know if it's still not working. I'll be around for a while tonight
🙂
0 Kudos
Message 6 of 8
(2,926 Views)
Highlighted
Hi Methis-
You are a true champ! I did what you suggested above and everything works now.
Thanks again for your help!

ps. where did you learn all this stuff? i've been using linux for almost a year and still have much to learn 😃
0 Kudos
Message 7 of 8
(2,926 Views)
Highlighted
In article <50650000000500000095340100-1066448259000@exchange.ni.com>,
"jonny e" wrote:

> Hi Methis-
> You are a true champ! I did what you suggested above and everything
> works now.
> Thanks again for your help!
>
> ps. where did you learn all this stuff? i've been using linux for
> almost a year and still have much to learn 😃

Oh please, you're making me blush. Really, I'm not as far along as I
could be. I started working with Linux about a four years ago. Only for
the past year have I completely submerged myself. Seriously though,
windows is like crack. It's very hard to break free of it. What you need
to do is commit yourself (at the minimum) to a dual boot system with
windows and Linux. Then gradu
ally you find that you never even use
windows... for anything.

man pages and googling usenet are your best friends.

Good luck with the VISA stuff. Feel free to use my email (without
'killspam') for Linux specific questions.
0 Kudos
Message 8 of 8
(2,926 Views)