取消
显示结果 
搜索替代 
您的意思是: 

Read Delimited Spreadsheet Not Working For VI's Added to a Real-Time CompactRio Target Within a Project

已解决!
转到解答

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).

txt not reading.PNG

 

It does however work when it is added to the 'My Computer' target on the project (figure 2) 

reading.PNG

 

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)

txt still not reading.PNG

 

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!

 

0 项奖励
1 条消息(共 14 条)
3,510 次查看
解答
已被主题作者 viamotors 接受

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.



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
0 项奖励
2 条消息(共 14 条)
3,475 次查看

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)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
3 条消息(共 14 条)
3,446 次查看

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.

FTP get file example.png

 

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!

 

 

0 项奖励
4 条消息(共 14 条)
3,401 次查看

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:

Capture.PNG

 

The session was created with the following settings:

Host name is the IP address of the crio.

Port number = 21

Username = "anonymous"

Password = ""

 

Capture1.PNG

 

My firewall is configured to allow FTP transfer as you will see here:

Capture2.PNG

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!

0 项奖励
5 条消息(共 14 条)
3,365 次查看

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).



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
0 项奖励
6 条消息(共 14 条)
3,360 次查看

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!

 

0 项奖励
7 条消息(共 14 条)
3,349 次查看

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

read blf working on my computer.PNG

 

Figure 2

 

read not working under crio.PNG

 

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!


0 项奖励
8 条消息(共 14 条)
3,266 次查看

@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.



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
0 项奖励
9 条消息(共 14 条)
3,260 次查看

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
10 条消息(共 14 条)
3,244 次查看