Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO - TDMS Write to USB drive and sudden removal

Solved!
Go to solution

 Afternoon forum-ites.

 

I have a small issue that I would like some direction on. I currently have a small loop that pulls out measurement data from a RT FIFO and event string log data from another loop. The loop then proceeds to log bopth sets of data to a USB drive connected to the USB Host port of my cRIO using the Streaming TDMS functions. Generally this works fine; the cRIO automatically maps to /U and logs are stored on the drive (measurements and event strings).

 

If the USB drive is disconnected during use then I discover that the TDMS Write function blocks indefinitely; requiring me to reboot the cRIO in this state (or allow the watchdog to do so).

 

 

Besides a manual work-around (eg. implement some control mechanism to stop logging prior to disk removal) is there a better alternative to handle the sudden loss of the drive? I have a brief look at the Asynchronous options but I need to log events as well (strings) which does not appear to be within the scope of the Async nodes.

 

Any ideas appreciated.

0 Kudos
Message 1 of 9
(4,199 Views)

Hello!

 

Try using the "Get Volume Info" function before the TDMS write function. It will throw an error if the directory doesn't exist. Take a look at this KB.

 

Ren H.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 9
(4,176 Views)

Thanks for the link! An interesting read. Unfortunately it doesn't seem to solve my problem (with TDMS write at least). Timing-dependent (ie. when do I pull out the usb stick) it seems to permanently lock-up that loop - I can't even abort the main VI.

 

I have attached a small example that consistently locks the cRIO up if the USB drive is removed during loop execution. I am running this on a cRIO-9063, RIO set 16.0 (firmware version 4.0.0f0).

 

tdms.png

 

Thanks for your help so far.

0 Kudos
Message 3 of 9
(4,167 Views)

Instead of having the Boolean status wired to an indicator, use an "or" function and wire it to the conditional terminal along with the stop button. If you do that, the loop should stop. Let me know if this is the case.

Ren H.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 9
(4,158 Views)

As shown below? Loop still does not stop, although the Exists? indicator is True prior to me activating the Stop control. Aborting the VI through the Abort button / (Ctrl-.) also does not work. Highlighting shows that the loop is no longer iterating and stuck on the TDMS Write node.

 

I have attached the VI itself (2016) for you to try on a real-time target if you have the opportunity.

 

tdms.png

0 Kudos
Message 5 of 9
(4,155 Views)

Hi Tyk007,

 

Thanks for the screencap. I reproduced the same behaviour on my side. I will let R&D know and see if they have any opinion.

Ren H.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 9
(4,123 Views)

Hi Ren. Have you had any feedback on this?

0 Kudos
Message 7 of 9
(4,098 Views)
Solution
Accepted by topic author tyk007

Ren has filled Corrective Action Report(CAR) # 617885 with NI R&D to look into this. It looks to be related to 2016 software stack (LabVIEW RT 2016 and RIO 16.0). Temporary workaround is to downgrade to RIO 15.0

0 Kudos
Message 8 of 9
(4,095 Views)

OK, thanks. Down-grading might not be an option for me but I'll bear it in mind if project time-frames force the issue before a patch to resolve.

0 Kudos
Message 9 of 9
(4,089 Views)