![]() |
Dashboard in LabVIEW
3 Attachment(s)
Hey Chiefdelphi,
I am working on our dashboard project and ran into some problems. Here is what I am trying to do: I need to, in disable.vi of our robot code, pull a Boolean array from the dashboard which then determines what auton to run. I also send the dashboard an array of auton files we have on the robot to be displayed. Here is the problem I am having: The dashboard works perfectly fine although, I can't seem to pull the boolean array in disable.vi from the smartdashboard. I have pictures attached of what my code looks like. Could someone please help me so that I can pull the results from a control in a dashboard project into code on the cRio? Thanks! |
Re: Dashboard in LabVIEW
1 Attachment(s)
Just as more clarification for my problem, I attached the screenshot of what I am getting. The AutonSelector Boolean Array in the smartDashboard region on the dashboard is giving False, True. Yet in the code, it gets absolutely nothing. The refresh button works though... Any suggestions?
|
Re: Dashboard in LabVIEW
1 Attachment(s)
We ran into similar issues, but the problem is probably this: programmatic updates to controls and indicators do not update SD blocks on the cRIO. For example, manually pressing a button will send a value to the robot, but updating a button via a block of code will not.
To fix it, just make sure to also write to an SD Write Boolean Array block when you write to your control or indicator. I've attached an example from our dashboard code showing how we send vision info to the robot. |
Re: Dashboard in LabVIEW
Quote:
|
Re: Dashboard in LabVIEW
This was in a loop; loop 2 of the default dashboard code, to be specific. It wouldn't necessarily have to be in a loop in your case, but you just need to make sure that every time you write to the indicator or control, you write to the SD variable as well.
|
Re: Dashboard in LabVIEW
Nothing was changed by sending it to an SD Write Boolean Array.vi. I tried putting it in a loop and keeping it outside of a loop.
Sending info to the dashboard works - I can read a string array. The problem still arises when I am sending the data to the cRio. The weird thing is one of my buttons works while everything else fails... |
Re: Dashboard in LabVIEW
Could you attach your Dashboard Main.vi so I can take a look at it? I'm not quite sure how you have the code set up.
|
Re: Dashboard in LabVIEW
1 Attachment(s)
DashboardMain.vi attached
|
Re: Dashboard in LabVIEW
1 Attachment(s)
Aha - I think you do need to put that in a loop. I can't test your code due to missing VI's, but I think moving the variable write inside your main loop should fix the issue.
I think what was happening is that the variable write would only happen once, but then would never run again. Changing the control does not inherently trigger the variable write, so you need to make sure that it continually writes to the variable. |
Re: Dashboard in LabVIEW
Thanks for the reply. I had tried doing that before, and as I did what you suggested, still doesn't work. Although, we have found something interesting that other teams may want to investigate on...
Regardless of where we put a control in the loop or outside of the loop, it still shows up inside the SmartDashboard. Any data type will work like that. HOWEVER, we found that the Boolean Array and Boolean controls have some issues. We can get the numeric, value, string array, string and numeric array SD Write and SD Read.vis to work, yet somehow we have issues with the boolean write and read related datatype. After much evaluation and time looking through this, we believe it to be some issue with the SD Write/Read blocks themselves (just for boolean associated data type). To get around this, we are just going to convert booleans to numeric (Dashboard side) and then via the robot code, convert back into boolean. If anyone else has this problem or suggests a fix, please post! Thanks for your help! |
Re: Dashboard in LabVIEW
A simple attempt to send a SmartDashboard boolean from the Dashboard to the robot didn't work for us. Rather than dig deeply into the code to see what might or might not work, I tried a simple hack that ended up working fine.
Make the boolean an indicator rather than a control. Right-click on it in the block diagram and choose Create >> Property Node >> Value (Signaling). Wire up whatever value you want to send to that property node. That'll let you change the indicator value. |
Re: Dashboard in LabVIEW
Do the checkboxes in the default dashboard and robot code not work? Do you have more specifics at to what Boolean, which side was reading, which was writing?
Greg McKaskle |
Re: Dashboard in LabVIEW
Quote:
|
Re: Dashboard in LabVIEW
Checkboxes (i.e. controls) work fine to send information to the robot by clicking on them manually. Indicators work fine to receive information from the robot.
We were reading the keyboard in the Dashboard program and sending a status flag back to the robot. Our tests had the desired keypress controlling a boolean indicator on the front panel, but the robot wasn't reading it. I suppose we should have used a simple Smart Dashboard write function, but we were in the mindset of using unconnected controls and didn't think it through. |
Re: Dashboard in LabVIEW
Quote:
|
| All times are GMT -5. The time now is 12:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi