LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linux serial access problem

I'm running Labview 6.1 on Linux.  The vi I want to run loads properly, but does not seem able to access the serial port.  The default port is com1 (the vi was written on a Windows system I believe), and occasionally ASRL1::INSTR and ASRL2::INSTR show up in the drop-down box.  I can select ASRL1, but it usually reverts to Com1, and then the ASRL's aren't on the list anymore.

I have run NIvisaic, which looks like the ports are properly setup, and I do have permissions correct.  I have a port tester connected, and RTS and CTS do toggle when I select ASRL1, but when I try to send data using the "Basic IO" function, nothing is sent.  Any ideas?
Thanks
0 Kudos
Message 1 of 6
(2,781 Views)
After another few hours, I accidentally got a few RS232 reads to work.  Here's how:

I used visaconf to enter an alias for ASRL1::INSTR to COM1, as it appears my vi wants COM1 and the ASRL1 designation usually doesn't show up anyway.  I then opened the vi and ignored it.  I started another instance of Labview and opened my vi a second time.  This second one will read for about 5 seconds!!  This is the first reaction I've gotten out of the port, so I'm ecstatic!

What now?  These results give me more questions than answers.
0 Kudos
Message 2 of 6
(2,753 Views)
I found NI's note on a segfault problem.  Mine does give a message after only when I close Labview.  Here is NI's note:
http://digital.ni.com/public.nsf/allkb/A2D53C8E0D88380B86256EBD005B31D2

Here is the message my system gives:

LabVIEW caught fatal signal
6.1 - Received SIGSEGV
Reason: address not mapped to object
Attempt to reference address: 0x46
Segmentation fault


Could this be preventing my ports form working properly?  I don't know how this issue manifests itself.  Also, my system is using Reiserfs, not ext2 as the NI note describes.
0 Kudos
Message 3 of 6
(2,738 Views)
Hello rhauff,

I understand you are having trouble communicating through serial in Linux. Which Linux distribution are you using and what version of NI-VISA do you have installed?

What exactly is happening when you run your program? You mentioned that it works for 5 seconds but then stops. What is happening when it stops? Are there any errors being thrown?

Also, I think it would be most beneficial to try using a basic serial example in LabVIEW (Help » Find Examples) to see if you can get it to work. Navigate to Hardware Input and Output » Serial » "Basic Serial Write and Read.vi". It would also be helpful to perform an NI-SPY capture when running the program to help troubleshoot what is happening. For information on using NI SPY for Linux, please look here. There is also another resource for troubleshooting serial communcation in Linux which can be found here. Hope this helps,
Daniel S.
National Instruments
0 Kudos
Message 4 of 6
(2,724 Views)
Thanks for the reply,
Distribution:  Ubuntu 8.04
NI-VISA:  2.6
Results when running the program:  First instance of LV, the vi runs without errors, but no data is transmitted.  Second concurrent instance of LV, the vi runs for ~5 seconds, then data stops transmitting--no errors.  I have found the second instance has this behavior even if I don't load or run the vi in the first instance.

The only error is the segfault I mentioned above.  It does this not only when I close LV, but occasionally when I close the vi, or when I attempt to open the vi a second time from within LV.

OK, this is interesting.  I went back to the examples as you suggested.  My vi is based on slightly modified versions of Serial Communication.vi and VISA Configure Serial Port.vi, but these are no longer working as they did!  Same behavior, only the second instance will run, for a very short time.  Obviously something has gotten hosed on my LV install, or the base OS.

I will try running NI-SPY and/or upgrading the NI-VISA and let you know what happens.
Roland
0 Kudos
Message 5 of 6
(2,708 Views)
Now I'm getting somewhere.  I reinstalled NI-VISA 2.6, and now the ASRL1 and ASRL2 ports are showing up properly in my vi, I can select ASRL1 and run the vi and data is transmitting for extended periods!  The problem seems to be when I run visaconf and check "Always search for VISA resources".  This causes all of my previously mentioned problems.  If I uncheck this option, things work fine again.  I assumed this option only applied to how visaconf acts on startup.  Apparently it has some much wider implications.
0 Kudos
Message 6 of 6
(2,698 Views)