Go to Post In other words, don't worry about the results but strive for excellence in the way you live your life and everything you do. - Paul Copioli [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-04-2016, 21:22
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
Power Cycle Persistence

I was wondering if anyone has gotten persistence to work over power cycle. If so do you have any example code?

Edit:
To give a little more background i am trying to write a value from the Dashboard and have it be read on the robot. I have this part working. The problem i am having is how do i get the value to be save so that the next time i power the robot on it has the same value.

I am have been trying to used the persistence.ini on the roborio. However ever time i power the roborio off the values are wiped from the .ini file
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award

Last edited by Bpk9p4 : 13-04-2016 at 22:14.
Reply With Quote
  #2   Spotlight this post!  
Unread 13-04-2016, 21:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,091
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Power Cycle Persistence

Quote:
Originally Posted by Bpk9p4 View Post
I was wondering if anyone has gotten persistence to work over power cycle. If so do you have any example code?
While you are waiting for replies, you might consider providing more detail about exactly what you are trying to accomplish. What is the problem you are trying to solve?


Reply With Quote
  #3   Spotlight this post!  
Unread 15-04-2016, 08:29
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Power Cycle Persistence

Well that stinks.

I did some additional testing, and I can get it to fail.
I looked for a simple bug/fix, and instead found stuff that confuses/disturbs me.

So I need to powwow with some folks to ask some deeper questions. By changing timings, I was able to get it to work more often, but that isn't a very good solution.

If you want to do a work around, you can move the ini file to the dashboard and have a DB button that updates the variables with the file values once connection is established. I can help you write this if you don't get it pretty quick.

Hopefully I'll have a good conversation, slap my forehead, and have a small edit for you that fixes the issue.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 15-04-2016, 11:04
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
Re: Power Cycle Persistence

Thanks for looking at this. I will give you suggestion a try. Do you think this will be easier then just reading from an excel file. Do you have any example code for this?
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #5   Spotlight this post!  
Unread 15-04-2016, 11:38
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Power Cycle Persistence

Please see this code. It allows you to read/write from a file on the system.

General usage for what you want:
Use dashboard control to send variable to robot. Use 2nd control to command the values be saved.

https://github.com/allancass/836-Lib.../master/System

Example is here:
https://github.com/allancass/836-Lib...angeParameters
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote
  #6   Spotlight this post!  
Unread 15-04-2016, 14:23
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Power Cycle Persistence

If you haven't already moved away from the persistence, there are two small edits that make it work well for me.

First one is to open the NILVConfig.lvlib/Save Config File.vi. It is located in vi.lib/Utility/config.llb. This VI opens the ini file, writes the strings, and closes the file. If you wire a True constant to the Open so that it disables buffering, this solves the root of the issue. Whether this is a workaround or the best fix remains to be seen as I've also asked for others to look at this.

While looking at it, I saw something else that was a race condition and may also contribute. If you open the NT Server.vi. The initialization code on the left of the diagram reads the file to identify the persisted variables and their values. In parallel, the lower right code is started up to handle dirty variables that need to be propagated to other clients. This is also where the code updates the values of persisted variables to the ini file. While there shouldn't be any dirty variables for a bit, I'd rather make sure that we don't update the file before we know which variables are being persisted. The fix is to branch the error wire that connects the init code and the communications loop and connect it to the sequence around the DirtyList handler.

Please let me know if you make the changes, build, and still see the issue.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 15-04-2016, 14:52
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
Re: Power Cycle Persistence

i will give this a try tonight and let everyone know how they go.

Thanks a lot for the help
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #8   Spotlight this post!  
Unread 15-04-2016, 20:57
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
Re: Power Cycle Persistence

i made the change to Save Config File.vi however when i build i get the following error

https://i.imgur.com/gQk25Jq.png

the save config file.vi with the change can be seen bellow
https://i.imgur.com/q84p0oE.png

any idea how to fix this
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award

Last edited by Bpk9p4 : 15-04-2016 at 21:13.
Reply With Quote
  #9   Spotlight this post!  
Unread 16-04-2016, 07:15
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Power Cycle Persistence

OK. I have had the edit and I've done desktop and RT builds with no issues. So I'll PM to get more info on your system.

The original fix that is harder to describe is to make the value of the constant platform specific. The conditional disable structure with at symbol of TARGET_TYPE and a value of RT.

The attached image shows the T case. The default is F.

Please let me know you're able to try that and the results.
Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	From Clipboard.png
Views:	19
Size:	132.3 KB
ID:	20611  
Reply With Quote
  #10   Spotlight this post!  
Unread 16-04-2016, 21:17
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
Re: Power Cycle Persistence

i was able to make these changes and have the model build. The values were saving over power cycle. Thanks you very much for your help with this
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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