From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Save myrio backup take over

Hey guys I recently launched by robot with a variety of sensor's.  These sensor's were programmed using labview and saved using the write to measurement file, express VI.  I had made a VI in labview then turned it into a RT target, and thus deploying them on my robot. 

After letting the robot run for several minute's I went back to the C drive of the myrio in which I stored all the data. 

Several files were incomplete and or divided amongst the main file's directory, I had set the main file to save as and backup file's.  It looked almost as if it had saved to these file's and then continued after a certain amount of time to these backups.  Can someone explain this?  And is their anyway to recover the whole file together?

And if so is their anyway to recover the whole file, instead of peicing together different save files.  As i have around 30 backup file's and it's tough to peice together everythng without knowning what  everything is. 

Thank you for your time,

Caleb

0 Kudos
Message 1 of 5
(6,290 Views)

Hey cwatts26,

 

Your code is pretty complicated and would probably benefit from a re-architecture.  There are lot of parallel loops that might be better off being combined into a state machine or a producer consumer architecture.  I don't really know what you're application is doing so if you provide more details we can help come up with a cleaner architecture.

 

There are also a lot of places where you're writing to files one element at a time.  It's typically better to buffer up chunks of data and only write to disk ocasionally (disk write operations are relativly slow).

 

Now if you look at the express VIs you're using (double click to open the config pane) to write to files most are set to Rename the file if it already exists.  So in this case when you're calling the Write to Measurement file over and over in a loop you'll get a bunch of similarly named files rather than one large file full of data.

 

Let us know if you have more questions about this or would like to discuss some architecture improvments.

 

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

0 Kudos
Message 2 of 5
(6,271 Views)

"There are also a lot of places where you're writing to files one element at a time.  It's typically better to buffer up chunks of data and only write to disk ocasionally (disk write operations are relativly slow)."

 

This I discovered when writing a servo code. 

 

"Nw if you look at the express VIs you're using (double click to open the config pane) to write to files most are set to Rename the file if it already exists.  So in this case when you're calling the Write to Measurement file over and over in a loop you'll get a bunch of similarly named files rather than one large file full of data."  \

 

How do I prevent this?  Would it be append to file.

Also now that I think about it, would this cause the vi to write several save points and then go to randomly numbered backup files?

 

As far as the system I say robot, but it's actually a rocket, with a bunch of sensor's that are on it.  The GPS at the bottom of the code is to work at all times with the sensor's only working on descent, with a camera looking for a match of a preset image upon descent.

 

I know the artcheture is kinda crude but I wanted clear separation between each sensor. 

 

It then has a second myrio attached to the bottom, to operate a servo with strain gauges.  The servo is pull a metallic cylinder up and down controlling a rod attached a motor.  I've attached the code as well. 

I am almost 90% certain the rod worked during flight but the saving of it came back as zero's as well, which to me think's my saving was messed up similar to the other bay of the rocket.  As their is no way an acclerometer can read zero.  And it did change the accleration as thought. 

 

 

Download All
0 Kudos
Message 3 of 5
(6,264 Views)

Append to file would at least be a step in the right direction.  That should cause the values to be appended to the existing file rather than creating a new file each time.  Keep in mind this means that even if you run your program 10 times you'd only end up with 1 of each file.

 

I think I would start with this change.

 

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

0 Kudos
Message 4 of 5
(6,259 Views)

"Append to file would at least be a step in the right direction.  That should cause the values to be appended to the existing file rather than creating a new file each time.  Keep in mind this means that even if you run your program 10 times you'd only end up with 1 of each file."

I think I would start with this change.

 

I recognize that. 

I actually wipe the rio's prior to each use and move the data over to my pc

 

 

0 Kudos
Message 5 of 5
(6,255 Views)