06-17-2021 04:35 PM
HI NI community,
I am trying to read a spreadsheet using 'Read Delimited Spreadsheet.vi' on LabVIEW. The spreadsheet is saved in the tab delimited .txt format on my computer.
Currently I am trying to run a very basic vi that would read the .txt file and display the array that is read on the front panel. It could not be a simpler vi and involves just 1 line of code.
I want to use this vi as a part of a bigger program that requires me to communicate with a real-time CompactRio device.
The issue at hand is that the vi is not working (it is not populating the array) when used within the CompactRio target in my project (figure 1).
It does however work when it is added to the 'My Computer' target on the project (figure 2)
One of my theories for this discrepancy was that the .txt file needed to be added to the cRIO target too for it to be found by the vi, so I did that, but it still is not being read (figure 3)
If anybody has any idea what I might be missing, your help would be so greatly appreciated. Like I said, this vi could not be less complicated, so I cannot think of many things going wrong, besides me missing a fundamental step at some point.
Thank you!
Solved! Go to Solution.
06-17-2021 06:04 PM
You need to use FTP or WebDAV to copy the file to your cRIO. Just putting it in the project under the cRIO will not do the job.
06-18-2021 01:42 AM
Hi viamotors,
if it is rather static data then you could add that file to your BuildSpec to get it deployed to your RIO RT target. It will end up in a "data" subfolder next to your RTEXE.
If the data changes often then you should learn from all those example projects coming with LabVIEW: they explain how to transfer data between host PC, RT target and FPGA (if needed/used)!
06-23-2021 03:30 PM
Hi,
Thank you for your input.
I looked into FTP VI's and am trying to use the Get File vi to transfer a file from my PC to the crio.
I am having trouble figuring out what goes into the remote path input. I know it is supposed to be the path to the FTP server, but I am not sure how to get that path location or how to make folders on the FTP server.
I read up on how I can create a folder on the FTP server and came across this NI community thread: https://forums.ni.com/t5/LabVIEW/Create-a-folder-on-FTP-Server/td-p/1424906?profile.language=en
I was wondering if this is the only way (that is programmatically through LabVIEW) of making FTP folders. If not, how can I create one without writing a LabVIEW program for it?
Thank you!
06-29-2021 11:10 AM
Hey NI community members,
Here is an update on the issue in this thread.
I installed an FTP client for Windows 10 - WinSCP to enable connection with the crio FTP server.
However, as I am trying to create a new session on WinSCP , I am getting a 'Connection Failed' error:
The session was created with the following settings:
Host name is the IP address of the crio.
Port number = 21
Username = "anonymous"
Password = ""
My firewall is configured to allow FTP transfer as you will see here:
If you have any idea as to what might be going wrong here, please let me know. I have been struggling with this for a while.
Looking forward to hearing from you all.
Thank you!
06-29-2021 11:36 AM
You may need to install FTP on your cRIO. For security reasons, it is not installed by default. You can install it through MAX (right-click on the cRIO and choose to install/remove software).
06-29-2021 05:09 PM
Hi,
Do you know what this software is called? I don't see one that is specifically for FTP. (I see one for WebDAV Client and another for WebDAV Server, and was wondering if there are FTP equivalents for those)
Also, I would like to add that this whole time I have been assuming that the crio runs the server and the PC only needs to be an FTP client to enable connection between the two. Is that assumption incorrect? I briefly saw somewhere that the crio is just a client too, but I am unable to locate that article again.
In the case that the crio does not run an FTP server, would I have to take any additional steps (like setting up a server on windows) before I can start using FTP functions in LabVIEW?
Thank you!
07-29-2021 05:18 PM - edited 07-29-2021 05:19 PM
Thank you so much! That solved the issue.
Do you know if FTP file transfer works for other file formats like .blf as well? I have been trying to use read and write blf file vi's but even after using FTP I cannot read them on crio. I followed the exact same steps I did to use 'read delimited spreadsheets' vi but while the latter worked, the former did not.
Here are snippets of the error I am getting. Figure 1 shows the 'blf being successfully read when added to My Computer and figure 2 shows the error I am getting when trying to run the same program under the crio. For crio, I tried using the path to the blf file on my local computer and on ftp. Neither worked.
Figure 1
Figure 2
I am attaching the vi with this post, along with a zip folder containing the blf read/write vi's being used.
Looking forward to hearing from you.
Thank you so much!
07-29-2021 05:40 PM
@viamotors wrote:
Do you know if FTP file transfer works for other file formats like .blf as well?
FTP is a general File Transfer Protocol. It will work for any file type.
07-30-2021 03:47 AM - edited 07-30-2021 04:00 AM
Hi viamotors,
@viamotors wrote:
Here are snippets of the error I am getting. Figure 1 shows the 'blf being successfully read when added to My Computer and figure 2 shows the error I am getting when trying to run the same program under the crio. For crio, I tried using the path to the blf file on my local computer and on ftp. Neither worked.
Those BLF functions all depend on the BinLog.dll included in your ZIP file.
When you check the properties of that DLL, especially the "Details" tab, it clearly says "Binary Logging for Windows".
(I guess Vector has no intention to provide their software for NI-made devices like cRIOs…)
When you look into the BLF functions you will find a lot of places with conditional disable structures hiding all those DLL calls for RT targets: that package is not intended to be run on a RT target!