Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read from ENET-485/4 serial ports on Linux

We're attempting to read and write from a 4-port NI ENET-485 device on Red Hat Enterprise Linux WS 4 (connected directly via a crossover ethernet cable).  The device has been successfully configured to use the ip 192.168.0.200 and we're able to successfuly run a loopback test on Windows.  However, when we run this same loopback test on the Linux machine, the viOpen and viWrite complete successfully but the viRead comes back with a timeout error.

The address we are using is as given within visaconf:
ASRL0::192.168.0.200::x::INSTR
(where x is 1, 2, 3, or 4 corresponding to the port)

Talking to the ports directly via NIvisaic on Linux gives the same results:  VISA Open and VISA Write return success but VISA Read results in a timeout error.

We also tried using different versions of the NI-VISA driver.  Originally we were running v4.2 and tried both upgrading to v4.3 as well as downgrading to v4.1 (based on this thread... http://forums.ni.com/ni/board/message?board.id=140&message.id=26153&query.id=45715#M26153), all to no avail.

Any ideas on what we might be missing?

Thanks in advance for your help,
Melissa

0 Kudos
Message 1 of 5
(4,100 Views)
Melissa,

Are you getting any data back at all when you try to read back during the loopback test? I will keep looking into this to, but it might also be useful if you wouldn't mind posting the NIspy capture from your Linux machine.
-Marshall R
0 Kudos
Message 2 of 5
(4,085 Views)
No data is coming back at all when running the loopback test on Linux.

Attached are NISpy captures:
nispy_linux - capture from running a simple test written in LabView on Linux.
nispy_windows - capture from running that same simple LabView test on Windows.
nispy_linux_def - capture from running the example vxipnp/linux/NIvisa/Examples/C/Serial/RdWrtSrl.c on Linux.

Thanks,
Melissa

Download All
0 Kudos
Message 3 of 5
(4,044 Views)
Howdy mshi,

The only difference I can see between the LabVIEW Linux application and LabVIEW Windows application, from the NI Spy capture logs, is the line 9 of the nispy_linux1 log that deals with the termination character enable (TERMCHAR_EN). This shouldn't really affect the communication, though.

Since the application works in Windows, we at least know your ENET-485 is functioning. Now since we're having problems in Linux, I suspect some configuration issue. Just out of curiosity, do you have the necessary ports open in your Linux OS? This article lists the ports needed to be opened: KnowledgeBase 2GD9CL6Q: What Ports Do I Need to Open on My Firewall for National Instruments Softwar...
Warm regards,

pBerg
0 Kudos
Message 4 of 5
(3,982 Views)
Hello,

Please try setting the serial wire mode attribute using viSetAttribute on VI_ATTR_ASRL_WIRE_MODE.  It may be defaulting to -1, which is an invalid value, and the loopback most likely should be set for wire mode of 0.  If 0 still gets a timeout, try the other valid values.  Please see the NI-VISA Help for more details.


Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 5 of 5
(3,972 Views)