Go to Post Andy sent me this message last year: "you go, Jenny." I'm still waiting for him to say it's ok to stop. - RoboMom [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 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
  #2   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
  #3   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
  #4   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
  #5   Spotlight this post!  
Unread 15-02-2013, 08: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,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

As mentioned, SmartDashboard is very simple and doesn't have clusters. It does have arrays, so if you look at how the motors and joysticks are done, the elements are put into an array of numbers and an array of Booleans and are broken apart when accessed. This trick isn't something you have to do though. If you do it, you may find that converting from array to cluster and back is handy. But you can also do this by dropping and growing the Array Index node and the Build Array node.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2013, 16:07
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 have it so it gets binded, but when I try referencing the values it only gives me zero. Am I doing something wrong?

On the left is teleop on the right is the dashboard reference.
Attached Thumbnails
Click image for larger version

Name:	telop reference.PNG
Views:	17
Size:	6.5 KB
ID:	14023  Click image for larger version

Name:	Dashboard.PNG
Views:	15
Size:	4.8 KB
ID:	14024  
Reply With Quote
  #7   Spotlight this post!  
Unread 15-02-2013, 22:18
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

Have you tried to look at the variables tab to see if the writes are working? On the dashboard, you can click to the tab and scroll to see all variables and their current value.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2013, 12: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

The variables tab works correctly yes but that's getting variables from the code not sending variables to the code. Right?

Last edited by CooneyTech : 16-02-2013 at 17:41.
Reply With Quote
  #9   Spotlight this post!  
Unread 16-02-2013, 17:17
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 variables tab shows the current value of every variable in all network tables along with metrics on its usage. If it shows the correct value, that indicates the writes are working and the issue is with the reads, otherwise the first issue to resolve is that the writes are not working.

Greg McKaskle
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2013, 01:43
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
On the left is teleop on the right is the dashboard reference.
I see them in the other order, but no matter.

Where are those wires heading upward in the dashboard code going, and what are they connected to? Is that part of the code inside a loop?
Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2013, 09:55
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 Alan Anderson View Post
I see them in the other order, but no matter.

Where are those wires heading upward in the dashboard code going, and what are they connected to? Is that part of the code inside a loop?
It was a different test I did I was bundling them then trying to send them that way to. I have sense removed it and just did each one individually.
Reply With Quote
  #12   Spotlight this post!  
Unread 17-02-2013, 18:09
CooneyTech CooneyTech is offline
Registered User
FRC #0269
 
Join Date: Jan 2013
Location: Oconomowoc
Posts: 32
CooneyTech is an unknown quantity at this point
Post Re: Driverstation referencing

Attached I have the driver station code and the code for Teleop where i reference it.
Attached Files
File Type: zip Code for review.zip (414.4 KB, 2 views)
Reply With Quote
  #13   Spotlight this post!  
Unread 17-02-2013, 22:43
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
Attached I have the driver station code and the code for Teleop where i reference it.
It looks like your Dashboard code does a SmartDashboard write for those values once when the program begins, then never does it again. If you want to use the SD Write functions, you'll need to put them in a loop that runs as long as the values are required.

But you don't need to use the SD functions with the LabVIEW Dashboard. An indicator or control on the Operations tab is automatically a SmartDashboard variable all by itself, and Greg showed you how to make things on other tabs work as well.
Reply With Quote
  #14   Spotlight this post!  
Unread 17-02-2013, 22:56
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

If its a SD by its self how exactly do I reference it? And for a loop would a while loop work ok?
Reply With Quote
  #15   Spotlight this post!  
Unread 17-02-2013, 23:47
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
If its a SD by its self how exactly do I reference it? And for a loop would a while loop work ok?
Most of the time, you would "reference" a SmartDashboard variable simply by looking at it on the Dashboard's front panel, or by clicking on it, or by typing a number in it.

A While loop is perfect. Just make sure to include a short delay (50 ms or so) to keep it from monopolizing the CPU.
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