Go to Post FIRST is not all about the robot, it's about the experience. Don't sour yours by whining about it later. - StephLee [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2013, 00:30
Arkamond Arkamond is offline
Registered User
FRC #3102
 
Join Date: Jan 2013
Location: Minnesota
Posts: 23
Arkamond is an unknown quantity at this point
Updating Dashboard values from robot.

Status: Unsolved

Background Information:
I am in an FRC team and am the lead programmer and an electrical designer/engineer.

Specs:
FRC NI cRIO II
Labview 2012(13) with latest update
2Go PC D12 Rugged, Driver Station
2x Thrustmaster T.Flight Stick X Joystick

Issue:
I am unsuccessfully trying to update the Driver Station Dashboard with Boolean values from Teleop.

Currently, I have a VI named "Latch Launcher" which is right next to Teleop in the same case structure under Robot Main.vi and runs everything I have in there perfectly. I have three Latch Gates that allow buttons on the driver station joystick to be togglable, and those work as well. BUT, the issue i'm having is that I cannot successfully use a "SD Write Boolean" and then a corresponding "SD Read Boolean" on the driver station project, using the same string names of course, to send signals accurately.

It does work, but after a couple times, it just randomly stops sending signals or becomes stuck, and I have absolutely no idea why it is doing that or how to fix it. I tried creating another VI and leading all of the Boolean wires to that and setting the loop wait time to 50, but the CPU is overpowered then and won't do it. At 0, that still doesn't function. The only way I've found to partially get signals to work is by just using the plain node, but then it stops as I've said before.

How would one go about fixing this or a method to accurately send signals? And are there any examples to follow?

Feel free to ask questions, i'l answer them to the best of my ability.
Thanks, hope to hear some answers soon

This is how i'm writing the values in Latch Launcher


This is how I'm reading the same value on the dashboard


Here is my Labview code for the robot and dashboard, I compressed it to multiple formats for cross-compatability.
Robot Project:
-Self-Extracting 7-Zip Archive
-7-zip Archive
-Zip Archive

Dashboard Project:
-Self-Extracting 7-Zip
-7-Zip Archive
-Zip Archive
  #2   Spotlight this post!  
Unread 11-02-2013, 07:55
bumblebee3339's Avatar
bumblebee3339 bumblebee3339 is offline
Team's main account
FRC #3339 (BumbleBee)
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Israel
Posts: 34
bumblebee3339 is an unknown quantity at this point
Re: Updating Dashboard values from robot.

It might be a bit wierd, but I tried to do a simillar thing with a button in the dashboard and it didnt work when I tried to write a vlaue on the teleop and read it in the dashboard. It only worked when I used ONLY 'read' in the teleop with the name of the control in the dashboard.

Maybe you should change the writing refNum to the name of the bool indicator and delete the read function. Give it a try
  #3   Spotlight this post!  
Unread 11-02-2013, 10:16
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: Updating Dashboard values from robot.

I didn't download your zip, but where is your read code located? Is it in a loop that is executing?

The other way to view data from your robot is simply to name the button the same as your variable and place it in the Operations tab on the dashboard. The read will be done for you.

Greg McKaskle
  #4   Spotlight this post!  
Unread 11-02-2013, 11:16
Arkamond Arkamond is offline
Registered User
FRC #3102
 
Join Date: Jan 2013
Location: Minnesota
Posts: 23
Arkamond is an unknown quantity at this point
Re: Updating Dashboard values from robot.

Quote:
Originally Posted by Greg McKaskle View Post
I didn't download your zip, but where is your read code located? Is it in a loop that is executing?

The other way to view data from your robot is simply to name the button the same as your variable and place it in the Operations tab on the dashboard. The read will be done for you.

Greg McKaskle
Yes, the VI named "Latch Launcher" executes the same as Teleop, as it's in the same case structure. All functions work correctly in this VI in Teleop, and is where the "read code" is located. The "SD Write" node (Which is what is used to set the values to the dashboard) will work a couple times and then randomly stop or lock, although functions on the robot are still working fine.

How would you go about naming a button differently? And our buttons have a latching function that I implimented, we have to go through the output of the latch gate in order to determine what is turned on or off.
  #5   Spotlight this post!  
Unread 11-02-2013, 11:22
Arkamond Arkamond is offline
Registered User
FRC #3102
 
Join Date: Jan 2013
Location: Minnesota
Posts: 23
Arkamond is an unknown quantity at this point
Re: Updating Dashboard values from robot.

Quote:
Originally Posted by bumblebee3339 View Post
It might be a bit wierd, but I tried to do a simillar thing with a button in the dashboard and it didnt work when I tried to write a vlaue on the teleop and read it in the dashboard. It only worked when I used ONLY 'read' in the teleop with the name of the control in the dashboard.

Maybe you should change the writing refNum to the name of the bool indicator and delete the read function. Give it a try
Do you mean use an "SD Read Boolean" instead of an "SD Write Boolean" node? The only issue with that is you cannot connect the Boolean wire anywhere, as it's giving an output, not receiving and input Boolean.

Not sure exactly what you're suggesting to do, as Boolean wires can't go to String inputs
  #6   Spotlight this post!  
Unread 11-02-2013, 11:41
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,113
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: Updating Dashboard values from robot.

I think you just want to show something on the Dashboard representing the state of a SmartDashboard boolean variable you're writing in the robot code. If that's right, then just put a boolean indicator on the Dashboard front panel, set its label to the name of the SmartDashboard variable, and...there is no step 3.

An unwired control or indicator in the Dashboard is automatically treated as a SmartDashboard variable.
  #7   Spotlight this post!  
Unread 11-02-2013, 17:17
Arkamond Arkamond is offline
Registered User
FRC #3102
 
Join Date: Jan 2013
Location: Minnesota
Posts: 23
Arkamond is an unknown quantity at this point
Re: Updating Dashboard values from robot.

Quote:
Originally Posted by Alan Anderson View Post
I think you just want to show something on the Dashboard representing the state of a SmartDashboard boolean variable you're writing in the robot code. If that's right, then just put a boolean indicator on the Dashboard front panel, set its label to the name of the SmartDashboard variable, and...there is no step 3.

An unwired control or indicator in the Dashboard is automatically treated as a SmartDashboard variable.
Could you provide an example via a picture or something? I'm still not sure what you mean by it's "Label". What would I have to put in the robots code and then in the Dashboard code?
  #8   Spotlight this post!  
Unread 11-02-2013, 22:08
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: Updating Dashboard values from robot.

The default dashboard contains three initial controls with labels of Slider 1, Checkbox 1 and Checkbox 2. The label is the name of the control. You change it by double clicking the existing label and typing a new one. If it isn't shown, you right click on the control, choose Visible Items and show the label. When you drop a new control, it typically has no label, but is blank and ready for you to type into it.

Greg McKaskle
  #9   Spotlight this post!  
Unread 11-02-2013, 23:50
mocibot's Avatar
mocibot mocibot is offline
Registered User
FRC #1829 (Carbonauts)
Team Role: Student
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Here
Posts: 21
mocibot is just really nicemocibot is just really nicemocibot is just really nicemocibot is just really nice
Re: Updating Dashboard values from robot.

My interpretation of the Dashboard VI names and Context Help leads me to believe that the Dashboard VIs are not for use in the Dashboard code, but in the robot code. This also matches with the default text of the Dashboard. So the Read xxxx(where xxxx is string, number, bool, what have you) reads the value from the Dashboard and the Write xxx (same as before) writes to the Dashboard. I haven't had a chance to see if this is the case, if anyone can confirm or deny this let please me know.
__________________
Good luck, stay safe, learn new things, and have fun!
I'm a student, because I don't fit in any one category.
  #10   Spotlight this post!  
Unread 12-02-2013, 03:01
Arkamond Arkamond is offline
Registered User
FRC #3102
 
Join Date: Jan 2013
Location: Minnesota
Posts: 23
Arkamond is an unknown quantity at this point
Re: Updating Dashboard values from robot.

So if I wanted to send a signal from this to the dashboard,


I would just need the "launching enabled" on the dashboard like this?
  #11   Spotlight this post!  
Unread 12-02-2013, 06:54
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: Updating Dashboard values from robot.

The images you attached seem to write the variable correctly on the robot. If all you want to do is to display the variable to the drivers, then you do not even need to place the terminal in the loop shown. The Slider 1 and others are stacked to the side of the diagram near a comment. The important think is that the front panel control is placed in the Operations tab.

Greg McKaskle
  #12   Spotlight this post!  
Unread 13-02-2013, 00:43
Arkamond Arkamond is offline
Registered User
FRC #3102
 
Join Date: Jan 2013
Location: Minnesota
Posts: 23
Arkamond is an unknown quantity at this point
Re: Updating Dashboard values from robot.

Well I tested out the code changes today, but I found out that i'm still having the same issue to some degree. After some time, the signals stop responding. Although, all signals stop responding for a short time and then only the signals in Teleop.vi for Joystick buttons/axis' show up on the dashboard, but my indicators do nothing.

It also does this the other way. If my indicators work, then the signals from Teleop.vi to the dashboard are all 0.

Although, there is one issue and that may be a cause or symptom of what is causing this issue, and that is the indicators still stick. If the robot is turned off, whatever was on the dashboard as true stays true and doesn't go away. Shouldn't this turn off?

Anyway, I have absolutely no idea why it does this, as Teleop.vi and Latch Launcher.vi are both set at 0 for wait times and are located in the same area, but it seems that the robot goes from one to the other randomly and sometimes just stops.

Any ideas anybody?
  #13   Spotlight this post!  
Unread 13-02-2013, 10:33
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,113
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: Updating Dashboard values from robot.

A wait time of 0 in a While loop has no effect. You have loops running as fast and as often as they can, which can (and often does) starve other important tasks of CPU cycles. That includes essential communication tasks which must run in order to keep the system watchdog from shutting all outputs off.

For code that reads joystick values, there's usually no reason to run loops any more quickly than every 20 milliseconds. That's how often the data is sent from the Driver Station.


But your program has a couple of structural problems that will cause things to get weird.

First, you absolutely should not have that While loop in your Teleop vi. Teleop itself gets called repeatedly, and needs to do its job and be done well before the next data packet arrives from the Driver Station. Remove the loop (and its associated wait).

Second, you really ought not to be messing with the Robot Main vi at all. There's no difference between adding a vi to its Teleop case and just putting that vi in Teleop itself.

Third, the Latch Launcher vi is a big While loop that never ends. That will stall Robot Main when it gets invoked, and everything will come to a halt. Take it out of Robot Main and put it in the Periodic Tasks vi, which is where such loops belong.

Finally, the Latch Launcher loop is also unthrottled. Since it's responding to joystick buttons, change its 0 ms wait to a 20 ms wait.
  #14   Spotlight this post!  
Unread 13-02-2013, 23:40
Arkamond Arkamond is offline
Registered User
FRC #3102
 
Join Date: Jan 2013
Location: Minnesota
Posts: 23
Arkamond is an unknown quantity at this point
Re: Updating Dashboard values from robot.

Well that fixed it.

I placed the while loop of latch launcher and all its contents into Periodic Tasks.vi aside the other pre-existing loops and after dumping the code to the robot, it worked fine for the dashboard. Both Teleop and my functions show the buttons lighting up correctly and there's no issues on the dashboard itself or the button presses, so it works as intended.

Although, now that I've fixed that and expanded upon fixing a motor issue I had, the actual functions don't seem to work anymore, which is an entirely different issue that I'l make a different thread for. I'l mark this thread as "solved" and provide the solution on my original post once I fix that, to make sure I don't have to do anything else with sending values to the dashboard.

Thank you all for helping! (Oh, and i'l definitely need help with getting this motor bug worked out (Not really complicated, i'm just missing something that is probably obvious), so if you want to, find my other thread once it's up.
Closed Thread


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:11.

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