LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

text file transfer from myRIO to remote PC in a while loop for control

Solved!
Go to solution

I am trying to transfer a text file on my desktop computer to myRIO and also read a text file from myRIO to my desktop computer. The control algorithm is running in python on my desktop computer. I tried with WebDAV from the following link but couldn't open a new text file in myRIO? It says permission not granted, but I can see different folders in the files folder.

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019PlESAU&l=en-US

Wondering if I am doing something wrong.

 

I also read that it is not a good idea to transfer file in a while loop. I need to obtain the states (which are in the text file) in order to output the control signal from python in my desktop.

I am attaching the VI which tries to read and write files in the myRIO. Using WebDAV I wanted to read and write these files from myRIO.

Is there a better way to do this?

 

 

0 Kudos
Message 1 of 4
(2,687 Views)
Solution
Accepted by topic author nku1991

Why write a file?  Setup a network communication so that your PC application can just request the data and then your myRIO just sends the latest values up.  On the myRIO, you will want a second loop to handle this communication and probably a simple Global Variable to hold the latest values.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,674 Views)

Hi crossrulz,

Do you have any suggested link where I can setup a network communication? 

0 Kudos
Message 3 of 4
(2,655 Views)

@nku1991 wrote:

Hi crossrulz,

Do you have any suggested link where I can setup a network communication? 


In LabVIEW, go to Help->Find Examples.  Just do a search for "TCP" and you will see a Simple TCP.lvproj.  Use that as a starter.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(2,642 Views)