Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9033 & NI 9870 - Serial settings not saving on cRIO restart.

Solved!
Go to solution

Hi,

 

I have a NI 9033 cRIO with two 9870 RS232 cards. The two serial cards and their ports don't show up when I power on the cRIO. When I run my real time executable once it crashes saying it can't find the ports I'm asking for. After it crashes, the channels show up in MAX and VISA Resource controls, and when I run the program a second time it works fine. Why does this happen? Is there some way I can have save the serial settings so I don't need to have the program crash every time the cRIO starts up?

 

I'm running my program in hybrid mode. I have it set to FPGA Interface and have the two cRIO cards outside of the FPGA Target, like this:

Project Layout

 

I've tried undeploying and deploying everything, but that doesn't help. It crashes the first time regardless of whether I run from the LabVIEW Development Suite or if I deploy it as a RT-executable and have it run on startup.

 

 

Here are some pictures of what's happening:

 

There should be 10 VISA ports available. The two on the chassis, and four from each 9870 card.

 

When I first start the cRIO, only the two chassis ports show up for selection on a VISA Channel Control:

Visa Resource on Startup

 

And the channels don't show up in MAX:

MAX on Startup

Also showing currently installed software.

 

When I go to the settings page for NI-VISA 14.0.0 I see this:

VISA on Startup

The channels show up here, but nowhere else.

 

When I try running my program, I get this error:

First Run Error

 

And after the error, the channels show up in LabVIEW and in MAX!

Serial Resource After Crash

 MAX After Crash

 

The serial settings will remain as long as I leave the cRIO powered on. If I turn it off, the serial settings dissaper and I need to run my program once and have it crash before I can use the serial ports.

 

I'd really like for these settings to apply automatically without having it crash the first time. 

 

Any suggestions?

0 Kudos
Message 1 of 7
(5,598 Views)
Solution
Accepted by ng1902

I also run hybrid mode FPGA on cRIO with the 9870 and 9871 cards under the scan engine, like you are. I have also noticed some buggy behavior when accessing the COM ports- for example, if the cRIO is running the executable version of its program, and you interrupt it to run the same program in interactive mode, often you get the "missing VISA resource" error. So what I do is reboot the cRIO with the startup app disabled.

 

I honestly would not bother with configuring anything through MAX when it comes to your cRIO. Configure you port setting programmatically. As part of your program initialization process, open your bitfile, run it, wait,a few second for everything to settle out, do a "VISA find resources" and confirm all your ports show up, then use the VISA functions to configure and open the port programmatically. This way has been working for me.

 

 

Message 2 of 7
(5,593 Views)

Oh wow, adding a delay between launching the FPGA code and starting the serial VIs got rid of the error.

 

Not entirely sure why, but at least it works properly now!

 

 

I found this article in the Knowledge Base and was trying to troubleshoot with it. Most of the commands/queries didn't work, but I did notice that after I run the program once there were tty files in /dev/ for each of the ports on the 9870s, like this:

ttyNIRIO

 

But when I first turn the cRIO on, they aren't there:

ttyNIRIO Startup

 

Maybe the delay gives the program some time to create the ttyNIRIO files?

Message 3 of 7
(5,583 Views)

Glad it worked for you. Yes it sounds like the delay is necessary for the operating system to wake up and fully initialize all its resources. Typically you need to wait some time for the scan engine to start running too.

 

I recall someone telling me that in Linux systems I/O is mapped to the file system. That is a resource, whether a serial port or a digital output or analog output is represented as a file. You then do I/O by writing to the file. I haven't mucked around much with the cRIO linux operating system though. It would be great if someone from NI would clarify. 

 

But if that's correct then yes you couldn't access the serial ports until the Linux operating system creates the file you need to write to to do I/O .

 

 

0 Kudos
Message 4 of 7
(5,536 Views)

I am also getting same issue.i am using my ni 9870 with crio 9045.but i am not getting serial port for ni 9870 at visa setting config nor in NI MAX window.one more thing i have to tell i am not giving any power supply to 9870.please find the attached snapshot.

0 Kudos
Message 5 of 7
(2,873 Views)

This is a pretty old thread, so you may want to try posting a new topic.

 

Did you follow all the steps in Discover, Configure, and Communicate with NI 987x Modules in Scan Mode?

 

-Jordan

0 Kudos
Message 6 of 7
(2,867 Views)

i followed the same step but i am unable to get visa port.

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