07-08-2013 11:32 AM - edited 07-08-2013 11:34 AM
I've written the code in the 1st figure below, to open & create a tdms file on my USB flash drive which is plugged into cRIO USB port.
The appended tdms path is shown in the 2nd figure below.
But I'm getting the error in the 3rd figure below. I'm wondering how I can fix this problem.
Solved! Go to Solution.
07-08-2013 11:59 AM
- are you sure the driver letter is D:? Shouldn't be U:?
- Create a .txt file on your PC and then just try to open it and see what happens.
07-08-2013 12:04 PM
When I use "U:\" I get the following error.
My code is running on cRIO I can not run it on my PC.
07-08-2013 12:13 PM
Just to make sure the dive letter is correct, try creating a .txt file using your PC and your USB drive.
Then, on your target, create a test Vi to read the .txt that is in the USB. Try different drive letters (V:, X:, etc) until you find the correct one.
07-08-2013 12:25 PM - edited 07-08-2013 12:26 PM
I created a sample TDMS file on my flash with my PC, then I tried to open it with my cRIO but I got the same error which says "File not found. The file path..."
When using the MAX (Measurement & Automation Explorer) for file transfer, I see the following window.
The point is that the file transfer does NOT show my USB flash drive which is connected to cRIO.
Also, the file path of cRIO are Linux-like, I mean like "/" NOT like windows "C:\" or "D:\" or...
07-08-2013 12:32 PM
Also, when I use the "Current VI Path" function, I get the following path:
07-08-2013 12:50 PM - edited 07-08-2013 12:50 PM
By the way, when I use a "c:\" path like the figure below, the code saves the proper file on the cRIO internal memory without error.
07-08-2013 01:15 PM - edited 07-08-2013 01:16 PM
I tried all the alphabetical letters:
For "c:\" the code saves the file on the local cRIO memory.
For "d:\" the code gives the 1st error below.
For all other letters, the code gives the 2nd error below.
Error for "d:\"
Error for all the letters except "c:\" and "d:\"
07-08-2013 01:59 PM
Looks like it is not mounting or seeing your USB Drive.
https://decibel.ni.com/content/docs/DOC-5825
http://forums.ni.com/t5/LabVIEW/USB-Flash-memory/m-p/2301490#M724652
http://forums.ni.com/t5/LabVIEW/detect-usb-drive-on-crio/m-p/566970/highlight/true#M266035
http://forums.ni.com/t5/LabVIEW/cRIO-9012-USB-fix-drive-letter/m-p/753580/highlight/true#M345120
07-08-2013 02:19 PM
Cashany,
Make sure the USB drive is formated to FAT32 as the cRIO cannot mount NTSF or other file systems.
Also, and this is potentially incredibly important:
There is a known memory leak issue that is easy to prevent (without code changes!) assoicated with using TDMS on cRIO's.
This issue only happens on vxWORKS targets (e.g. cRIO 9014), not on the PharLap targets (as far as I know).
The issue happens when you close a TDMS file reference, the vxWORKS OS is unable to properly unload the TDMS library. Next time you open a TDMS reference, the library is loaded again, so over a very long time you will run out of memory.
The fix is super-simple:
on your cRIO, find the ni-rt.ini file, then scroll to the [LVRT] section of the ini file and locate the key called "StartupDlls"
Make sure that "tdms.out" is included. For example, depending on your cRIO, it may look like this:
StartupDlls=nisysrpc.out;NiRioRpc.out;NiViSrvr.out;
In which case you would edit the line to look like this:
StartupDlls=nisysrpc.out;NiRioRpc.out;NiViSrvr.out;tdms.out;
This will prevent the LabVIEW runtime engine on the cRIO from trying to unload the tdms library, forcing it to be in memory from boot-up until forever. This eliminates the memory leak you would otherwise experience.
Good luck!
Q