LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time out using VISA on NI 9871

Hi,

 

starting from \National Instruments\LabVIEW 2018\examples\Instrument IO\Serial\Continuous Serial Write and Read.vi I'm getting start with VISA driver. If I correct understood the vi implement a write and read operation on same port.

In my case I've build a new project based on my HW (crio chassis 9043 and NI 9871 for serial port) a loopback connector on serial cable (in according with http://www.ni.com/pdf/manuals/371253e.pdf), set the chassis in scan mode, deployed the project and run… I get the error : 

 

error -1073807339 occurred at VISA Read in serial.vi

Possible reason(s):

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

 

I don't understand why the port is the same so the configuration should be right, VISA driver see the resource (none error from "VISA Configure Serial Port" module) and none error in write VI 

0 Kudos
Message 1 of 7
(3,181 Views)

Hi zundap1970,

 

If you have not already, it may be helpful to start with the "Simple Serial" LabVIEW example instead just to make sure you have your device up-and-running correctly.

 

Can you also post a picture of how you have your loopback connection wired?

 

Thanks!

RamseyD

National Instruments

0 Kudos
Message 2 of 7
(3,109 Views)

Troubleshooting suggestions:

Are you using 422 or 485?

Are you using 2-wire or 4 wire?

Did you set 2-wire or 4-wire mode correctly in the properties?

Did you install any terminating resistors?

Did you install the 9871 cRIO driver?  The ports should be visible in MAX.

Is the 9871 powered with 24V?

There are 4 ports.  Are you selecting the right one?

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 3 of 7
(3,103 Views)

Hi all, sorry for delay in the response.
In attach the connector for the loopback.
The problem is present also with NI Max test panel and the NI 9871 is correctly powered.

 

Thanks for any suggestion.

 

 

 

0 Kudos
Message 4 of 7
(3,040 Views)

I've hadded a 120 ohm resistor at my loopback connector, but the time out is still present.

 

0 Kudos
Message 5 of 7
(3,024 Views)

The resistor should not be the issue.

 

I'm looking at your code.

You set up your serial port to enable termination characters and make it a linefeed (x0A)

You are sending a command with a VISA write "*IDN?"  it does not end in a termination character.

You do a VISA read set for 1000 bytes.  Are you getting back "*IDN?" when the VISA Read finally times out?

 

The problem is you are looking for 1000 bytes, you get back 5.  Because you didn't send the linefeed character, it is not there in the VISA read when it loops back, so your VISA read continues waiting until it finally timeout expires!

 

Set your command string control to \codes display mode.  Add \n at the end of the command.

Try Again.

 

0 Kudos
Message 6 of 7
(3,010 Views)

Hi all...the problema was not in the code but on the connector of the NI9871 external power supply.
Although, the check with the multimeter confirm the correct voltage outgoiun from NI power supply,
when the connector is plugged into the cRIO module, the pins were not able to close the circuit and provide the right power. I've pressed hard upon the pins and the serial works.

Now 3 suggestions for NI :

1) add a led on NI9871 so to show if the module is powered on or off

2) Improve the VISA interface so to report this type of error, in fatc I've done a test with NI9871 FPGA example and in this case the error reported showed a power problem

3) Impove NI MAX test, because the self test on the cRIO passed

 

Bye

0 Kudos
Message 7 of 7
(2,971 Views)