Why can't I write to a text file in a myRIO project?

25 Views Asked by At

For a project, I need to gather data from the myRIO and write it to a text file on my laptop. When I create a myRIO project, connect it to the myRIO and run the program, it doesn't create a text file or write any data. An indicator on the 'path' terminal of the 'close file' icon doesn't reveal the path, but instead displays .

I tried running the code in a non-myRIO project, and the code works as required. It writes the message to the text file and the 'path' terminal of the 'close file' icon reveals the correct path.

Here's the block diagram for both projects.

block diagram

I've included the block diagram for the non-myRIO project below.

nonmyRIO front panel

The block diagram below is for the myRIO project.

myRIO front panel

Why does the code work for the non myRIO project, but not for the myRIO project?

1

There are 1 best solutions below

0
John On

I would suggest building the path programmatically using a path from the get system directory vi.

That will account for different environments as the myRIO is Linux based with some directories mapped to a /c directory.

Make sure to use the "build path" primitive when joining path segments as it will use the platform appropriate path separator.

Permissions are also more strictly enforced on Linux systems so ensure the file is in a location you have read or read/write access to on the myRIO.

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/utility/sysdir-llb/get-system-directory-vi.html