LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

set flags in ni-rt.ini

I want to set the flag YouOnlyLiveTwice on my RT to TRUE to prevent the RT from automatically rebooting.

(http://digital.ni.com/public.nsf/allkb/41E8E448E2547CEF86256CFD00678340)

 

What I don't want to do is remember to change this flag manually whenever we format an RT. Is there a way that this flag can be added to the build definition for my RT executable?

0 Kudos
Message 1 of 5
(2,998 Views)

@jtay wrote:

I want to set the flag YouOnlyLiveTwice on my RT to TRUE to prevent the RT from automatically rebooting.


I think you're thinking of another flag.

 

YouOnlyLiveTwice was a flag we originally added to support some Compact Fieldpoint systems that were installed in a remote ice station in Alaska.  Normally when a system crashes during boot (or shortly after boot), the system will reboot but "remember" that it crashed during startup, and it will only allow the system to crash twice-in-a-row during this period before dropping into Safe Mode (so that bad software, bad hardware, or otherwise won't make the target unreachable or leave in an infinite reboot state).  Well, these devices up in Alaska were mostly immune to the cold, but sometimes the temperatures would drop so low the hardware wouldn't work correctly; this caused them to reboot, and when they rebooted they would crash on reboot (because the hardware didn't work correctly in those temps).  The "fix" was to just allow the systems to keep crashing and NOT drop into Safe Mode after the second crash.  Thus we named the token, "YouOnlyLiveTwice", and it's actually set to TRUE by default.  If you want to allow the controller to just keep rebooting and crashing - as we did in the case of the Alaska Ice Station - then you'd set the YouOnlyLiveTwice token to FALSE.

 

-Danny

Message 2 of 5
(2,975 Views)

@jtay wrote:

 

What I don't want to do is remember to change this flag manually whenever we format an RT. Is there a way that this flag can be added to the build definition for my RT executable?


Oh, right, I forgot to answer the second part of your question.  

 

No, there's no way to set a token within the Build Specification for an RT Executable, everything that I can think of would be a post type process.

 

    1. If you create a Component Definition File (CDF file) for your project, you can add a MERGEINI item to your CDF file (similar to most of the LabVIEW_XXXX.CDF files in your "%programfiles%\NationalInstruments\RT Images\LabVIEW\2013" directory).  The default file target (if none is specified in the MERGEINI directive) is c:\ni-rt.ini.  This must be done post-build, and will be erased if your file is regenerated.
        • It would look something like:
        • <MERGEINI>
          [SECTION NAME]
          TOKEN=VALUE
          </MERGEINI>

    2. You can open the config file from your application and use the "Read Key" VI (Found in Programming -> File IO -> Config File VIs -> Read Key) to see if the key is present, and then if not then add the key (via "Write Key" found in the same location) and close the config file.  Note that most of the tokens in the c:\ni-rt.ini file are read only once and cached, but some are read each time they're needed.  It may be necessary to reboot in order to get the new value for a token to "take effect" once written. 
    3. Modify the ni-rt.ini file by hand (which you've already said is not something you want to be doing).

-Danny

0 Kudos
Message 3 of 5
(2,972 Views)

I had no idea that YouOnlyLiveTwice was so situation specific. My goal here is to not allow my RT to reboot itself at all. Depending on what what state the I/O is in and what is happening in the test cell at the time, automatic reboots could be dangerous. I'm still not too sure what even causes an automatic reboot. I've seen RT crashes before, but only rarely have I seen an RT reboot itself. I had a tough time finding info on it, and YouOnlyLiveTwice was the only promising bit of info I found.

0 Kudos
Message 4 of 5
(2,959 Views)

@jtay wrote:

My goal here is to not allow my RT to reboot itself at all.


Oh, I see.  An RT system is not "normally" supposed to reboot itself - at least, not unless you specifically programmatically tell it to reboot.  The system will reboot under these circumstances:

 

    1. A User requests the system to reboot via a remote execution request, such as through MAX or from a remote VI.
    2. A running application requests the local system to reboot programmatically.
    3. Application software crashes, leaving the system in a fatal state (where hardware and software cannot be trusted).
    4. Power fluctuations where the available power to the Real-Time controller drops too low.
    5. Physical reboot of the controller via power/reboot switches on the controller hardware.
    6. NI-Watchdog timer times out with the action set to "reboot system".

You cannot prevent 2-6 from rebooting the controller, but you can prevent 1 from rebooting the controller if you put a password on the controller via the web server (or via MAX).  

 

-Danny

0 Kudos
Message 5 of 5
(2,951 Views)