LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI cRIO 9030 Linux Permission

Hi, 

 

I have had a persistant issue with my cRIO 9030. It will pop up with Error 11 occured at Open File + .vi: Open File. I can't understand how this is happening as every time I open up a file I use the close function. 

 

What I want to try and do is increase the limit of files open since in the Linux portion of the cRIO. 

 

I found this article: http://woshub.com/too-many-open-files-error-linux/

on how to increase the number of open files. It is currently on 1024. I cannot get permission to go into the /etc/security/limits.conf and I'm stuck in the sh-4.2$. I cannot seem to change this using the embedded UI terminal. 

 

I am using LabVIEW 2014 for the RT program and have double checked over my code for where the file open leak could be coming from but haven't been able to find it. I also don't have a way of knowing what file could still be open. We basically run until the error pops up and then click continue. 

 

Any help would be appreciated. 

0 Kudos
Message 1 of 6
(607 Views)

You haven't described what the code on the cRIO is doing, and haven't attached any code for us to examine, so my comments may not have anything to do with your situation.  But here are my thoughts:

  • You appear to be running the cRIO as a Real-Time Target (which implies that you also may have code running on a connected PC).  Doing File I/O on an RT Target negates the benefit of running on a Target, namely determinacy, as you have no idea how much time the I/O will take.
  • In particular, you should not be "streaming data to disk" on the RT Target -- you should, instead, be streaming data to the Host machine, which can then stream it to the Host's disk without interfering with the RT Target.

Bob Schor

0 Kudos
Message 2 of 6
(567 Views)

Hi Bob, 

 

The code is using embedded UI on the cRIO 9030. This means that the file interface is being used in a non-deterministic loop on the RT target. 

 

The issue I'm finding is something to do with the embedded linux on the cRIO 9030. In every instance that I am opening a file, it is always closed after in the code. I can't tell what files are "left open" and I wanted to increase the size of the number of files open. 

 

Thank you. 

0 Kudos
Message 3 of 6
(554 Views)

@T._P_Titherington wrote:

Hi Bob, 

 

The code is using embedded UI on the cRIO 9030. This means that the file interface is being used in a non-deterministic loop on the RT target. 

 


Which is precisely why file I/O is generally not a good idea when requiring Determinism in your RT Target.  Again, there are techniques (I won't mention Network Streams) to move data while maintaining an RT system.

 

Bob Schor

0 Kudos
Message 4 of 6
(544 Views)

This isn't something I can move to an external pc. As I would like to emphasis that my issue seems to be with too many file references being open. I don't know what file reference are open. If there is a way I can find this out it would help me. 

0 Kudos
Message 5 of 6
(532 Views)

Is this running as a "Startup Executable" on the cRIO?  Does it have any interaction with the outside world, particularly the ability to accept "Start" or "Stop" commands, or some way of signalling Status (other than by just stopping, nor "not responding")?

 

Have you considered writing a "debugging routine" that tries to keep track of open and closed files?  [Of course, it may have to do this by opening and closing a file ...].  Here's my not-well-thought-out idea:

  • Consider a text file, File Logger.
  • Whenever you open a File, you open File Logger and write "File xxx opened " and a Timestamp, then close File Logger.
  • Whenver you close a File, you open File Logger and write "File xxx closed", and a Timestamp, then close File Logger.
  • It helps if you have a way of sequentially identifying each File you write (the "xxx" in the above).
  • After a crash, reviewing the contents of File Logger might provide some clues.

It also may be a "feature" of the RT Linux running on your RIO (I truly hope not).

 

Bob Schor

0 Kudos
Message 6 of 6
(504 Views)