Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Saving files on the cRio (http://www.chiefdelphi.com/forums/showthread.php?t=74419)

Bomberofdoom 14-02-2009 07:56

Saving files on the cRio
 
How is that done?

Thanks,

Greg McKaskle 14-02-2009 07:59

Re: Saving files on the cRio
 
If you want to do it from the PC, the easiest is to ftp files to the cRIO.

If you want to programmatically produce files, use the file I/O palette functions. The one that looks like a blue floppy disk. You should be able to find examples using file I/O for text and binary files. And if you need more advanced stuff you can ask.

Greg McKaskle

Bomberofdoom 14-02-2009 08:04

Re: Saving files on the cRio
 
Well, the more specific question is what is the address I need to save to? If it were to save files to the PC, I'd do: "c:\Program Files\..."

How does it work on the cRio?

Greg McKaskle 14-02-2009 08:41

Re: Saving files on the cRio
 
LV uses a path datatype that makes most paths work between platforms. On the PC you enter in a PC path, and that gets converted to a unix path for the cRIO. I think you can use c:\temp\.... Don't use strings with the whole path in it or all of it is up to you to get right.

The stuff that doesn't work for paths are the funny characters that different OSes doen't let you use, Windows has a lot of them.

Greg McKaskle

Bomberofdoom 14-02-2009 08:43

Re: Saving files on the cRio
 
"c:\temp\..." = the address to save files on the cRio?

Greg McKaskle 14-02-2009 19:33

Re: Saving files on the cRio
 
Sorry for the big delay. There was a scrimmage today.

To your question, the best way to find out is to put in a probe. The original LV RT wasn't VXWorks based, but pharlap, and perhaps I am not remembering correctly. If that doesn't work, use the unix path. I don't have a cRIO near me.

anyheck 15-02-2009 03:35

Re: Saving files on the cRio
 
2 Attachment(s)
I have a related question and rather that start a new discussion, I'll ask it here:

The idea is to log driver inputs for a 15s duration that will be played back during autonomous to let the team come up with some pre-loaded programs to run depending on their initial position.

Theoretically, the path that they record would be the path auto-driven if there aren't collisions as it would replicate the driver's inputs in approximately the same time resolution.

We haven't had time to get the camera running, nor any of the playing surface to practice on, so this was my idea to make something simpler to create than reading sensor values and whatever on their practice day before the competition.

I've saved a file to the cRIO using logging as /data_log/test.dat

using the 'Picture_Write.png' code pictured.

Then I try to load the file back in (stored on the cRIO ) using the 'Picture_Read.png' code pictured, but I get an error:

Error 1430 occurred at Open/Create/Replace Datalog in Autonomous Independent.vi

Possible reason(s):

LabVIEW: The path is empty or relative. You must use an absolute path.

/data_log/test.dat


so the same path works in write, but not in read.

I've run this in a stand-alone vi and it seems to work fine. The values seem fine 'replaying' the files on a PC indicating that it actually logged OK.

All I need is to know how to correctly reference the files to create the 'absolute path' when in playback mode.

Thanks for the help.

Regards,
Sten

Greg McKaskle 15-02-2009 10:23

Re: Saving files on the cRio
 
My windows machine is being a dog. In trying to answer this question about how RT does paths I was clearly guessing, and to continue that. The error indicates that /foo/ is considered to be a relative path. I think that means that my initial guess was at least closer to the way that RT works, using c:\ to represent root.

The test I'd do is to drop the Temporary Directory path constant on the diagram of your Robot Main. Wire it to an indicator and run the program. The syntax it uses to display the result is what you should use. In fact, the temp directory is a good place to put your files anyway.

Please post the resulting syntax if you would.

Greg McKaskle

anyheck 16-02-2009 08:33

Re: Saving files on the cRio
 
Quote:

Originally Posted by Greg McKaskle (Post 821207)
My windows machine is being a dog. In trying to answer this question about how RT does paths I was clearly guessing, and to continue that. The error indicates that /foo/ is considered to be a relative path. I think that means that my initial guess was at least closer to the way that RT works, using c:\ to represent root.

The test I'd do is to drop the Temporary Directory path constant on the diagram of your Robot Main. Wire it to an indicator and run the program. The syntax it uses to display the result is what you should use. In fact, the temp directory is a good place to put your files anyway.

Please post the resulting syntax if you would.

Greg McKaskle

Hey Greg,

That sounds like a reasonable plan. I'll try it out next time I get access to the cRIO.

I spent all yesterday letting the kids drive the wheels off of the thing in the cafeteria so I could tune the driver controls to their liking, but we're keeping all of the control electronics so we can put them on another 'bot chassis to try fun things like the vision control.

8 hours of driving on the tile seems to have really widened up the contact patch.

Regards,
Sten

P.S. For anyone who is using some of the smaller motors like window motors to do any substantial amount of work, and don't want them burning out while you run during long practice sessions, try zip-tying a length of stripped battery cable from the metal motor housing to an aluminum frame member. Works as a fast, simple heat sink.


All times are GMT -5. The time now is 04:39.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi