PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

[VxWorks PXI] How to guarantee that all buffered data has been written to disk before shutting down?

Solved!
Go to solution

Hello,

 

I have a PXIe-8135 RT that logs events and data from a variety of sources into CSV files and custom binary files. I'm looking for a way to guard against data loss during a normal shutdown.

 

On Windows or Linux, I can programatically shut down both the application and the OS; this is enough to flush all buffered data to disk and cut power when it is safe. However, as far as I can tell, there is no way to programatically shut down a VxWorks target (e.g. http://forums.ni.com/t5/Real-Time-Measurement-and/Shutdown-of-cRIO-or-sbRIO-via-software-command/td-... )

 

The best method I can think of right now is to shut down the RT application properly, wait "long enough" for buffers to clear and resources to be released, and then push the power button. The challenge is, I can't get proper feedback on when the application has fully closed.

 

Is there a more robust way to do this? (Or am I overthinking things?)

 

Thanks in advance for any advice!

Certified LabVIEW Developer
0 Kudos
Message 1 of 5
(3,660 Views)

Hey JKSH,

 

I'm not sure offhand if there is a better way to go about that. I know that there are/were ways of rebooting a VxWorks controller programmatically, but I'm not sure if there is a shutdown command. I'm going to ask some of my colleagues and see if they are aware of a way of doing this, aside from what you're considering now.

 

Eden K
Applications Engineer
0 Kudos
Message 2 of 5
(3,635 Views)

Thanks Eden, much appreciated!

Certified LabVIEW Developer
0 Kudos
Message 3 of 5
(3,630 Views)
Solution
Accepted by JKSH

Hey JKSH,

 

A couple of things. First of all, are you sure the PXIe-8135RT is running VxWorks? The link below suggests that it is running Phar Lap ETS. Based on that, see the second link below, which talks a bit about  a similar question with regards to Phar Lap. The short of it is there isn't a software based shutdown on non Linux RT Targets. Essentially, if you want to ensure things aren't going on when you power off, you would have to do something like print to the console out that it is ready to be powered down once activities have finished, or have an LED start or stop blinking. So far, it doesn't seem there is a clear way of determining when all other activities have finished, but it seems it is still "safe" to shut down the target at any time (safe for the target, but this doesn't ensure that all activity is done).

 

What Operating System Is My Real-Time Controller Running and Why?

http://digital.ni.com/public.nsf/allkb/35F1FD98520D6E0E8625783A005AF557

 

Switch Off ETS

http://forums.ni.com/t5/LabVIEW/switch-off-ets/m-p/841366?requireLogin=False

Eden K
Applications Engineer
Message 4 of 5
(3,592 Views)

Hi Eden,

 


@WestOfEden wrote:

First of all, are you sure the PXIe-8135RT is running VxWorks? The link below suggests that it is running Phar Lap ETS.


 Ah, you're right. I simply assumed that since it's a newer model it must be running VxWorks (because NI started using VxWorks RT targets after Phar Lap ones).

 

That's one of the beauties of LabVIEW -- its code can be deployed onto many different kinds of targets, and we won't even notice the difference 😄

 

 


@WestOfEden wrote:

The short of it is there isn't a software based shutdown on non Linux RT Targets. Essentially, if you want to ensure things aren't going on when you power off, you would have to do something like print to the console out that it is ready to be powered down once activities have finished, or have an LED start or stop blinking. So far, it doesn't seem there is a clear way of determining when all other activities have finished, but it seems it is still "safe" to shut down the target at any time (safe for the target, but this doesn't ensure that all activity is done).

 


I see. I'll just tell the operator to wait ~20 seconds after sending the "quit application" command before flicking the physical switch. That should be plenty of time.

 

Thank you for digging into this for me!

 

 

Regards,
JKSH

Certified LabVIEW Developer
0 Kudos
Message 5 of 5
(3,549 Views)