01-25-2015 06:48 AM
Dear All,
I'm new to cRio/FPGA and was hoping someone can enlighten me as to why I'm strugging to write a string to text file.
I'm sure there is a very obvious reason.
Hopefully the image illustrates my issue more clearly
01-25-2015 10:21 AM
Use the Write To Text File instead of the Write To Binary File. You also shouldn't have to make it an array of strings.
01-25-2015 11:08 AM
Hi crossrulz, Many Thanks for the swift reply
I appreciate the use of Write To Text File as opposed to Write To Binary File but in practice I have a series of strings, numerics, carriage returns and tabs and therefore find the build array and write to binary easier to deal with.
My issue is not so much writing strings to file but rather why does my VI operate correctly from one location but not the other.
01-25-2015 11:24 AM
The C:\ drive exists on your PC. It does not exist on the cRIO. The drive on the cRIO has a different designation.
01-25-2015 11:29 AM
File paths may be a bit different on RT targets as this White Paper explains.
http://www.ni.com/tutorial/14669/en/
I would also make sure you include a file extension in your path. Usually it's smart enough to handle a lack of extension but sometimes I have seen programs look for folders instead of making a file if you do not have an extension.
01-25-2015 11:44 AM
Thanks for that - its starting to make some sence.
I probably need to rethink my approach but I guess there is no harm in ansking more stupid quistions first; so, is there a way of writing strings from the Rio front screen to the c: drive (info of a measured sample) ?
01-25-2015 11:57 AM
aw1 wrote: so, is there a way of writing strings from the Rio front screen to the c: drive (info of a measured sample) ?
The proper way would be to make a Windows program that the cRIO can stream the data to (network streams work very well here) and then the Windows application writes the data to your C drive.
I've heard mixed with this method, but another possibility is to create a shared folder on your computer that the cRIO can then access using the network folder name.
01-25-2015 11:58 AM
That would require something to send messages from the cRIO to the Host PC. Shared Variables are common, but can be lossy. Is there anything that prevents you from storing it on the cRIO and then using the FTP later to copy te file over to your host?
01-25-2015 12:02 PM
@natasftw wrote:
That would require something to send messages from the cRIO to the Host PC. Shared Variables are common, but can be lossy. Is there anything that prevents you from storing it on the cRIO and then using the FTP later to copy te file over to your host?
Network Streams are the way to go, not shared variables.
Simply using the FTP or WebDAV (since the FTP is being deprecated) is the simplest way to go, by far.
01-25-2015 06:33 PM
I always forget those Network Streams. The few things I do with sending info back and forth generally doesn't require the lossless behavior 😃
Although, a simple right-click and select option in MAX is just as easy as everything else and far simpler to program.