Go to Post "Dress to impress," typically, means no denim (sorry, Dean)... - Madison [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 31-01-2013, 08:07
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 332
fovea1959 will become famous soon enough
Setting and saving values on Dashboard

we're doing vision on our DS, and we're going to need to save all the vision parameters when we get to the venue and do calibration, then load them when we load the DS before a match.

I'm thinking about the best way in LV to pick up the initial values of a lot of controls on the DS (and some subVis). I saw this article Remembering Control Values, and am also aware of the ability to put the control values into a cluster and use cluster-to-XML and XML-to-cluster to save and load.

If I do XML cluster save and load, it looks like load would have to (for each saved value) get the value from the bundle, explicitly get the appropriate control refererence, and set the value). Do I have this right, or is there an easier way to load?

Making the cluster and saving the values looks simpler, just bundle up the values and write them.

Am I barking up the right trees, or is there an easier way to do what we need? We will *not* be running the development environment on the field for calibration, so saving current values as default is not an option.
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2013, 10:51
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,834
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Setting and saving values on Dashboard

The current default dashboard already uses an .ini file to save camera settings, located in
C://Users/Public/Public Documents/FRC/DashboardSettings.ini
You could just add your values to that and keep them all in one place.
You can just follow the example that reads both the .ini file or the team Checklist text file down at the bottom of the Dashboard block diagram.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 31-01-2013 at 10:55.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2013, 08:03
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: Setting and saving values on Dashboard

The white paper introduces the ini VIs, or the Config VIs I think they are called. As you said, XML, a text file, or even a binary file will work. I chose the ini file for the driver station and dashboard for the occasions when people want to view or edit it by hand. People may claim that XML is human readable, but not by normal humans.

The biggest difference in the approaches is that XML can encode more data types than ini, but ini is more human readable.

The other axis of this is how you read and write to the controls and indicators. You can use locals, value properties, or even VI server methods that are name and variant based. In my opinion, it is really a personal preference as to which to use. All of them work fine. The value and method allow the code to go into a subVI and are therefore more compact and more extensible, but are initially a bit harder to read and somewhat more brittle when things change.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2013, 09:41
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 332
fovea1959 will become famous soon enough
Re: Setting and saving values on Dashboard

Greg: Your last paragraph (writing the freshly read "initial" values to the controls) is what I trying to figure out. XML doesn't scare me if it makes everything else easy and robust.

When you write
Quote:
The value and method allow the code to go into a subVI and are therefore more compact and more extensible, but are initially a bit harder to read and somewhat more brittle when things change.
I'm having trouble interpreting "value and method". Are you referring to one of the methods in Remembering Control Values?
Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2013, 12:12
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: Setting and saving values on Dashboard

The attached image shows the palette that exposes the VI Server. The VI Server is a hierarchy of class oriented services to the LabVIEW editor itself and to the objects on panels.

To the left of the palette are the VI methods for getting and setting a control value by name.

To their right are property nodes that get or set the value via an object refnum. You get the refnum using other VI server icons, or you can use linked property nodes that are bound to a specific control.

The VI Server is super powerful, but not the simplest thing to figure out. You may find the examples helpful, and you may also decide that the locals are good enough for what you are doing and you don't need a more extensible solution like VI Server.

Greg McKaskle
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 22:56.

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