Go to Post I think this post is a lot of words saying "My name is Billfred and I approve MiniBots 2017" - Andrew Schreiber [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-02-2013, 10:18
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Question Driverstation referencing

Id like to be able to get values from our driver station into my code so I can quickly change code through my driver station in Labview. I have tried using the new driver station blocks that we got this year in the update that sends code to the driver station but it won't send values back to the code. Anyone have any ideas on how I can get values from the driver station to the code?

The picture below shows the values I want to use in my code.
Attached Thumbnails
Click image for larger version

Name:	driver.PNG
Views:	82
Size:	47.0 KB
ID:	13967  

Last edited by CooneyTech : 13-02-2013 at 11:03.
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2013, 21:26
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,751
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: Driverstation referencing

You've made a number of additional tabs. In order to add the controls to the binding list, duplicate the dashboard code that is attached, but create the constant from your new tab datatype and append the arrays together before binding.

That will be enough to create variables on the robot that you can read from wherever you need them.

It would be a good idea to make the variable names unique. having eight Holder controls will likely be confusing.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	39
Size:	22.5 KB
ID:	13997  
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2013, 21:38
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Talking Re: Driverstation referencing

Quote:
Originally Posted by Greg McKaskle View Post
You've made a number of additional tabs. In order to add the controls to the binding list, duplicate the dashboard code that is attached, but create the constant from your new tab datatype and append the arrays together before binding.

That will be enough to create variables on the robot that you can read from wherever you need them.

It would be a good idea to make the variable names unique. having eight Holder controls will likely be confusing.

Greg McKaskle
The holder dags are just place holders and will be changed or deleted before competition. Thanks for the help.
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2013, 22:05
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Re: Driverstation referencing

How do I append the arrays?
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2013, 22:25
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Re: Driverstation referencing

I an posting all I have so far so you can look at it. After it's bundled and binded do I reference it in my code through some sort of SD Read?
Attached Files
File Type: zip 2013 Dashboard Project.zip (255.6 KB, 4 views)
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2013, 08:35
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,751
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: Driverstation referencing

The attached image collects references to the controls in Operation and in your tab. It combines them into a single array using the array builder, and those will then be bound to variables of the same name. In order to write this code, you will need to right-click and tell the array builder whether the 2 one dimensional arrays should be built into a longer 1-D array or a 2-D array. It default to 2-D, so right click and tell it to concatenate.

The other code you were writing outside of the loops will only run once. So the D Shifter Invert doesn't do what you probably intended. If it is to be read each iteration of the loop, the terminal needs to be in the loop. I suspect that most of the other terminals won't be used on the dashboard except for display, and simply need to be stacked on the side, where the Slider 1 and Checkboxes are.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	29
Size:	46.0 KB
ID:	14003  
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2013, 10:27
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Re: Driverstation referencing

Ok I put everything where it should be and it should all be binded. When I reference it it my crio code do I side a SD write in the dashboard and a SD read in the crio code?

Last edited by CooneyTech : 14-02-2013 at 12:34.
Reply With Quote
  #8   Spotlight this post!  
Unread 14-02-2013, 20:40
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,751
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: Driverstation referencing

You can both read and write to the variable on the cRIO. You can both read and write to the variable on the dashboard.

Interactive edits to the value of the control will propagate to the variable.

The one case that will not propagate is if you write to a terminal or local of the control and want it to affect the variable. This is to avoid race conditions.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 14-02-2013, 20:51
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Re: Driverstation referencing

Quote:
Originally Posted by Greg McKaskle View Post
You can both read and write to the variable on the cRIO. You can both read and write to the variable on the dashboard.

Interactive edits to the value of the control will propagate to the variable.

The one case that will not propagate is if you write to a terminal or local of the control and want it to affect the variable. This is to avoid race conditions.

Greg McKaskle
Is their a read and write for clusters?
Reply With Quote
  #10   Spotlight this post!  
Unread 14-02-2013, 23:08
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Driverstation referencing

Quote:
Originally Posted by CooneyTech View Post
Is their a read and write for clusters?
There isn't one built in that I've found. You'll need to unbundle the cluster and write each element separately, and you can bundle them back together at the other end if you want to. If you get fancy, I think you can use a name hierarchy, adding the cluster name and a slash in front of the element name, and get things to "cluster" together in the variable viewer.
Reply With Quote
  #11   Spotlight this post!  
Unread 14-02-2013, 23:22
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Re: Driverstation referencing

Thank you Mr. McKaskle and Mr. Anderson for the help. This will make editing code at competition much fast.
Reply With Quote
  #12   Spotlight this post!  
Unread 19-02-2015, 13:42
DKolberg DKolberg is offline
Mentor Iron Giants
AKA: David Kolberg
FRC #5069 (Iron Giants)
Team Role: Mentor
 
Join Date: May 2002
Rookie Year: 2000
Location: South Bend
Posts: 44
DKolberg has a spectacular aura aboutDKolberg has a spectacular aura about
Re: Driverstation referencing

Quote:
Originally Posted by Alan Anderson View Post
There isn't one built in that I've found. You'll need to unbundle the cluster and write each element separately, and you can bundle them back together at the other end if you want to. If you get fancy, I think you can use a name hierarchy, adding the cluster name and a slash in front of the element name, and get things to "cluster" together in the variable viewer.
You can use the flatten to/from string to send anything between robot and driver station. Just have to use correct constant type for the unflatten.
__________________
David Kolberg
2014- Mentor Iron Giants 5069
2004-2010 Coach SBotz Team 1327
2000-2003 Mentor Team 135
2016 St. Joe District Event Winner
2009 WFA Boilermaker
2008 Driving Tomorrow's Technology
2005 Innovation in Control
2005 IRI Spirit of Indiana
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 12:07.

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