04-14-2015 10:57 PM
Here's a snippet of a routine I wrote to read the ni-rt.ini file from a remote PXI to my PC. Note that "Target IP In" is the IP of the Remote RT system, and this code runs on the Host PC. Works like a charm.
Bob Schor
04-15-2015 02:33 AM
You could try 2 things, not sure if it helps:
1) use passive mode FTP (i.e. set the active flag to False)
2) leave away the leading \ in the target path (e.g. RT_Datafiles\tst.csv)
Passive mode is often preferred since then you only have connections from client to server. Active needs firewall configurations on both ends.
04-15-2015 07:52 AM
All,
Yes, I tried copying a file from the RT to my PC, and that worked.
Dan_u,
I tried the 2 suggestions you stated, unfortunately I still could not find the "file copied" into the cRIO folder.
Bob_Schor,
Please could you modify your routine by trying to copy a file from PC to the RT target, and then test it to see if if works in the other direction? If it does, please let me know what I may be doing wrong.
04-15-2015 08:14 AM
That's also straight-forward.
I'm writing back to the Remote's ni-rt.ini file, copying the file in "appended path" (not my name, comes from the Snippet). You might notice that the FTP Put File function is missing the "Required" Default arguments, User "anonymous" and Password "<blank>" -- I got tired of being forced to put in "default" parameters (why create defaults if you are required to enter them? Fortunately, these functions in VI.lib are not "locked" -- I simply opened them and changed these two parameters to "Recommended" and re-saved them.
Bob Schor
04-15-2015 08:34 AM
That is similar to what I have, without the connections to the "user" and "password". Did you run the "reversed" routine to verify the files were successfully copied to the cRIO folder specified path? If yes, please could you test the VI file I posted as well to check if that works on your end? Maybe there is something wrong with my "setup".
04-15-2015 08:46 AM
Hmm, I probably should have taken a better look at your code earlier, sorry. It looks OK, but here are two questions that only you can answer:
Bob Schor
04-15-2015 09:01 AM
Please my comments on the questions asked:
Is the IP of the Remote (which you have saved in the variable called "Host") 169.254.84.168? Can you use Windows (or MAX) to FTP to that address and "see" your Remote machine?
Comment: Yes. I see and verify the cRIO IP in MAX. I can also ping the cRIO IP address successfully from the Windows cmd prompt window.
Does the file system on your Remote support a syntax for a path consistent with "\RT_Datafiles\tst.csv", i.e. no device or "root" designation? I'm pretty sure, for example, that I couldn't use such as path to my PXI controller without the leading "c:".
Comment: I am assuming the syntax for the path is supported becuase I did not get any error. In addition, I already tried "c:" and "C:" unfortunately that did not solve the problem either.
04-15-2015 01:41 PM
OK, power is back on. My Remote device (a PXI controller) did not have a file, Test.dat, on its C: drive. I ran the following piece of code, which creates a temporary file on my PC, writes "File created " and the date and time, saves the file, then FTPs it to my PXI, saving it as c:\Test.dat. Here is the code:
Here's the directory of my Remote (the file times are off -- I got confused by EDT vs UTC). Notice Test.dat at the end.
And if I double-click it, IE shows me its content:
As advertised. I'm not sure why something similar doesn't work for you.
Bob Schor
04-16-2015 02:11 AM - edited 04-16-2015 02:13 AM
Just a stab in the dark here...
Yre you sure the "\" is not supposed to be "/" on the remote target?
I know the file path controls handle this transparently, but Strings don't.
Also to make sure your paths are correct try reading a file from the target. Once you have the paths sorted out, try writing. That way there's a variable less in the test.