Help needed logging with TDMS, LabVIEW and RoboRio

I am able to create a stand alone VI and log to a data file using TDMS, but when I try to incorporate this into our teleop.vi, I get error -2501 code 7.

I am using create or replace. I have tried creating a separate vi and moving that vi from Target (roboRio) to My computer. Same error.

How do you open/create a file on roboRio or on c: drive on laptop?

Thanks for any help.

P. Ry

Post a snippet of the code in question.

What is the file path for the RIO code?

I’d also suggest logging data from Periodic Tasks rather than the time-sensitive Teleop.

I imagine your issue is the file path. I use the LabVIEW default data directory on the roboRIO in this example of an ordinary file write to
/home/lvuser/natinst/LabVIEW Data/MyFile.txt





The problem I am having is with the path info.

Attached is a standalone vi which WILL work and log to laptop,
and a vi added to the project which will NOT work and throws the error.

I believe I have tried using /u/auto with no success. (came across a reference to using “u” for an SD or USB drive. May have had issues with case (U). Not sure if i checked that.

I do notice that it will automatically change backslash to fwd when i add the vi to project and will NOT let me change it back.

Mark, I’m going to try your snippet.

What would be an example path for logging to laptop c:drive or a USB on laptop?

StandAlone-Vi.gif
Vi-added-to-Project.gif


StandAlone-Vi.gif
Vi-added-to-Project.gif

Logging to your Windows laptop is just based on the privileges of your user account, and a USB thumb drive file system isn’t any different to Windows than your C: hard drive.
So, creating a laptop file at C:\MyFile.txt or E:\MyFile.txt should typically work fine.

Your roboRIO user program won’t have directory write privileges to the top-level Linux directories. You’ll need to use the lvuser account’s /home/lvuser to create files.
P.S. Linux (roboRIO) uses “/” while Windows (laptop) uses “” in forming file paths.

Thx,

still not sure why the windows path will NOT work. I’ve even tried running labview as admin. Going to test your snippet now, will check back in 45mins with results

Because my example is system independent it will work on both your laptop and on the roboRIO with no change.
It uses LV to build up a path that will be correct whichever target platform it gets deployed to.

Take the snippet and run it in a blank vi on My Computer and it will create MyFile.txt in your Documents/LabVIEW folder.

Use an indicator to display the actual path name formed in both instances, and then try using that hardcoded explicit string for your path name.

Mark,
First off, thanks for taking the time to help.

Got the default directory on the Rio to work. I was able to log and then log onto the Rio and download the file.

Still unable to get it to log a file to the laptop. (Note: Trying to run teleop and get the Rio to log data to a file on laptop while connected.)

Attached are 2 paths I have tried with no success :frowning:

Is there a path mounted on the Rio that i would use?
Or is it as simple as there is no file path connection between the Rio and laptop that can be used?







Networked devices are not part of the roboRIO file system.

To log from the RIO onto your laptop, you need to send each log entry to a program running on the laptop that does the actual local logging for you, e.g., the Dashboard app.
That’s one thing the Driver Station app does for you is to receive data from the roboRIO and log it locally to the DS log files.
We can’t modify the Driver Station app, but the Dashboard app can do the same thing (for instance it logs camera images to Documents/LabVIEW Data).

I don’t know why i was thinking there was a path mapped out. Should have known better. :o

Thanks for all the help. Trying to move to the next level :]

Good luck!