04-14-2015 12:21 PM
Hi All,
I am trying to programmatically copy files from my PC to my cRIO. The screen shot is what my block diagram looks like. I ran this routine, I didn't get any error message, however, I didn't see a copy of the file in the folder I specified on the cRIO after I opened it. I have double-checked the filenames and paths, and they are as I want but the copied file isn't showing up on the cRIO.
I also tried to implement the FTP Put File.vi function, I got no error. I got the "221 Thank you for using National Instruments FTP" in the error out indicator (similar to what I saw with the FTP Store Multiple.vi) but still did not find a copy of the file in the folder I specified on the cRIO.
Please can anyone help solve this issue?
04-14-2015 12:56 PM
Does the target folder exist on the cRIO? You can't copy files to an arbitrary path; you need to create all the intermediate folders first. What's the contents of the File Specifcations control?
04-14-2015 01:20 PM
Yes, the target folder does exist on the cRIO. Using the "FTP Put File.vi", I had the following settings:
Host: 169.254.84.168
Remote Path: \RT_Datafiles\tst.csv
Local Path: C:\Datafiles\tst.csv
Please note that the filename tst.csv does not however exist yet on the RT. I am of the thought that the file would be created. Could this be the issue with my code?
04-14-2015 01:35 PM
What operating system is your cRIO running? You may want to see Working with File Paths on Real-Time Targets.
Can you transfer the files using Windows Explorer (assuming your development environment is Windows)? You can enter ftp://169.254.84.168 in the address bar in any folder view in Windows. Alternatively, you can open a command-line window, and use the Windows command-line ftp client.
If you can ftp a file to that path successfully outside of LabVIEW, then can you upload your VI, with all the default control values set to the real values you're using?
I do also remember running into an issue at a previous job with the LabVIEW FTP functions, and we modified them to work around the problem, but I no longer remember the exact problem and solution (this was a few years ago). Seeing "221 Thank you for using National Instruments FTP" sounds familiar - but you're not getting an error, just a warning? I think in our case there was an actual error, that should not have been occurring.
04-14-2015 01:55 PM
What operating system is your cRIO running?
Response: I have a cRIO-9014, so the OS running on it should be VxWorks.
Can you transfer the files using Windows Explorer (assuming your development environment is Windows)?
Response: Yes. From Windows Explorer, I could transfer files to, and from, the RT Target using drop-and-drop without any issue.
If you can ftp a file to that path successfully outside of LabVIEW, then can you upload your VI, with all the default control values set to the real values you're using?
Comment: Sorry, I did not understand this question. Please could you explain/re-phrase this?
I do also remember running into an issue at a previous job with the LabVIEW FTP functions, and we modified them to work around the problem, but I no longer remember the exact problem and solution (this was a few years ago). Seeing "221 Thank you for using National Instruments FTP" sounds familiar - but you're not getting an error, just a warning? I think in our case there was an actual error, that should not have been occurring.
Comment: The Error Out indicator had the following outputs:
- Status: no error
- Code: 221
- Source: 221 Thank you for using National Instruments FTP
Based on my responses/comments, what do you suspect could be the culprit for the reason the files are not being copied to the cRIO folder?
04-14-2015 02:59 PM
aro1 wrote:
If you can ftp a file to that path successfully outside of LabVIEW, then can you upload your VI, with all the default control values set to the real values you're using?
Comment: Sorry, I did not understand this question. Please could you explain/re-phrase this?
Can you upload your VI? Make sure that the VI is saved with the your paths as the default values for the controls (Edit->Make Current Values Default) so that we can see the values you've entered.
What about transferring a file using the FTP VIs without any remote path, just the remote file name? Have you tried providing a drive letter as part of the remote path as well? Again, it would help to see your code.
Also, if you're just transferring one file, the FTP Put File function will be simpler (it's only one VI).
The FTP Store Multiple function has a second error out terminal, labeled "file errors." Have you checked for an error there?
04-14-2015 03:20 PM
Can you upload your VI? Make sure that the VI is saved with the your paths as the default values for the controls (Edit->Make Current Values Default) so that we can see the values you've entered.
Comment: Sure. I have attached the section of my code that has to do with the file transfer via FTP
What about transferring a file using the FTP VIs without any remote path, just the remote file name? Have you tried providing a drive letter as part of the remote path as well? Again, it would help to see your code.
Comment: Yes, I have tried with and without the "c:" in the Remote Path name but the results were the same.
Also, if you're just transferring one file, the FTP Put File function will be simpler (it's only one VI).
Comment: I tried this as well. I have a minimum of 2 files I would like to copy to the cRIO. However, I tried the FTP Put File function as well in case that worked and I can transfer the files one after the other. This is can be deduced from the Enable/Disable Diagram Structure in the attached VI.
The FTP Store Multiple function has a second error out terminal, labeled "file errors." Have you checked for an error there?
Comment: Yes, I checked/monitored the File Error(s) indicator for both the FTP Store Multiple function and the FTP Put File function.
04-14-2015 03:33 PM
Sorry, I'm still on LabVIEW 2012 so I can't open your VI (I should have mentioned that earlier). If you can save back a version, I'll take a look.
So, no error in the file errors? I'm running out of ideas. Maybe there's a character hidden in your string for the remote path that's causing a problem? For example, I've made the mistake of hitting enter in a string field, and then not realizing there's already some data in the string control since it's sized for one line. I would think that would cause an error somewhere, though - but maybe not.
04-14-2015 03:41 PM
Oops, my apologies. Here is the Vi saved in labview 2012
04-14-2015 03:49 PM
Sorry, I have no idea what's wrong. I suspect there's something simple, but I don't know what. You might need to dig into the FTP VIs a bit.
Have you tried transferring a file the other direction, from the RT target to your computer? Does that work correctly?