07-24-2012 08:11 AM
I have what I think is a pretty simple question. I've gone through several pages of results for datalogging from a cRIO and none have really helped me figure out why this isn't working.
Below is a screenshot of my code, basically I've got a datalog.csv file on my computer that the cRIO is supposed to be sending data to.
The strange thing is that Friday I had something very similar to this code working (minus correct formatting and commas)--I logged the data happily to the computer each time the loop iterated. So what's wrong now?
Thanks for your help,
Jake
07-24-2012 02:55 PM
Are you using the right path format? http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF?OpenDocument If your cRIO uses VxWorks you need a Unix style path.
Also, you can use "%s,%s %f %f,\r" in your format string and get rid of the cat strings and constants.
07-24-2012 04:51 PM
Thanks, I was able to do things a little differently and write to a TDMS file then just export that out of the cRIO and on to my local drive. I'll automate the process when I get time.
I don't know if anyone has insight on why this did work for a period of time: I was under the impression (and from what you said, it was the correct impression) that when you're logging data using a cRIO you need to save the file to the onboard memory. The thing is, I had it logging directly to a .csv file on my computer's boot disk--with very similar code to what's up there...
I'm confused.
Regards,
Jake
07-24-2012 05:16 PM
Can you give more detail on what you're doing? I'm not clear on whether your file sometimes or never is written.
You are correct that a cRIO can't write directly to another PC's hard drive. There are ways around this if you don't want to keep the file locally on the cRIO but that depends on your needs.
What do you mean by "export" the file from the cRIO to PC?
Another thought that came up, if you're using the FTP server built into Windows Explorer there is a bug with copying the same filename multiple times, even if it's been modified. Windows may use the cached copy instead of the updated one. Does this match what's happening to you?
07-24-2012 10:47 PM - edited 07-24-2012 10:53 PM
I've attached a screenshot of my current code. I'm no longer using the .csv format. I found an example on the website that was pretty helpful and the only question remaining in my mind is why the "stop" button doesn't actually stop the program...
Well, and the fact that I am sure I was saving "directly" into a file on my computer using the original code in this post. But I'll not beat a dead horse.
What I mean by "export" is that using the attached code, I get a TDMS file saved on the cRIO which I then manually go in to MAX and download to my local HDD. I don't know exactly what the code would be like to do all that programmatically so I'm holding off till I have to do it that way.
Thanks for the tip about the windows FTP server. I have downloaded filezilla on another recommendation and will use that if i run into problems.