|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Re: Driverstation referencing
Quote:
|
|
#3
|
|||||
|
|||||
|
Re: Driverstation referencing
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.
|
|
#4
|
|||
|
|||
|
Re: Driverstation referencing
Thank you Mr. McKaskle and Mr. Anderson for the help. This will make editing code at competition much fast.
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
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 |
|
#8
|
|||
|
|||
|
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. |
|
#9
|
|||
|
|||
|
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 |
|
#10
|
|||||
|
|||||
|
Re: Driverstation referencing
Quote:
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? |
|
#11
|
|||
|
|||
|
Re: Driverstation referencing
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.
|
|
#12
|
|||
|
|||
|
Attached I have the driver station code and the code for Teleop where i reference it.
|
|
#13
|
|||||
|
|||||
|
Re: Driverstation referencing
Quote:
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. |
|
#14
|
|||
|
|||
|
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?
|
|
#15
|
|||||
|
|||||
|
Re: Driverstation referencing
Quote:
A While loop is perfect. Just make sure to include a short delay (50 ms or so) to keep it from monopolizing the CPU. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|